mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-17 12:09:28 +00:00
improvements 2
This commit is contained in:
@@ -61,6 +61,8 @@ $route['api/v1/organisation/[O|o]rganisationseinheit/(:any)'] = 'api/v1/organisa
|
||||
$route['api/v1/ressource/[B|b]etriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1';
|
||||
$route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
|
||||
|
||||
$route['studentenverwaltung/(:any)'] = 'Studentenverwaltung/index';
|
||||
|
||||
// load routes from extensions
|
||||
$subdir = 'application/config/extensions';
|
||||
$dirlist = scandir($subdir);
|
||||
|
||||
@@ -1,149 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Studentenverwaltung extends FHC_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// TODO(chris): access!
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
// TODO(chris): load stgs (this is just for testing)
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect('v.studiengang_kz');
|
||||
$this->StudiengangModel->addSelect('tbl_studiengang.bezeichnung');
|
||||
$this->StudiengangModel->addSelect('kurzbzlang');
|
||||
$this->StudiengangModel->addSelect('erhalter_kz');
|
||||
$this->StudiengangModel->addSelect('typ');
|
||||
$this->StudiengangModel->addSelect('kurzbz');
|
||||
|
||||
$this->StudiengangModel->addOrder('erhalter_kz');
|
||||
$this->StudiengangModel->addOrder('typ');
|
||||
$this->StudiengangModel->addOrder('kurzbz');
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere(['v.aktiv' => true]);
|
||||
if (isError($result))
|
||||
return $this->outputJson($result);
|
||||
if (!hasData($result))
|
||||
return $this->outputJsonSuccess([]);
|
||||
$list = getData($result);
|
||||
$list[] = [
|
||||
'name' => 'International',
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Incoming',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Outgoing',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Gemeinsame Studien',
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
];
|
||||
$this->outputJsonSuccess($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @return void
|
||||
*/
|
||||
public function getStudiengang($studiengang_kz)
|
||||
{
|
||||
// TODO(chris): load stgSemester + prestudent
|
||||
$this->outputJson([
|
||||
[
|
||||
'key' => 2,
|
||||
'name' => 'PreStudent'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @return void
|
||||
*/
|
||||
public function getStudents($studiengang_kz = null)
|
||||
{
|
||||
// TODO(chris): stdSem?
|
||||
$stdSem='SS2023';
|
||||
|
||||
// TODO(chris): load students filtered by the params
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->PrestudentModel->addJoin('public.tbl_person p', 'person_id');
|
||||
$this->PrestudentModel->addJoin('public.tbl_student s', 'prestudent_id');
|
||||
$this->PrestudentModel->addJoin('public.tbl_benutzer b', 's.student_uid=b.uid');
|
||||
$this->PrestudentModel->addJoin('public.tbl_studentlehrverband v', 'v.student_uid=s.student_uid AND v.studiensemester_kurzbz=' . $this->PrestudentModel->escape($stdSem));
|
||||
|
||||
$this->PrestudentModel->addSelect('p.person_id');
|
||||
$this->PrestudentModel->addSelect('s.prestudent_id');
|
||||
$this->PrestudentModel->addSelect('b.uid');
|
||||
$this->PrestudentModel->addSelect('titelpre');
|
||||
$this->PrestudentModel->addSelect('titelpost');
|
||||
$this->PrestudentModel->addSelect('vorname');
|
||||
$this->PrestudentModel->addSelect('wahlname');
|
||||
$this->PrestudentModel->addSelect('vornamen');
|
||||
$this->PrestudentModel->addSelect('geschlecht');
|
||||
$this->PrestudentModel->addSelect('nachname');
|
||||
$this->PrestudentModel->addSelect('gebdatum');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.anmerkung');
|
||||
$this->PrestudentModel->addSelect('ersatzkennzeichen');
|
||||
$this->PrestudentModel->addSelect('svnr');
|
||||
$this->PrestudentModel->addSelect('s.matrikelnr');
|
||||
$this->PrestudentModel->addSelect('p.anmerkung AS anmerkungen');
|
||||
$this->PrestudentModel->addSelect('v.semester');
|
||||
$this->PrestudentModel->addSelect('v.verband');
|
||||
$this->PrestudentModel->addSelect('v.gruppe');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.studiengang_kz');
|
||||
$this->PrestudentModel->addSelect('aufmerksamdurch_kurzbz');
|
||||
$this->PrestudentModel->addSelect('mentor');
|
||||
$this->PrestudentModel->addSelect('b.aktiv AS bnaktiv');
|
||||
$this->PrestudentModel->addSelect("(SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp='email' AND person_id=p.person_id AND zustellung LIMIT 1) AS email_privat", false);
|
||||
$this->PrestudentModel->addSelect("(SELECT rt_gesamtpunkte AS punkte FROM public.tbl_prestudent WHERE prestudent_id=s.prestudent_id) AS punkte", false);
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.dual');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.reihungstest_id');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.anmeldungreihungstest');
|
||||
$this->PrestudentModel->addSelect('p.matr_nr');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.gsstudientyp_kurzbz');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.aufnahmegruppe_kurzbz');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.priorisierung');
|
||||
$this->PrestudentModel->addSelect('p.zugangscode');
|
||||
$this->PrestudentModel->addSelect('p.bpk');
|
||||
|
||||
$this->PrestudentModel->addOrder('nachname');
|
||||
$this->PrestudentModel->addOrder('vorname');
|
||||
|
||||
// TODO(chris): do we need that? do we want that?
|
||||
if ($studiengang_kz === null)
|
||||
$this->PrestudentModel->addLimit(1000);
|
||||
|
||||
if ($studiengang_kz !== null)
|
||||
$result = $this->PrestudentModel->loadWhere([
|
||||
'tbl_prestudent.studiengang_kz' => $studiengang_kz
|
||||
]);
|
||||
else
|
||||
$result = $this->PrestudentModel->load();
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson(getError($result));
|
||||
} else {
|
||||
$this->outputJson(getData($result));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,343 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Students extends FHC_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// TODO(chris): access!
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Remap calls:
|
||||
* / => return []
|
||||
* /inout => return []
|
||||
* /inout/incoming => getIncoming
|
||||
* /inout/outgoing => getOutgoing
|
||||
* /inout/gemeinsamestudien => getGemeinsamestudien
|
||||
* /(studiengang_kz) => getStudents
|
||||
* /(studiengang_kz)/prestudent => getPrestudents
|
||||
* /(studiengang_kz)/prestudent/* => getPrestudents
|
||||
* /(studiengang_kz)/(semester) => getStudents
|
||||
* /(studiengang_kz)/(semester)/grp/(gruppe_kurzbz) => getStudents
|
||||
* /(studiengang_kz)/(semester)/(verband) => getStudents
|
||||
* /(studiengang_kz)/(semester)/(verband)/(gruppe) => getStudents
|
||||
* /(studiengang_kz)/(org_form) => getStudents
|
||||
* /(studiengang_kz)/(org_form)/prestudent => getPrestudents
|
||||
* /(studiengang_kz)/(org_form)/prestudent/* => getPrestudents
|
||||
* /(studiengang_kz)/(org_form)/(semester) => getStudents
|
||||
* /(studiengang_kz)/(org_form)/(semester)/grp/(gruppe_kurzbz)
|
||||
* => getStudents
|
||||
* /(studiengang_kz)/(org_form)/(semester)/(verband) => getStudents
|
||||
* /(studiengang_kz)/(org_form)/(semester)/(verband)/(gruppe)
|
||||
* => getStudents
|
||||
* /uid/(student_uid) => getStudent
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $params (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _remap($method, $params = [])
|
||||
{
|
||||
if ($method == '' || $method == 'index')
|
||||
return $this->outputJson([]);
|
||||
|
||||
if ($method == 'inout') {
|
||||
if (!count($params))
|
||||
return $this->outputJson([]);
|
||||
switch ($params[0]) {
|
||||
case 'incoming':
|
||||
return $this->getIncoming();
|
||||
case 'outgoing':
|
||||
return $this->getOutgoing();
|
||||
case 'gemeinsamestudien':
|
||||
return $this->getGemeinsamestudien();
|
||||
default:
|
||||
return show_404();
|
||||
}
|
||||
}
|
||||
|
||||
$count = count($params);
|
||||
if (!$count)
|
||||
return $this->getStudents($method);
|
||||
|
||||
if ($method == 'uid' && $count == 1)
|
||||
return $this->getStudent($params[0]);
|
||||
|
||||
if (is_numeric($params[0])) {
|
||||
$sem = $params[0];
|
||||
if ($count == 3 && $params[1] == 'grp') {
|
||||
$g = $params[2];
|
||||
$ver = null;
|
||||
$grp = null;
|
||||
} else {
|
||||
$g = null;
|
||||
$ver = $count > 1 ? $params[1] : null;
|
||||
$grp = $count > 2 ? $params[2] : null;
|
||||
}
|
||||
return $this->getStudents($method, $sem, $ver, $grp, $g);
|
||||
} elseif ($params[0] == 'prestudent') {
|
||||
if ($count == 1)
|
||||
return $this->getPrestudents($method);
|
||||
if ($count == 2)
|
||||
return $this->getPrestudents($method, $params[1]);
|
||||
return $this->getPrestudents($method, $params[1], $params[$count-1]);
|
||||
} else {
|
||||
$org = $params[0];
|
||||
if ($count > 1 && $params[1] == 'prestudent') {
|
||||
if ($count == 2)
|
||||
return $this->getPrestudents(null, null, $org);
|
||||
if ($count == 3)
|
||||
return $this->getPrestudents($params[2], null, $org);
|
||||
return $this->getPrestudents($params[2], $params[$count-1], $org);
|
||||
}
|
||||
$sem = $count > 1 ? $params[1] : null;
|
||||
if ($count == 4 && $params[2] == 'grp') {
|
||||
$g = $params[3];
|
||||
$ver = null;
|
||||
$grp = null;
|
||||
} else {
|
||||
$g = null;
|
||||
$ver = $count > 2 ? $params[2] : null;
|
||||
$grp = $count > 3 ? $params[3] : null;
|
||||
}
|
||||
|
||||
return $this->getStudents($method, $sem, $ver, $grp, $g, $org);
|
||||
}
|
||||
|
||||
show_404();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function getIncoming()
|
||||
{
|
||||
// TODO(chris): IMPLEMENT!
|
||||
$this->outputJson([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function getOutgoing()
|
||||
{
|
||||
// TODO(chris): IMPLEMENT!
|
||||
$this->outputJson([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function getGemeinsamestudien()
|
||||
{
|
||||
// TODO(chris): IMPLEMENT!
|
||||
$this->outputJson([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param string $studiensemester_kurzbz (optional)
|
||||
* @param string $filter (optional)
|
||||
* @param string $orgform_kurzbz (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getPrestudents($studiengang_kz, $studiensemester_kurzbz = null, $filter = null, $orgform_kurzbz = null)
|
||||
{
|
||||
// TODO(chris): @see: prestudent.class::loadInteressentenUndBewerber
|
||||
// TODO(chris): IMPLEMENT!
|
||||
$this->outputJson([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param integer $semester (optional)
|
||||
* @param string $verband (optional)
|
||||
* @param integer $gruppe (optional)
|
||||
* @param string $gruppe_kurzbz (optional)
|
||||
* @param string $orgform_kurzbz (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getStudents($studiengang_kz, $semester = null, $verband = null, $gruppe = null, $gruppe_kurzbz = null, $orgform_kurzbz = null)
|
||||
{
|
||||
// TODO(chris): stdSem from Variable
|
||||
$studiensemester_kurzbz='SS2023';
|
||||
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->PrestudentModel->addJoin('public.tbl_person p', 'person_id');
|
||||
$this->PrestudentModel->addJoin('public.tbl_student s', 'prestudent_id');
|
||||
$this->PrestudentModel->addJoin('public.tbl_benutzer b', 's.student_uid=b.uid');
|
||||
$this->PrestudentModel->addJoin(
|
||||
'public.tbl_studentlehrverband v',
|
||||
'v.student_uid=s.student_uid AND v.studiensemester_kurzbz=' . $this->PrestudentModel->escape($studiensemester_kurzbz)
|
||||
);
|
||||
|
||||
$this->PrestudentModel->addSelect('p.person_id');
|
||||
$this->PrestudentModel->addSelect('s.prestudent_id');
|
||||
$this->PrestudentModel->addSelect('b.uid');
|
||||
$this->PrestudentModel->addSelect('titelpre');
|
||||
$this->PrestudentModel->addSelect('titelpost');
|
||||
$this->PrestudentModel->addSelect('vorname');
|
||||
$this->PrestudentModel->addSelect('wahlname');
|
||||
$this->PrestudentModel->addSelect('vornamen');
|
||||
$this->PrestudentModel->addSelect('geschlecht');
|
||||
$this->PrestudentModel->addSelect('nachname');
|
||||
$this->PrestudentModel->addSelect('gebdatum');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.anmerkung');
|
||||
$this->PrestudentModel->addSelect('ersatzkennzeichen');
|
||||
$this->PrestudentModel->addSelect('svnr');
|
||||
$this->PrestudentModel->addSelect('s.matrikelnr');
|
||||
$this->PrestudentModel->addSelect('p.anmerkung AS anmerkungen');
|
||||
$this->PrestudentModel->addSelect('v.semester');
|
||||
$this->PrestudentModel->addSelect('v.verband');
|
||||
$this->PrestudentModel->addSelect('v.gruppe');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.studiengang_kz');
|
||||
$this->PrestudentModel->addSelect('aufmerksamdurch_kurzbz');
|
||||
$this->PrestudentModel->addSelect('mentor');
|
||||
$this->PrestudentModel->addSelect('b.aktiv AS bnaktiv');
|
||||
$this->PrestudentModel->addSelect(
|
||||
"(SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp='email' AND person_id=p.person_id AND zustellung LIMIT 1) AS email_privat",
|
||||
false
|
||||
);
|
||||
$this->PrestudentModel->addSelect(
|
||||
"(SELECT rt_gesamtpunkte AS punkte FROM public.tbl_prestudent WHERE prestudent_id=s.prestudent_id) AS punkte",
|
||||
false
|
||||
);
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.dual');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.reihungstest_id');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.anmeldungreihungstest');
|
||||
$this->PrestudentModel->addSelect('p.matr_nr');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.gsstudientyp_kurzbz');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.aufnahmegruppe_kurzbz');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.priorisierung');
|
||||
$this->PrestudentModel->addSelect('p.zugangscode');
|
||||
$this->PrestudentModel->addSelect('p.bpk');
|
||||
|
||||
$this->PrestudentModel->addOrder('nachname');
|
||||
$this->PrestudentModel->addOrder('vorname');
|
||||
|
||||
|
||||
$where = [];
|
||||
|
||||
if ($gruppe_kurzbz !== null) {
|
||||
$this->PrestudentModel->addJoin('public.tbl_benutzergruppe g', 'uid');
|
||||
$where['g.gruppe_kurzbz'] = $gruppe_kurzbz;
|
||||
$where['g.studiensemester_kurzbz'] = $studiensemester_kurzbz;
|
||||
} else {
|
||||
$where['v.studiengang_kz'] = $studiengang_kz;
|
||||
|
||||
if ($semester !== null)
|
||||
$where['v.semester'] = $semester;
|
||||
|
||||
if ($verband !== null)
|
||||
$where['v.verband'] = $verband;
|
||||
|
||||
if ($gruppe !== null)
|
||||
$where['v.gruppe'] = $gruppe;
|
||||
|
||||
if (!$verband && !$gruppe && $orgform_kurzbz !== null) {
|
||||
$this->PrestudentModel->db->where(
|
||||
"(
|
||||
SELECT orgform_kurzbz
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id=tbl_prestudent.prestudent_id
|
||||
AND studiensemester_kurzbz=" . $this->PrestudentModel->escape($studiensemester_kurzbz) . "
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1
|
||||
)",
|
||||
$this->PrestudentModel->escape($orgform_kurzbz),
|
||||
false
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$result = $this->PrestudentModel->loadWhere($where);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson(getError($result));
|
||||
} else {
|
||||
$this->outputJson(getData($result) ?: []);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param string $student_uid
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getStudent($student_uid)
|
||||
{
|
||||
// TODO(chris): stdSem from Variable
|
||||
$studiensemester_kurzbz='SS2023';
|
||||
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->PrestudentModel->addJoin('public.tbl_person p', 'person_id');
|
||||
$this->PrestudentModel->addJoin('public.tbl_student s', 'prestudent_id');
|
||||
$this->PrestudentModel->addJoin('public.tbl_benutzer b', 's.student_uid=b.uid');
|
||||
$this->PrestudentModel->addJoin(
|
||||
'public.tbl_studentlehrverband v',
|
||||
'v.student_uid=s.student_uid AND v.studiensemester_kurzbz=' . $this->PrestudentModel->escape($studiensemester_kurzbz)
|
||||
);
|
||||
|
||||
$this->PrestudentModel->addSelect('p.person_id');
|
||||
$this->PrestudentModel->addSelect('s.prestudent_id');
|
||||
$this->PrestudentModel->addSelect('b.uid');
|
||||
$this->PrestudentModel->addSelect('titelpre');
|
||||
$this->PrestudentModel->addSelect('titelpost');
|
||||
$this->PrestudentModel->addSelect('vorname');
|
||||
$this->PrestudentModel->addSelect('wahlname');
|
||||
$this->PrestudentModel->addSelect('vornamen');
|
||||
$this->PrestudentModel->addSelect('geschlecht');
|
||||
$this->PrestudentModel->addSelect('nachname');
|
||||
$this->PrestudentModel->addSelect('gebdatum');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.anmerkung');
|
||||
$this->PrestudentModel->addSelect('ersatzkennzeichen');
|
||||
$this->PrestudentModel->addSelect('svnr');
|
||||
$this->PrestudentModel->addSelect('s.matrikelnr');
|
||||
$this->PrestudentModel->addSelect('p.anmerkung AS anmerkungen');
|
||||
$this->PrestudentModel->addSelect('v.semester');
|
||||
$this->PrestudentModel->addSelect('v.verband');
|
||||
$this->PrestudentModel->addSelect('v.gruppe');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.studiengang_kz');
|
||||
$this->PrestudentModel->addSelect('aufmerksamdurch_kurzbz');
|
||||
$this->PrestudentModel->addSelect('mentor');
|
||||
$this->PrestudentModel->addSelect('b.aktiv AS bnaktiv');
|
||||
$this->PrestudentModel->addSelect(
|
||||
"(SELECT kontakt FROM public.tbl_kontakt WHERE kontakttyp='email' AND person_id=p.person_id AND zustellung LIMIT 1) AS email_privat",
|
||||
false
|
||||
);
|
||||
$this->PrestudentModel->addSelect(
|
||||
"(SELECT rt_gesamtpunkte AS punkte FROM public.tbl_prestudent WHERE prestudent_id=s.prestudent_id) AS punkte",
|
||||
false
|
||||
);
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.dual');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.reihungstest_id');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.anmeldungreihungstest');
|
||||
$this->PrestudentModel->addSelect('p.matr_nr');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.gsstudientyp_kurzbz');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.aufnahmegruppe_kurzbz');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.priorisierung');
|
||||
$this->PrestudentModel->addSelect('p.zugangscode');
|
||||
$this->PrestudentModel->addSelect('p.bpk');
|
||||
|
||||
$where = [];
|
||||
|
||||
$result = $this->PrestudentModel->loadWhere([
|
||||
's.student_uid' => $student_uid
|
||||
]);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson(getError($result));
|
||||
} else {
|
||||
$this->outputJson(getData($result) ?: []);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,429 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Verband extends FHC_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// TODO(chris): access!
|
||||
parent::__construct();
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remap calls:
|
||||
* /
|
||||
* /(studiengang_kz) => getStudiengang
|
||||
* /(studiengang_kz)/(semester) => getSemester
|
||||
* /(studiengang_kz)/(semester)/(verband) => getVerband
|
||||
* /(studiengang_kz)/(org_form) => getStudiengang
|
||||
* /(studiengang_kz)/(org_form)/(semester) => getSemester
|
||||
* /(studiengang_kz)/(org_form)/(semester)/(verband) => getVerband
|
||||
*
|
||||
* @param string $method
|
||||
* @param array $params (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _remap($method, $params = [])
|
||||
{
|
||||
if ($method == '' || $method == 'index')
|
||||
return $this->getBase();
|
||||
|
||||
$count = count($params);
|
||||
if (!$count)
|
||||
return $this->getStudiengang($method);
|
||||
|
||||
if ($count == 1) {
|
||||
if (is_numeric($params[0]))
|
||||
return $this->getSemester($method, $params[0]);
|
||||
else
|
||||
return $this->getStudiengang($method, $params[0]);
|
||||
}
|
||||
if ($count == 2) {
|
||||
if (is_numeric($params[0]))
|
||||
return $this->getVerband($method, $params[0], $params[1]);
|
||||
else
|
||||
return $this->getSemester($method, $params[1], $params[0]);
|
||||
}
|
||||
if ($count == 3 && !is_numeric($params[0]) && is_numeric($params[1]) && !is_numeric($params[2]))
|
||||
return $this->getVerband($method, $params[1], $params[2], $params[0]);
|
||||
|
||||
show_404();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
protected function getBase()
|
||||
{
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("v.studiengang_kz AS link");
|
||||
$this->StudiengangModel->addSelect("CONCAT(kurzbzlang, ' (', UPPER(CONCAT(typ, kurzbz)), ') - ', tbl_studiengang.bezeichnung) AS name", false);
|
||||
$this->StudiengangModel->addSelect('erhalter_kz');
|
||||
$this->StudiengangModel->addSelect('typ');
|
||||
$this->StudiengangModel->addSelect('kurzbz');
|
||||
|
||||
$this->StudiengangModel->addOrder('erhalter_kz');
|
||||
$this->StudiengangModel->addOrder('typ');
|
||||
$this->StudiengangModel->addOrder('kurzbz');
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere(['v.aktiv' => true]);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
|
||||
$list = getData($result) ?: [];
|
||||
$list[] = [
|
||||
'name' => 'International',
|
||||
'link' => 'inout',
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Incoming',
|
||||
'link' => 'inout/incoming',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Outgoing',
|
||||
'link' => 'inout/outgoing',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Gemeinsame Studien',
|
||||
'link' => 'inout/gemeinsamestudien',
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
];
|
||||
$this->outputJson($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param string $orgform (optional)
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getStudiengang($studiengang_kz, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", semester) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester ORDER BY verband, gruppe LIMIT 1)) AS name", false);
|
||||
|
||||
$this->StudiengangModel->addSelect('semester');
|
||||
|
||||
$this->StudiengangModel->addOrder('semester');
|
||||
|
||||
if ($org_form !== null) {
|
||||
$this->StudiengangModel->db->group_start();
|
||||
$this->StudiengangModel->db->where('v.semester', 0);
|
||||
$this->StudiengangModel->db->or_where('v.orgform_kurzbz', $org_form);
|
||||
$this->StudiengangModel->db->group_end();
|
||||
}
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.aktiv' => true
|
||||
]);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
|
||||
$list = getData($result) ?: [];
|
||||
array_unshift($list, [
|
||||
'name' => 'PreStudent',
|
||||
'link' => $link . 'prestudent',
|
||||
'children' => $this->getStdSem($link . 'prestudent/')
|
||||
]);
|
||||
|
||||
if ($org_form === null) {
|
||||
// NOTE(chris): if mischform show orgforms
|
||||
$result = $this->StudiengangModel->load($studiengang_kz);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
if (hasData($result)) {
|
||||
if (current(getData($result))->mischform) {
|
||||
$this->load->model('organisation/Studienordnung_model', 'StudienordnungModel');
|
||||
|
||||
$this->StudienordnungModel->addDistinct();
|
||||
$this->StudienordnungModel->addSelect("CONCAT(studiengang_kz, '/', p.orgform_kurzbz) AS link");
|
||||
$this->StudienordnungModel->addSelect("p.orgform_kurzbz AS name");
|
||||
|
||||
// TODO(chris): semester for gruppe_kurzbz <- what did i mean by that?
|
||||
|
||||
$this->StudienordnungModel->addJoin('lehre.tbl_studienplan p', 'studienordnung_id');
|
||||
|
||||
$result = $this->StudienordnungModel->loadWhere([
|
||||
'aktiv' => true,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'p.orgform_kurzbz !=' => 'DDP'
|
||||
]);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
|
||||
if (hasData($result))
|
||||
$list = array_merge($list, getData($result));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
$this->outputJson($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param integer $semester
|
||||
* @param string $orgform
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getSemester($studiengang_kz, $semester, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
$link .= $semester . '/';
|
||||
|
||||
|
||||
$this->load->model('organisation/Gruppe_model', 'GruppeModel');
|
||||
|
||||
$this->GruppeModel->addDistinct();
|
||||
$this->GruppeModel->addSelect("CONCAT(" . $this->GruppeModel->escape($link . 'grp/') . ", gruppe_kurzbz) AS link", false);
|
||||
$this->GruppeModel->addSelect("CONCAT(gruppe_kurzbz, ' (', bezeichnung, ')') AS name", false);
|
||||
$this->GruppeModel->addSelect("TRUE AS leaf", false);
|
||||
|
||||
$this->GruppeModel->addSelect('sort');
|
||||
$this->GruppeModel->addSelect('gruppe_kurzbz');
|
||||
|
||||
$this->GruppeModel->addOrder('sort');
|
||||
$this->GruppeModel->addOrder('gruppe_kurzbz');
|
||||
|
||||
$where = [
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'semester' => $semester,
|
||||
'lehre' => true,
|
||||
'sichtbar' => true,
|
||||
'aktiv' => true,
|
||||
'direktinskription' => false
|
||||
];
|
||||
|
||||
if ($org_form !== null)
|
||||
$where['orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->GruppeModel->loadWhere($where);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
|
||||
$list = getData($result) ?: [];
|
||||
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", verband) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, verband, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester AND verband=v.verband ORDER BY gruppe LIMIT 1)) AS name", false);
|
||||
$this->StudiengangModel->addSelect("CASE WHEN MAX(gruppe)='' OR MAX(gruppe)=' ' THEN TRUE ELSE FALSE END AS leaf");
|
||||
|
||||
$this->StudiengangModel->addSelect('verband');
|
||||
|
||||
$this->StudiengangModel->addOrder('verband');
|
||||
|
||||
$this->StudiengangModel->addGroupBy('link, name, verband');
|
||||
|
||||
$where = [
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.semester' => $semester,
|
||||
'v.verband !=' => '',
|
||||
'v.aktiv' => true
|
||||
];
|
||||
|
||||
if ($org_form !== null && $semester) // NOTE(chris): on semester 0 show all?
|
||||
$where['v.orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere($where);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
|
||||
$list = array_merge($list, getData($result) ?: []);
|
||||
|
||||
$this->outputJson($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param integer $studiengang_kz
|
||||
* @param integer $semester
|
||||
* @param integer $verband
|
||||
* @param string $orgform
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function getVerband($studiengang_kz, $semester, $verband, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
$link .= $semester . '/'. $verband . '/';
|
||||
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", gruppe) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, verband, gruppe, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester AND verband=v.verband AND gruppe=v.gruppe ORDER BY gruppe LIMIT 1)) AS name", false);
|
||||
$this->StudiengangModel->addSelect("TRUE AS leaf", false);
|
||||
|
||||
$this->StudiengangModel->addSelect('gruppe');
|
||||
|
||||
$this->StudiengangModel->addOrder('gruppe');
|
||||
|
||||
$where = [
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.semester' => $semester,
|
||||
'v.verband' => $verband,
|
||||
'v.gruppe !=' => '',
|
||||
'v.aktiv' => true
|
||||
];
|
||||
|
||||
if ($org_form !== null && $semester) // NOTE(chris): on semester 0 show all?
|
||||
$where['v.orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere($where);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
|
||||
$list = getData($result) ?: [];
|
||||
|
||||
$this->outputJson($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $link
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function getStdSem($link)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
/**
|
||||
* TODO(chris): filter with variable:
|
||||
* - $number_displayed_past_studiensemester from Variable
|
||||
* - then: $stsem_obj->getPlusMinus(NULL, $number_displayed_past_studiensemester, 'ende ASC');
|
||||
*/
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson(getError($result));
|
||||
exit;
|
||||
}
|
||||
|
||||
$studiensemester = getData($result) ?: [];
|
||||
$result = [];
|
||||
|
||||
foreach ($studiensemester as $sem) {
|
||||
$semlink = $link . $sem->studiensemester_kurzbz;
|
||||
$intlink = $semlink . '/interessenten';
|
||||
$result[] = [
|
||||
'name' => $sem->studiensemester_kurzbz,
|
||||
'link' => $semlink,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Interessenten',
|
||||
'link' => $intlink,
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Bewerbung nicht abgeschickt',
|
||||
'link' => $intlink . '/bewerbungnichtabgeschickt',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Bewerbung abgeschickt, Status unbestätigt',
|
||||
'link' => $intlink . '/bewerbungabgeschickt',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'ZGV erfüllt',
|
||||
'link' => $intlink . '/zgv',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Status bestätigt',
|
||||
'link' => $intlink . '/statusbestaetigt',
|
||||
'children' => [
|
||||
[
|
||||
'name' => 'Nicht zum Reihungstest angemeldet',
|
||||
'link' => $intlink . '/statusbestaetigt/reihungstestnichtangemeldet',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Reihungstest angemeldet',
|
||||
'link' => $intlink . '/statusbestaetigt/reihungstestangemeldet',
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'Nicht zum Reihungstest angemeldet',
|
||||
'link' => $intlink . '/reihungstestnichtangemeldet',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Reihungstest angemeldet',
|
||||
'link' => $intlink . '/reihungstestangemeldet',
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'Bewerber',
|
||||
'link' => $semlink . '/bewerber',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Aufgenommen',
|
||||
'link' => $semlink . '/aufgenommen',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Warteliste',
|
||||
'link' => $semlink . '/warteliste',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Absage',
|
||||
'link' => $semlink . '/absage',
|
||||
'leaf' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Incoming',
|
||||
'link' => $semlink . '/incoming',
|
||||
'leaf' => true
|
||||
]
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@@ -21,32 +21,7 @@
|
||||
?>
|
||||
|
||||
<div id="main">
|
||||
<header class="navbar navbar-expand-lg navbar-dark bg-dark flex-md-nowrap p-0 shadow">
|
||||
<a class="navbar-brand col-md-4 col-lg-3 col-xl-2 me-0 px-3" href="<?= site_url('Studentenverwaltung'); ?>">FHC 4.0</a>
|
||||
<button class="navbar-toggler d-md-none m-1 collapsed" type="button" data-bs-toggle="offcanvas" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||
<fhc-searchbar :searchoptions="searchbaroptions" :searchfunction="searchfunction" class="searchbar w-100"></fhc-searchbar>
|
||||
</header>
|
||||
|
||||
<div class="container-fluid overflow-hidden">
|
||||
<div class="row h-100">
|
||||
<nav id="sidebarMenu" class="bg-light offcanvas offcanvas-start col-md p-md-0 h-100">
|
||||
<div class="offcanvas-header justify-content-end px-1 d-md-none">
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
</div>
|
||||
<stv-verband @select-verband="onSelectVerband"></stv-verband>
|
||||
</nav>
|
||||
<main class="col-md-8 ms-sm-auto col-lg-9 col-xl-10">
|
||||
<vertical-split>
|
||||
<template #top>
|
||||
<stv-list ref="stvList" v-model:selected="selected"></stv-list>
|
||||
</template>
|
||||
<template #bottom>
|
||||
<stv-details :student="lastSelected"></stv-details>
|
||||
</template>
|
||||
</vertical-split>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
<router-view></router-view>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer', $includesArray); ?>
|
||||
|
||||
@@ -15,77 +15,25 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import FhcSearchbar from "../components/searchbar/searchbar.js";
|
||||
import StvVerband from "../components/Studienverwaltung/Verband.js";
|
||||
import StvList from "../components/Studienverwaltung/List.js";
|
||||
import StvDetails from "../components/Studienverwaltung/Details.js";
|
||||
import VerticalSplit from "../components/verticalsplit/verticalsplit.js";
|
||||
import FhcStudentenverwaltung from "../components/Stv/Studentenverwaltung.js";
|
||||
import fhcapifactory from "./api/fhcapifactory.js";
|
||||
|
||||
Vue.$fhcapi = fhcapifactory;
|
||||
|
||||
const app = Vue.createApp({
|
||||
components: {
|
||||
FhcSearchbar,
|
||||
StvVerband,
|
||||
StvList,
|
||||
StvDetails,
|
||||
VerticalSplit
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selected: [],
|
||||
searchbaroptions: {
|
||||
types: [
|
||||
"person",
|
||||
"student",
|
||||
"prestudent"
|
||||
],
|
||||
actions: {
|
||||
person: {
|
||||
defaultaction: {
|
||||
type: "link",
|
||||
action: function(data) {
|
||||
return data.profil;
|
||||
}
|
||||
},
|
||||
childactions: [
|
||||
{
|
||||
"label": "testchildaction1",
|
||||
"icon": "fas fa-check-circle",
|
||||
"type": "function",
|
||||
"action": function(data) {
|
||||
alert('person testchildaction 01 ' + JSON.stringify(data));
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "testchildaction2",
|
||||
"icon": "fas fa-file-csv",
|
||||
"type": "function",
|
||||
"action": function(data) {
|
||||
alert('person testchildaction 02 ' + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
lastSelected() {
|
||||
return this.selected[this.selected.length - 1];
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSelectVerband(link) {
|
||||
this.$refs.stvList.updateUrl(link);
|
||||
},
|
||||
searchfunction(searchsettings) {
|
||||
return Vue.$fhcapi.Search.search(searchsettings);
|
||||
}
|
||||
}
|
||||
const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
|
||||
const router = VueRouter.createRouter({
|
||||
history: VueRouter.createWebHistory(),
|
||||
routes: [
|
||||
{ path: `/${ciPath}/studentenverwaltung`, component: FhcStudentenverwaltung },
|
||||
{ path: `/${ciPath}/studentenverwaltung/:id`, component: FhcStudentenverwaltung }
|
||||
]
|
||||
});
|
||||
|
||||
app.use(primevue.config.default).mount('#main');
|
||||
const app = Vue.createApp();
|
||||
|
||||
app
|
||||
.use(router)
|
||||
.use(primevue.config.default)
|
||||
.mount('#main');
|
||||
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
import {CoreFilterCmpt} from "../filter/Filter.js";
|
||||
import {CoreRESTClient} from '../../RESTClient.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CoreFilterCmpt
|
||||
},
|
||||
props: {
|
||||
selected: Array
|
||||
},
|
||||
emits: [
|
||||
'update:selected'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
tabulatorOptions: {
|
||||
ajaxURL: CoreRESTClient._generateRouterURI("components/Studentenverwaltung/getStudents"),
|
||||
|
||||
//autoColumns: true,
|
||||
columns:[
|
||||
{title:"UID", field:"uid"},
|
||||
{title:"TitelPre", field:"titelpre"},
|
||||
{title:"Nachname", field:"nachname"},
|
||||
{title:"Vorname", field:"vorname"},
|
||||
{title:"Wahlname", field:"wahlname", visible:false},
|
||||
// TODO(chris): IMPLEMENT!
|
||||
],
|
||||
|
||||
height: 'auto',
|
||||
selectable: true
|
||||
},
|
||||
tabulatorEvents: [
|
||||
{
|
||||
event: 'rowSelectionChanged',
|
||||
handler: this.rowSelectionChanged
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
actionNewPrestudent() {
|
||||
console.log('actionNewPrestudent');
|
||||
},
|
||||
rowSelectionChanged(data) {
|
||||
this.$emit('update:selected', data);
|
||||
},
|
||||
updateUrl(url) {
|
||||
this.$refs.table.tabulator.setData(CoreRESTClient._generateRouterURI(url));
|
||||
console.log(CoreRESTClient._generateRouterURI(url));
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
template: `
|
||||
<div class="stv-list h-100 pt-3">
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
reload
|
||||
new-btn-show
|
||||
new-btn-label="Prestudent"
|
||||
@click:new="actionNewPrestudent"
|
||||
>
|
||||
</core-filter-cmpt>
|
||||
</div>`
|
||||
};
|
||||
@@ -0,0 +1,117 @@
|
||||
/**
|
||||
* Copyright (C) 2022 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import FhcSearchbar from "../searchbar/searchbar.js";
|
||||
import VerticalSplit from "../verticalsplit/verticalsplit.js";
|
||||
import StvVerband from "./Studentenverwaltung/Verband.js";
|
||||
import StvList from "./Studentenverwaltung/List.js";
|
||||
import StvDetails from "./Studentenverwaltung/Details.js";
|
||||
|
||||
|
||||
export default {
|
||||
components: {
|
||||
FhcSearchbar,
|
||||
StvVerband,
|
||||
StvList,
|
||||
StvDetails,
|
||||
VerticalSplit
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
selected: [],
|
||||
searchbaroptions: {
|
||||
types: [
|
||||
"person",
|
||||
"student",
|
||||
"prestudent"
|
||||
],
|
||||
actions: {
|
||||
person: {
|
||||
defaultaction: {
|
||||
type: "link",
|
||||
action: function(data) {
|
||||
return data.profil;
|
||||
}
|
||||
},
|
||||
childactions: [
|
||||
{
|
||||
"label": "testchildaction1",
|
||||
"icon": "fas fa-check-circle",
|
||||
"type": "function",
|
||||
"action": function(data) {
|
||||
alert('person testchildaction 01 ' + JSON.stringify(data));
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "testchildaction2",
|
||||
"icon": "fas fa-file-csv",
|
||||
"type": "function",
|
||||
"action": function(data) {
|
||||
alert('person testchildaction 02 ' + JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
lastSelected() {
|
||||
return this.selected[this.selected.length - 1];
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onSelectVerband(link) {
|
||||
this.$refs.stvList.updateUrl(link);
|
||||
},
|
||||
searchfunction(searchsettings) {
|
||||
return Vue.$fhcapi.Search.search(searchsettings);
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (this.$route.params.id) {
|
||||
this.$refs.stvList.updateUrl('components/stv/students/uid/' + this.$route.params.id);
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<header class="navbar navbar-expand-lg navbar-dark bg-dark flex-md-nowrap p-0 shadow">
|
||||
<a class="navbar-brand col-md-4 col-lg-3 col-xl-2 me-0 px-3" href="<?= site_url('Studentenverwaltung'); ?>">FHC 4.0</a>
|
||||
<button class="navbar-toggler d-md-none m-1 collapsed" type="button" data-bs-toggle="offcanvas" data-bs-target="#sidebarMenu" aria-controls="sidebarMenu" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||
<fhc-searchbar :searchoptions="searchbaroptions" :searchfunction="searchfunction" class="searchbar w-100"></fhc-searchbar>
|
||||
</header>
|
||||
<div class="container-fluid overflow-hidden">
|
||||
<div class="row h-100">
|
||||
<nav id="sidebarMenu" class="bg-light offcanvas offcanvas-start col-md p-md-0 h-100">
|
||||
<div class="offcanvas-header justify-content-end px-1 d-md-none">
|
||||
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button>
|
||||
</div>
|
||||
<stv-verband @select-verband="onSelectVerband"></stv-verband>
|
||||
</nav>
|
||||
<main class="col-md-8 ms-sm-auto col-lg-9 col-xl-10">
|
||||
<vertical-split>
|
||||
<template #top>
|
||||
<stv-list ref="stvList" v-model:selected="selected"></stv-list>
|
||||
</template>
|
||||
<template #bottom>
|
||||
<stv-details :student="lastSelected"></stv-details>
|
||||
</template>
|
||||
</vertical-split>
|
||||
</main>
|
||||
</div>
|
||||
</div>`
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
import DetailsDetails from './Details/Details.js';
|
||||
import DetailsNotizen from './Details/Notizen.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
DetailsDetails,
|
||||
DetailsNotizen
|
||||
},
|
||||
props: {
|
||||
student: Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
component: 'DetailsDetails',
|
||||
tabs: {
|
||||
DetailsDetails: 'Details',
|
||||
DetailsNotizen: 'Notizen'
|
||||
}
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div class="stv-details h-100 pb-3">
|
||||
<ul class="nav nav-tabs">
|
||||
<li v-for="(title, comp) in tabs" class="nav-item" :key="comp">
|
||||
<a class="nav-link" :class="{active: comp == component}" :aria-current="comp == component ? 'page' : ''" href="#" @click="component=comp">{{title}}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<component :is="component" :student="student"></component>
|
||||
</div>`
|
||||
};
|
||||
@@ -0,0 +1,87 @@
|
||||
export default {
|
||||
props: {
|
||||
student: Object
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
person_id: '',
|
||||
bpk: '',
|
||||
anrede: '',
|
||||
titelpre: '',
|
||||
titelpost: '',
|
||||
nachname: '',
|
||||
vorname: '',
|
||||
vornamen: '',
|
||||
wahlname: '',
|
||||
gebdatum: '',
|
||||
gebort: '',
|
||||
gebnation: ''
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
student(n) {
|
||||
this.person_id = n.person_id;
|
||||
this.bpk = n.bpk;
|
||||
this.anrede = n.anrede;
|
||||
this.titelpre = n.titelpre;
|
||||
this.titelpost = n.titelpost;
|
||||
this.nachname = n.nachname;
|
||||
this.vorname = n.vorname;
|
||||
this.vornamen = n.vornamen;
|
||||
this.wahlname = n.wahlname;
|
||||
this.gebdatum = n.gebdatum;
|
||||
// TODO(chris): gebdatum > datepicker
|
||||
// TODO(chris): gebort & getnation?
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div class="stv-details-details h-100 pb-3">
|
||||
<fieldset>
|
||||
<legend>Person</legend>
|
||||
<div class="row mb-3">
|
||||
<label for="stv-details-person_id" class="col-sm-1 col-form-label">Person ID</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="stv-details-person_id" type="text" class="form-control" v-model="person_id">
|
||||
</div>
|
||||
<label for="stv-details-bpk" class="col-sm-1 col-form-label">BPK</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="stv-details-bpk" type="text" class="form-control" v-model="bpk">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="stv-details-anrede" class="col-sm-1 col-form-label">Anrede</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="stv-details-anrede" type="text" class="form-control" v-model="anrede">
|
||||
</div>
|
||||
<label for="stv-details-titelpre" class="col-sm-1 col-form-label">Titel Pre</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="stv-details-titelpre" type="text" class="form-control" v-model="titelpre">
|
||||
</div>
|
||||
<label for="stv-details-titelpost" class="col-sm-1 col-form-label">Titel Post</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="stv-details-titelpost" type="text" class="form-control" v-model="titelpost">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="stv-details-wahlname" class="col-sm-1 col-form-label">Wahlname</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="stv-details-wahlname" type="text" class="form-control" v-model="wahlname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="stv-details-gebdatum" class="col-sm-1 col-form-label">Geburtsdatum</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="stv-details-gebdatum" type="text" class="form-control" v-model="gebdatum">
|
||||
</div>
|
||||
<label for="stv-details-gebort" class="col-sm-1 col-form-label">Geburtsort</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="stv-details-gebort" type="text" class="form-control" v-model="gebort">
|
||||
</div>
|
||||
<label for="stv-details-gebnation" class="col-sm-1 col-form-label">Geburtsnation</label>
|
||||
<div class="col-sm-3">
|
||||
<input id="stv-details-gebnation" type="text" class="form-control" v-model="gebnation">
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>`
|
||||
};
|
||||
+2
-2
@@ -3,7 +3,7 @@ export default {
|
||||
student: Object
|
||||
},
|
||||
template: `
|
||||
<div class="stv-details h-100 pb-3">
|
||||
{{student}}
|
||||
<div class="stv-details-details h-100 pb-3">
|
||||
NOT YET IMPLEMENTED
|
||||
</div>`
|
||||
};
|
||||
@@ -0,0 +1,114 @@
|
||||
import {CoreFilterCmpt} from "../../filter/Filter.js";
|
||||
import {CoreRESTClient} from '../../../RESTClient.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CoreFilterCmpt
|
||||
},
|
||||
props: {
|
||||
selected: Array
|
||||
},
|
||||
emits: [
|
||||
'update:selected'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
tabulatorOptions: {
|
||||
columns:[
|
||||
{title:"UID", field:"uid"},
|
||||
{title:"TitelPre", field:"titelpre"},
|
||||
{title:"Nachname", field:"nachname"},
|
||||
{title:"Vorname", field:"vorname"},
|
||||
{title:"Wahlname", field:"wahlname", visible:false},
|
||||
{title:"Vornamen", field:"vornamen", visible:false},
|
||||
{title:"TitelPost", field:"titelpost"},
|
||||
{title:"SVNR", field:"svnr"},
|
||||
{title:"Ersatzkennzeichen", field:"ersatzkennzeichen"},
|
||||
{title:"Geburtsdatum", field:"geburtsdatum_iso"},
|
||||
{title:"Geschlecht", field:"geschlecht"},
|
||||
{title:"Sem.", field:"semester"},
|
||||
{title:"Verb.", field:"verband"},
|
||||
{title:"Grp.", field:"gruppe"},
|
||||
{title:"Studiengang", field:"studiengang"},
|
||||
{title:"Studiengang_kz", field:"studiengang_kz", visible:false},
|
||||
{title:"Personenkennzeichen", field:"matrikelnummer"},
|
||||
{title:"PersonID", field:"person_id"},
|
||||
{title:"Status", field:"status"},
|
||||
{title:"Status Datum", field:"status_datum_iso", visible:false},
|
||||
{title:"Status Bestaetigung", field:"status_bestaetigung_iso", visible:false},
|
||||
{title:"Status Datum ISO", field:"status_datum_iso", visible:false},
|
||||
{title:"Status Bestaetigung ISO", field:"status_bestaetigung_iso", visible:false},
|
||||
{title:"EMail (Privat)", field:"mail_privat", visible:false},
|
||||
{title:"EMail (Intern)", field:"mail_intern", visible:false},
|
||||
{title:"Anmerkungen", field:"anmerkungen", visible:false},
|
||||
{title:"AnmerkungPre", field:"anmerkungpre", visible:false},
|
||||
{title:"OrgForm", field:"orgform"},
|
||||
{title:"Aufmerksamdurch", field:"orgform", visible:false},
|
||||
{title:"Gesamtpunkte", field:"punkte", visible:false},
|
||||
{title:"Aufnahmegruppe", field:"aufnahmegruppe_kurzbz", visible:false},
|
||||
{title:"Dual", field:"dual_bezeichnung", visible:false},
|
||||
{title:"Matrikelnummer", field:"matr_nr", visible:false},
|
||||
{title:"Studienplan", field:"studienplan_bezeichnung"},
|
||||
{title:"PreStudentInnenID", field:"prestudent_id"},
|
||||
{title:"Priorität", field:"priorisierung_realtiv"},
|
||||
{title:"Mentor", field:"mentor", visible:false},
|
||||
{title:"Aktiv", field:"aktiv", visible:false},
|
||||
{title:"GeburtsdatumISO", field:"geburtsdatum_iso", visible:false},
|
||||
],
|
||||
|
||||
layout: 'fitDataFill',
|
||||
layoutColumnsOnNewData: false,
|
||||
height: 'auto',
|
||||
selectable: true,
|
||||
//persistence: true
|
||||
},
|
||||
tabulatorEvents: [
|
||||
{
|
||||
event: 'rowSelectionChanged',
|
||||
handler: this.rowSelectionChanged
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
actionNewPrestudent() {
|
||||
console.log('actionNewPrestudent');
|
||||
},
|
||||
rowSelectionChanged(data) {
|
||||
this.$emit('update:selected', data);
|
||||
},
|
||||
updateUrl(url) {
|
||||
this.$refs.table.tabulator.on("dataProcessed", () => {
|
||||
let rows = this.$refs.table.tabulator.getRows();
|
||||
if (rows.length && rows.length == 1) {
|
||||
console.log();
|
||||
this.$refs.table.tabulator.selectRow();
|
||||
}
|
||||
});
|
||||
|
||||
if (!this.$refs.table.tableBuilt)
|
||||
this.$refs.table.tabulator.on("tableBuilt", () => {
|
||||
this.$refs.table.tabulator.setData(CoreRESTClient._generateRouterURI(url));
|
||||
});
|
||||
else
|
||||
this.$refs.table.tabulator.setData(CoreRESTClient._generateRouterURI(url));
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
template: `
|
||||
<div class="stv-list h-100 pt-3">
|
||||
<core-filter-cmpt
|
||||
ref="table"
|
||||
:tabulator-options="tabulatorOptions"
|
||||
:tabulator-events="tabulatorEvents"
|
||||
table-only
|
||||
:side-menu="false"
|
||||
reload
|
||||
new-btn-show
|
||||
new-btn-label="Prestudent"
|
||||
@click:new="actionNewPrestudent"
|
||||
>
|
||||
</core-filter-cmpt>
|
||||
</div>`
|
||||
};
|
||||
+18
-23
@@ -1,4 +1,4 @@
|
||||
import {CoreRESTClient} from '../../RESTClient.js';
|
||||
import {CoreRESTClient} from '../../../RESTClient.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -17,55 +17,50 @@ export default {
|
||||
methods: {
|
||||
onExpandTreeNode(node) {
|
||||
if (!node.children) {
|
||||
let url = '';
|
||||
if (node.data.studiengang_kz) {
|
||||
url = "getStudiengang/" + node.data.studiengang_kz;
|
||||
}
|
||||
|
||||
if (url) {
|
||||
if (node.data.link) {
|
||||
this.loading = true;
|
||||
CoreRESTClient
|
||||
.get("components/Studentenverwaltung/" + url)
|
||||
.get("components/stv/verband/" + node.data.link)
|
||||
.then(result => result.data)
|
||||
.then(result => {
|
||||
const subNodes = result.data.map(this.mapResultToTreeData);
|
||||
const subNodes = result.map(this.mapResultToTreeData);
|
||||
node.children = subNodes;
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onSelectTreeNode(node) {
|
||||
if (node.link)
|
||||
this.$emit('selectVerband', node.link);
|
||||
if (node.data.link)
|
||||
this.$emit('selectVerband', 'components/stv/students/' + node.data.link);
|
||||
},
|
||||
mapResultToTreeData(el) {
|
||||
const cp = {
|
||||
key: ("" + el.link).replace('/', '-'),
|
||||
data: el
|
||||
};
|
||||
if (el.studiengang_kz !== undefined) {
|
||||
cp.key = el.studiengang_kz;
|
||||
cp.data.name = el.kurzbzlang + ' (' + (el.typ + el.kurzbz).toUpperCase() + ') - ' + el.bezeichnung;
|
||||
cp.leaf = false;
|
||||
cp.link = 'components/Studentenverwaltung/getStudents/' + el.studiengang_kz;
|
||||
}
|
||||
|
||||
if (el.children)
|
||||
cp.children = el.children.map(this.mapResultToTreeData);
|
||||
else
|
||||
cp.leaf = el.leaf || false;
|
||||
|
||||
return cp;
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
CoreRESTClient
|
||||
.get("components/Studentenverwaltung")
|
||||
.get("components/stv/verband")
|
||||
.then(result => result.data)
|
||||
.then(result => {
|
||||
if(CoreRESTClient.isError(result)) {
|
||||
console.error(CoreRESTClient.getError(result));
|
||||
} else if (CoreRESTClient.hasData(result)) {
|
||||
this.nodes = CoreRESTClient.getData(result).map(this.mapResultToTreeData);
|
||||
}
|
||||
this.nodes = result.map(this.mapResultToTreeData);
|
||||
this.loading = false;
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error);
|
||||
});
|
||||
},
|
||||
template: `
|
||||
Reference in New Issue
Block a user