diff --git a/application/config/lvverwaltung.php b/application/config/lvverwaltung.php
new file mode 100644
index 000000000..4fe09bff3
--- /dev/null
+++ b/application/config/lvverwaltung.php
@@ -0,0 +1,11 @@
+ ['readonly' => false],
+ 'tag_1' => ['readonly' => true]
+];
+*/
+
+$config['lvverwaltung_tags'] = [];
\ No newline at end of file
diff --git a/application/config/navigation.php b/application/config/navigation.php
index f6daaee8d..36812fff8 100644
--- a/application/config/navigation.php
+++ b/application/config/navigation.php
@@ -64,7 +64,7 @@ $config['navigation_header'] = array(
'lehrveranstaltungen' => array(
'link' => site_url('lehre/lvplanung/LvTemplateUebersicht'),
'icon' => '',
- 'description' => 'Lehrveranstaltungen',
+ 'description' => 'Lehrveranstaltungen Templates',
'sort' => 15
),
'reihungstest' => array(
@@ -81,6 +81,16 @@ $config['navigation_header'] = array(
'sort' => 30,
'requiredPermissions' => 'infocenter:r'
),
+ 'lvverwaltung' => array(
+ 'link' => site_url('LVVerwaltung'),
+ 'icon' => '',
+ 'description' => 'LV Verwaltung',
+ 'requiredPermissions' => array(
+ 'admin:r',
+ 'assistenz:r'
+ ),
+ 'sort' => 35
+ ),
'lehrauftrag' => array(
'link' => site_url('lehre/lehrauftrag/Lehrauftrag/Dashboard'),
'description' => 'Lehrauftrag',
diff --git a/application/controllers/Cis/Documents.php b/application/controllers/Cis/Documents.php
index c5a6684d3..0b8d08a56 100644
--- a/application/controllers/Cis/Documents.php
+++ b/application/controllers/Cis/Documents.php
@@ -72,7 +72,7 @@ class Documents extends Auth_Controller
$stgs = [];
$stsemArray = [];
- $buchungstypen = implode('\',\'', defined("CIS_DOKUMENTE_STUDIENBEITRAG_TYPEN") ? unserialize(CIS_DOKUMENTE_STUDIENBEITRAG_TYPEN) : []);
+ $buchungstypen = defined("CIS_DOKUMENTE_STUDIENBEITRAG_TYPEN") ? unserialize(CIS_DOKUMENTE_STUDIENBEITRAG_TYPEN) : [];
$person_ids = [];
foreach ($stati as $status) {
$person_ids[] = $status->person_id;
diff --git a/application/controllers/Cis/ProfilUpdate.php b/application/controllers/Cis/ProfilUpdate.php
index 74641d748..698b091d1 100644
--- a/application/controllers/Cis/ProfilUpdate.php
+++ b/application/controllers/Cis/ProfilUpdate.php
@@ -13,7 +13,7 @@ class ProfilUpdate extends Auth_Controller
{
parent::__construct([
'index' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r'],
- 'show' => ['basis/cis:r'],
+ 'show' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r', 'basis/cis:r'],
'id' => ['student/stammdaten:r', 'mitarbeiter/stammdaten:r']
]);
diff --git a/application/controllers/LVVerwaltung.php b/application/controllers/LVVerwaltung.php
new file mode 100644
index 000000000..2a79d6375
--- /dev/null
+++ b/application/controllers/LVVerwaltung.php
@@ -0,0 +1,42 @@
+method] = ['admin:r', 'assistenz:r'];
+ parent::__construct($permissions);
+
+ $this->load->library('VariableLib', ['uid' => getAuthUID()]);
+ }
+
+ /**
+ * @return void
+ */
+ public function _remap()
+ {
+ $this->load->view('LVVerwaltung', [
+ 'permissions' => [
+ 'lehre/lehrveranstaltung' => $this->permissionlib->isBerechtigt('lehre/lehrveranstaltung'),
+ 'lv-plan/gruppenentfernen' => $this->permissionlib->isBerechtigt('lv-plan/gruppenentfernen'),
+ 'lv-plan/lektorentfernen' => $this->permissionlib->isBerechtigt('lv-plan/lektorentfernen'),
+ ],
+ 'variables' => [
+ 'semester_aktuell' => $this->variablelib->getVar('semester_aktuell')
+ ],
+ 'configs' => [
+ 'showVertragsdetails' => defined('FAS_LV_LEKTORINNENZUTEILUNG_VERTRAGSDETAILS_ANZEIGEN') && FAS_LV_LEKTORINNENZUTEILUNG_VERTRAGSDETAILS_ANZEIGEN,
+ 'showGewichtung' => defined('CIS_GESAMTNOTE_GEWICHTUNG') && CIS_GESAMTNOTE_GEWICHTUNG,
+ 'lehreinheitAnmerkungDefault' => defined('LEHREINHEIT_ANMERKUNG_DEFAULT') ? LEHREINHEIT_ANMERKUNG_DEFAULT : '',
+ 'lehreinheitRaumtypDefault' => defined('DEFAULT_LEHREINHEIT_RAUMTYP') ? DEFAULT_LEHREINHEIT_RAUMTYP : '',
+ 'lehreinheitRaumtypAlternativeDefault' => defined('DEFAULT_LEHREINHEIT_RAUMTYP_ALTERNATIV') ? DEFAULT_LEHREINHEIT_RAUMTYP_ALTERNATIV : ''
+ ]
+ ]);
+
+ }
+}
diff --git a/application/controllers/api/frontend/v1/Lehrveranstaltung.php b/application/controllers/api/frontend/v1/Lehrveranstaltung.php
new file mode 100644
index 000000000..2e254bfc8
--- /dev/null
+++ b/application/controllers/api/frontend/v1/Lehrveranstaltung.php
@@ -0,0 +1,265 @@
+.
+ */
+
+if (!defined('BASEPATH'))
+ exit('No direct script access allowed');
+
+class Lehrveranstaltung extends FHCAPI_Controller
+{
+ private $_ci;
+ private $_uid;
+
+ public function __construct()
+ {
+ parent::__construct([
+ 'getByEmp' => ['admin:r', 'assistenz:r'],
+ 'getByStg' => ['admin:r', 'assistenz:r'],
+ 'loadByLV' => ['admin:r', 'assistenz:r'],
+ ]);
+
+ $this->_ci = &get_instance();
+ $this->_setAuthUID();
+
+ $this->_ci->load->model('education/Lehreinheit_model', 'LehreinheitModel');
+ $this->_ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
+ $this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
+
+ $this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
+
+ $this->loadPhrases(
+ array(
+ 'ui'
+ )
+ );
+ }
+
+ public function getByEmp($studiensemester_kurzbz = null, $mitarbeiter_uid = null, $stg_kz = null)
+ {
+
+ if (is_null($mitarbeiter_uid))
+ $this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
+
+ $lehrveranstaltungen = $this->_ci->LehreinheitModel->getLvsByEmployee($mitarbeiter_uid, $studiensemester_kurzbz, $stg_kz);
+ $lehrveranstaltungen_data = $this->getDataOrTerminateWithError($lehrveranstaltungen);
+
+ $tree = [];
+
+ foreach ($lehrveranstaltungen_data as $lehrveranstaltung)
+ {
+ $lehreinheiten = $this->_ci->LehreinheitModel->getByLvidStudiensemester($lehrveranstaltung->lehrveranstaltung_id, $studiensemester_kurzbz, $mitarbeiter_uid);
+ $lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
+
+ if (!isset($lehrveranstaltung->_children))
+ {
+ $lehrveranstaltung->_children = $lehreinheiten_data;
+ }
+ $tree[] = $lehrveranstaltung;
+ }
+
+ $this->terminateWithSuccess($tree);
+ }
+ public function getByStg($studiensemester_kurzbz = null, $studiengang_kz = null, $semester = null)
+ {
+ if (is_null($studiengang_kz) || !preg_match("/^-?[1-9][0-9]*$/", (string)$studiengang_kz))
+ $this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $verband = null;
+ if (!is_null($semester) && !is_numeric($semester))
+ {
+ $verband = $semester;
+ $semester = null;
+ }
+
+ $this->_ci->load->model('organisation/Studienplan_model', 'StudienplanModel');
+
+ $studiensemester_kurzbz = $this->getStudiensemesterKurzbz($studiensemester_kurzbz);
+ $studienplan_data = $this->_ci->StudienplanModel->getStudienplaeneBySemester($studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
+
+ $studienplan_ids = array();
+ $only_ids = array();
+ $placeholders = array();
+
+ if (hasData($studienplan_data))
+ {
+ foreach (getData($studienplan_data) as $studienplan) {
+ $placeholders[] = "(?, ?)";
+ $studienplan_ids[] = $studienplan->studienplan_id;
+ $studienplan_ids[] = $studienplan->semester;
+ $only_ids[] = $studienplan->studienplan_id;
+ }
+ }
+
+ $lehrveranstaltungen_data = $this->_ci->LehrveranstaltungModel->getLvsByStudiengang($studienplan_ids, $placeholders, $only_ids, $studiengang_kz, $studiensemester_kurzbz, $semester, $verband);
+ $lehrveranstaltungen_data = hasData($lehrveranstaltungen_data) ? getData($lehrveranstaltungen_data) : array();
+
+ $tree = [];
+ foreach ($lehrveranstaltungen_data as $row)
+ {
+ $rowData = $row;
+
+ $lehreinheiten_data = $this->_ci->LehreinheitModel->getByLvidStudiensemester($row->lehrveranstaltung_id, $studiensemester_kurzbz);
+
+ if (hasData($lehreinheiten_data))
+ {
+ $lehreinheiten = getData($lehreinheiten_data);
+ $rowData->_children = $lehreinheiten;
+ }
+
+ if (!isEmptyString($row->studienplan_lehrveranstaltung_id_parent))
+ {
+ $child = $this->_ci->StudienplanModel->loadStudienplanLehrveranstaltung($row->studienplan_lehrveranstaltung_id_parent);
+
+ if (hasData($child))
+ {
+ $child = getData($child)[0];
+ $searchId = $child->lehrveranstaltung_id;
+
+ foreach ($lehrveranstaltungen_data as &$searchParent)
+ {
+ if ($searchParent->lehrveranstaltung_id === $searchId)
+ {
+ if (!isset($searchParent->_children))
+ {
+ $searchParent->_children = [];
+ }
+
+ if (is_array($searchParent->_children))
+ {
+ $searchParent->_children[] = $row;
+ }
+ else
+ {
+ $searchParent->_children = [$searchParent->_children, $row];
+ }
+ break;
+ }
+ }
+
+ }
+ }
+ else
+ {
+ $tree[] = $rowData;
+ }
+ }
+
+ $counter = 0;
+ $this->assignUniqueIndex($tree, $counter);
+ $this->terminateWithSuccess($tree);
+ }
+
+
+ public function loadByLV($lehrveranstaltung_id = null)
+ {
+ if (is_null($lehrveranstaltung_id) || !ctype_digit((string)$lehrveranstaltung_id))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $this->_ci->LehrveranstaltungModel->addSelect('lehrveranstaltung_id, lehrform_kurzbz, lehre, bezeichnung as lvbezeichnung, sprache');
+ $lehrveranstaltung_result = $this->_ci->LehrveranstaltungModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung_id));
+ $lehrveranstaltung_result = $this->getDataOrTerminateWithError($lehrveranstaltung_result);
+ $lehrveranstaltung = $lehrveranstaltung_result[0];
+
+ $this->_ci->LehreinheitModel->addSelect('lehrveranstaltung_id_kompatibel');
+ $this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrveranstaltung_kompatibel', 'lehrveranstaltung_id');
+ $lehrfaecher = $this->_ci->LehreinheitModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung->lehrveranstaltung_id));
+
+ $lehrfaecher_array = [];
+ if (hasData($lehrfaecher))
+ $lehrfaecher_array = array_merge($lehrfaecher_array, array_column(getData($lehrfaecher), 'lehrveranstaltung_id_kompatibel'));
+
+ $lehrfaecher_array[] = $lehrveranstaltung->lehrveranstaltung_id;
+
+ $this->_ci->LehrveranstaltungModel->addDistinct('lehrfach_id');
+ $this->_ci->LehrveranstaltungModel->addSelect("tbl_lehrveranstaltung.lehrveranstaltung_id, CONCAT(tbl_lehrveranstaltung.bezeichnung || '(' || tbl_lehrveranstaltung.oe_kurzbz || ')') as lehrfach");
+ $this->_ci->LehrveranstaltungModel->db->where_in('tbl_lehrveranstaltung.lehrveranstaltung_id', $lehrfaecher_array);
+ $lehrfaecher_result = $this->_ci->LehrveranstaltungModel->load();
+
+ $lehrfaecher_array = hasData($lehrfaecher_result) ? getData($lehrfaecher_result) : array();
+
+ $lehrveranstaltung->lehrfaecher = $lehrfaecher_array;
+ $this->terminateWithSuccess($lehrveranstaltung);
+ }
+
+ /*
+ * (david) ggf. im naechsten release
+ * public function loadByOrganization($oe_kurzbz)
+ {
+ $studiensemester_kurzbz = $this->variablelib->getVar('semester_aktuell');
+
+ $lehrveranstaltungen = $this->LehrveranstaltungModel->getLvsByOrganization($oe_kurzbz);
+ $lehrveranstaltungen_data = $this->getDataOrTerminateWithError($lehrveranstaltungen);
+ $tree = [];
+
+ foreach ($lehrveranstaltungen_data as $lehrveranstaltung)
+ {
+ $lehreinheiten = $this->LehreinheitModel->getByLvidStudiensemester($lehrveranstaltung->lehrveranstaltung_id, $studiensemester_kurzbz);
+ $lehreinheiten_data = $this->getDataOrTerminateWithError($lehreinheiten);
+
+ if (!isset($lehrveranstaltung->_children))
+ {
+
+ $lehrveranstaltung->_children = $lehreinheiten_data;
+ }
+ $tree[] = $lehrveranstaltung;
+ }
+ $this->terminateWithSuccess($tree);
+ }*/
+
+ /*public function loadByFachbereich($fachbereich, $mitarbeiter_uid = null)
+ {
+ $studiensemester_kurzbz = $this->variablelib->getVar('semester_aktuell');
+
+ $this->LehreinheitModel->getLvsByFachbereich($fachbereich, $studiensemester_kurzbz, $mitarbeiter_uid);
+ }*/
+ private function _setAuthUID()
+ {
+ $this->_uid = getAuthUID();
+
+ if (!$this->_uid)
+ show_error('User authentification failed');
+ }
+
+ private function assignUniqueIndex(&$nodes, &$counter)
+ {
+ foreach ($nodes as &$node)
+ {
+ $node->uniqueindex = $counter++;
+ if (!empty($node->_children) && is_array($node->_children))
+ {
+ $this->assignUniqueIndex($node->_children, $counter);
+ }
+ }
+ }
+
+ private function getStudiensemesterKurzbz($studiensemester_kurzbz = null)
+ {
+ if (!is_null($studiensemester_kurzbz))
+ {
+ $studiensemester_result = $this->_ci->StudiensemesterModel->load($studiensemester_kurzbz);
+
+ if (isError($studiensemester_result) || !hasData($studiensemester_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ return getData($studiensemester_result)[0]->studiensemester_kurzbz;
+ }
+
+ $this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+ }
+}
diff --git a/application/controllers/api/frontend/v1/ProfilUpdate.php b/application/controllers/api/frontend/v1/ProfilUpdate.php
index bbfed651c..f97546288 100644
--- a/application/controllers/api/frontend/v1/ProfilUpdate.php
+++ b/application/controllers/api/frontend/v1/ProfilUpdate.php
@@ -637,7 +637,7 @@ class ProfilUpdate extends FHCAPI_Controller
//? Send email to the Studiengangsassistentinnen
$this->StudentModel->addSelect(["public.tbl_studiengang.email"]);
$this->StudentModel->addJoin("public.tbl_benutzer", "public.tbl_benutzer.uid = public.tbl_student.student_uid");
- $this->StudentModel->addJoin("public.tbl_prestudent", "public.tbl_benutzer.person_id = public.tbl_prestudent.person_id");
+ $this->StudentModel->addJoin("public.tbl_prestudent", "public.tbl_benutzer.person_id = public.tbl_prestudent.person_id and public.tbl_student.studiengang_kz = public.tbl_prestudent.studiengang_kz");
$this->StudentModel->addJoin("public.tbl_prestudentstatus", "public.tbl_prestudentstatus.prestudent_id = public.tbl_prestudent.prestudent_id");
$this->StudentModel->addJoin("public.tbl_studiengang", "public.tbl_studiengang.studiengang_kz = public.tbl_prestudent.studiengang_kz");
$this->StudentModel->addGroupBy(["public.tbl_studiengang.email"]);
@@ -706,7 +706,13 @@ class ProfilUpdate extends FHCAPI_Controller
private function setStatusOnUpdateRequest($id, $status, $status_message)
{
- return $this->ProfilUpdateModel->update([$id], ["status" => $status, "status_timestamp" => "NOW()", "status_message" => $status_message]);
+ return $this->ProfilUpdateModel->update([$id], [
+ "status" => $status,
+ "status_timestamp" => "NOW()",
+ "status_message" => $status_message,
+ "updateamum" => "NOW()",
+ "updatevon" => getAuthUID()
+ ]);
}
private function updateRequestedChange($id, $requested_change)
@@ -716,13 +722,12 @@ class ProfilUpdate extends FHCAPI_Controller
private function deleteOldVersionFile($dms_id)
{
+ if (!isset($dms_id)) {
+ return true;
+ }
+
// starting the transaction
$this->db->trans_start();
-
-
- if (!isset($dms_id)) {
- return;
- }
//? delete the file from the profilUpdate first
$profilUpdateFileDelete = $this->ProfilUpdateModel->removeFileFromProfilUpdate($dms_id);
@@ -777,13 +782,8 @@ class ProfilUpdate extends FHCAPI_Controller
$res = $this->StudentModel->execReadOnlyQuery($query, [$student_uid]);
$res = $this->getDataOrTerminateWithError($res, $this->p->t('profilUpdate', 'profilUpdate_loadingOE_error'));
- $res = array_map(
- function ($item) {
- return $item->oe_kurzbz;
- },
- $res
- );
- return $res;
+ $oe = ($res[0])->oe_kurzbz;
+ return $oe;
}
private function handleAdresse($requested_change, $personID)
@@ -813,7 +813,7 @@ class ProfilUpdate extends FHCAPI_Controller
$insert_adresse_id = $insertID;
$insert_adresse_id = $this->getDataOrTerminateWithError($insert_adresse_id, $this->p->t('profilUpdate', 'profilUpdate_insertAdresse_error'));
if ($insert_adresse_id) {
- $this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $insert_adresse_id);
+ $this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $insert_adresse_id, $personID);
}
}
//! DELETE
@@ -825,12 +825,33 @@ class ProfilUpdate extends FHCAPI_Controller
}
//! UPDATE
else {
- $requested_change['updateamum'] = "NOW()";
- $requested_change['updatevon'] = getAuthUID();
- $update_adresse_id = $this->AdresseModel->update($adresse_id, $requested_change);
- $update_adresse_id = $this->getDataOrTerminateWithError($update_adresse_id, $this->p->t('profilUpdate', 'profilUpdate_updateAdresse_error'));
- $this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $update_adresse_id);
+ $curadresse_res = $this->AdresseModel->load($adresse_id);
+ $curadresse = ($this->getDataOrTerminateWithError($curadresse_res))[0];
+ if($curadresse->heimatadresse)
+ {
+ $tmpadresse = array_merge((array) $curadresse, $requested_change);
+ unset($tmpadresse["adresse_id"]);
+ $tmpadresse['insertamum'] = "NOW()";
+ $tmpadresse['insertvon'] = getAuthUID();
+ $tmpadresse['person_id'] = $personID;
+ unset($tmpadresse["heimatadresse"]);
+ unset($tmpadresse["updateamum"]);
+ unset($tmpadresse["updatevon"]);
+
+ $tmpadresse_res = $this->AdresseModel->insert($tmpadresse);
+ $tmpadresse_id = $this->getDataOrTerminateWithError($tmpadresse_res, $this->p->t('profilUpdate', 'profilUpdate_insertAdresse_error'));
+ $this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $tmpadresse_id, $personID);
+ }
+ else
+ {
+ $requested_change['updateamum'] = "NOW()";
+ $requested_change['updatevon'] = getAuthUID();
+
+ $update_adresse_id = $this->AdresseModel->update($adresse_id, $requested_change);
+ $update_adresse_id = $this->getDataOrTerminateWithError($update_adresse_id, $this->p->t('profilUpdate', 'profilUpdate_updateAdresse_error'));
+ $this->handleDupplicateZustellAdressen($requested_change['zustelladresse'], $update_adresse_id, $personID);
+ }
}
return $insertID ?? null;
}
@@ -852,7 +873,7 @@ class ProfilUpdate extends FHCAPI_Controller
$insert_kontakt_id = $insertID;
$insert_kontakt_id = $this->getDataOrTerminateWithError($insert_kontakt_id, $this->p->t('profilUpdate', 'profilUpdate_insertKontakt_error'));
if ($insert_kontakt_id) {
- $this->handleDupplicateZustellKontakte($requested_change['zustellung'], $insert_kontakt_id);
+ $this->handleDupplicateZustellKontakte($requested_change['zustellung'], $insert_kontakt_id, $requested_change['kontakttyp'], $personID);
}
}
//! DELETE
@@ -869,18 +890,18 @@ class ProfilUpdate extends FHCAPI_Controller
$update_kontakt_id = $this->KontaktModel->update($kontakt_id, $requested_change);
$update_kontakt_id = $this->getDataOrTerminateWithError($update_kontakt_id, $this->p->t('profilUpdate', 'profilUpdate_updateKontakt_error'));
if ($update_kontakt_id) {
- $this->handleDupplicateZustellKontakte($requested_change['zustellung'], $update_kontakt_id);
+ $this->handleDupplicateZustellKontakte($requested_change['zustellung'], $update_kontakt_id, $requested_change['kontakttyp'], $personID);
}
}
return isset($insertID) ? $insertID : null;
}
- private function handleDupplicateZustellAdressen($zustellung, $adresse_id)
+ private function handleDupplicateZustellAdressen($zustellung, $adresse_id, $person_id)
{
if ($zustellung) {
$this->PersonModel->addSelect("public.tbl_adresse.adresse_id");
$this->PersonModel->addJoin("public.tbl_adresse", "public.tbl_adresse.person_id = public.tbl_person.person_id");
- $zustellAdressenArray = $this->PersonModel->loadWhere(["public.tbl_person.person_id" => $this->pid, "zustelladresse" => TRUE]);
+ $zustellAdressenArray = $this->PersonModel->loadWhere(["public.tbl_person.person_id" => $person_id, "zustelladresse" => TRUE]);
if (isError($zustellAdressenArray)) {
$this->terminateWithError($this->p->t('profilUpdate', 'profilUpdate_loadingZustellAdressen_error'));
}
@@ -893,6 +914,8 @@ class ProfilUpdate extends FHCAPI_Controller
return $adresse->adresse_id != $adresse_id;
});
+ $this->addMeta('bhzustelladressen', $zustellAdressenArray);
+
// remove the zustelladresse from all other zustelladressen
foreach ($zustellAdressenArray as $adresse) {
$this->AdresseModel->update($adresse->adresse_id, ["zustelladresse" => FALSE]);
@@ -902,12 +925,16 @@ class ProfilUpdate extends FHCAPI_Controller
}
}
- private function handleDupplicateZustellKontakte($zustellung, $kontakt_id)
+ private function handleDupplicateZustellKontakte($zustellung, $kontakt_id, $kontakttyp, $person_id)
{
if ($zustellung) {
$this->PersonModel->addSelect("public.tbl_kontakt.kontakt_id");
$this->PersonModel->addJoin("public.tbl_kontakt", "public.tbl_kontakt.person_id = public.tbl_person.person_id");
- $zustellKontakteArray = $this->PersonModel->loadWhere(["public.tbl_person.person_id" => $this->pid, "zustellung" => TRUE]);
+ $zustellKontakteArray = $this->PersonModel->loadWhere([
+ "public.tbl_person.person_id" => $person_id,
+ "zustellung" => TRUE,
+ "kontakttyp" => $kontakttyp
+ ]);
if (!isSuccess($zustellKontakteArray)) {
return error($this->p->t('profilUpdate', 'profilUpdate_loadingZustellkontakte_error'));
}
diff --git a/application/controllers/api/frontend/v1/lv/DirektGruppe.php b/application/controllers/api/frontend/v1/lv/DirektGruppe.php
new file mode 100644
index 000000000..2dcf7d3cb
--- /dev/null
+++ b/application/controllers/api/frontend/v1/lv/DirektGruppe.php
@@ -0,0 +1,110 @@
+.
+ */
+
+if (!defined('BASEPATH'))
+ exit('No direct script access allowed');
+
+class DirektGruppe extends FHCAPI_Controller
+{
+ private $_ci;
+ public function __construct()
+ {
+ parent::__construct([
+ 'add' => ['admin:rw', 'assistenz:rw'],
+ 'delete' => ['admin:rw', 'assistenz:rw'],
+ 'getByLehreinheit' => ['admin:r', 'assistenz:r'],
+ ]);
+
+ $this->_ci = &get_instance();
+
+ $this->loadPhrases([
+ 'ui'
+ ]);
+ $this->_ci->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
+ $this->_ci->load->model('education/lehreinheit_model', 'LehreinheitModel');
+ $this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
+ }
+
+ public function add()
+ {
+ $uid = $this->input->post('uid');
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+
+ $this->checkPermission($lehreinheit_id, $uid);
+
+ $result = $this->_ci->LehreinheitgruppeModel->direktUserAdd($uid, $lehreinheit_id);
+
+ if (isError($result))
+ $this->terminateWithError(getError($result));
+
+ $this->terminateWithSuccess($result);
+ }
+
+ public function delete()
+ {
+ $uid = $this->input->post('uid');
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+
+ $this->checkPermission($lehreinheit_id, $uid);
+
+ $result = $this->_ci->LehreinheitgruppeModel->direktUserDelete($uid, $lehreinheit_id);
+
+ if (isError($result))
+ $this->terminateWithError(getError($result));
+
+ $this->terminateWithSuccess($result);
+ }
+
+ public function getByLehreinheit($lehreinheit_id = null)
+ {
+ $this->checkPermission($lehreinheit_id);
+ $gruppen = $this->_ci->LehreinheitgruppeModel->getDirectGroup($lehreinheit_id);
+ $this->terminateWithSuccess(hasData($gruppen) ? getData($gruppen) : array());
+ }
+
+ private function checkPermission($lehreinheit_id, $uid = false)
+ {
+ if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $lehreinheit_result = $this->_ci->LehreinheitModel->load($lehreinheit_id);
+
+ if (!hasData($lehreinheit_result) || isError($lehreinheit_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ if ($uid)
+ {
+ $benuzuer_result = $this->_ci->BenutzerModel->load(array($uid));
+ if (!hasData($benuzuer_result) || isError($benuzuer_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+ }
+
+ $result = $this->_ci->LehreinheitModel->getOes($lehreinheit_id);
+
+ if (isError($result))
+ $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
+
+ $oe_array = [];
+ if (hasData($result))
+ $oe_array = getData($result);
+
+ if (!$this->_ci->permissionlib->isBerechtigtMultipleOe('admin', $oe_array, 'suid') &&
+ !$this->_ci->permissionlib->isBerechtigtMultipleOe('assistenz', $oe_array, 'suid'))
+ $this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
+ }
+}
diff --git a/application/controllers/api/frontend/v1/lv/Favorites.php b/application/controllers/api/frontend/v1/lv/Favorites.php
new file mode 100644
index 000000000..080a4ec6e
--- /dev/null
+++ b/application/controllers/api/frontend/v1/lv/Favorites.php
@@ -0,0 +1,47 @@
+ self::PERM_LOGGED,
+ 'set' => self::PERM_LOGGED
+ ]);
+
+ // Load models
+ $this->load->model('system/Variable_model', 'VariableModel');
+ }
+
+ public function index()
+ {
+ $result = $this->VariableModel->getVariables(getAuthUID(), ['lv_favorites']);
+
+ $data = $this->getDataOrTerminateWithError($result);
+
+ if (!$data)
+ $this->terminateWithSuccess(null);
+ else
+ $this->terminateWithSuccess(isset($data['lv_favorites']) ? $data['lv_favorites'] : null);
+ }
+
+ public function set()
+ {
+ $this->load->library('form_validation');
+
+ $this->form_validation->set_rules('favorites', 'Favorites', 'required');
+
+ if (!$this->form_validation->run())
+ $this->terminateWithValidationErrors($this->form_validation->error_array());
+
+ $favorites = $this->input->post('favorites');
+
+ $result = $this->VariableModel->setVariable(getAuthUID(), 'lv_favorites', $favorites);
+
+ $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess(true);
+ }
+}
diff --git a/application/controllers/api/frontend/v1/lv/Gruppe.php b/application/controllers/api/frontend/v1/lv/Gruppe.php
new file mode 100644
index 000000000..83a4fb696
--- /dev/null
+++ b/application/controllers/api/frontend/v1/lv/Gruppe.php
@@ -0,0 +1,195 @@
+ ['admin:rw', 'assistenz:rw'],
+ 'delete' => ['admin:rw', 'assistenz:rw'],
+ 'deleteFromLVPlan' => ['admin:rw', 'assistenz:rw'],
+ 'getBenutzer' => ['admin:r', 'assistenz:r'],
+ 'getAll' => ['admin:r', 'assistenz:r'],
+ 'getByLehreinheit' => ['admin:r', 'assistenz:r'],
+ ]);
+
+ $this->_ci = &get_instance();
+ $this->_setAuthUID();
+ $this->_ci->load->library('PhrasesLib');
+ $this->loadPhrases(
+ array(
+ 'ui'
+ )
+ );
+
+ $this->_ci->load->model('organisation/Gruppe_model', 'GruppeModel');
+ $this->_ci->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
+ $this->_ci->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
+ $this->_ci->load->model('person/Person_model', 'PersonModel');
+ $this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
+ }
+
+ public function delete()
+ {
+ $lehreinheitgruppe_id = $this->input->post('lehreinheitgruppe_id');
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+
+ if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id) || is_null($lehreinheitgruppe_id) || !ctype_digit((string)$lehreinheitgruppe_id))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $lehreinheitgruppe_result = $this->_ci->LehreinheitgruppeModel->loadWhere(array('lehreinheitgruppe_id' => $lehreinheitgruppe_id));
+ if (!hasData($lehreinheitgruppe_result) || isError($lehreinheitgruppe_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $this->checkPermission($lehreinheit_id);
+
+ $result = $this->_ci->LehreinheitgruppeModel->deleteGroup($lehreinheit_id, $lehreinheitgruppe_id);
+
+ if (isError($result))
+ $this->terminateWithError(getError($result));
+
+ $this->terminateWithSuccess($result);
+ }
+
+ public function add()
+ {
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+ $gid = $this->input->post('gid');
+ $lehrverband = $this->input->post('lehrverband');
+
+ if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id) || is_null($gid) || !ctype_digit((string)$gid) || is_null($lehrverband))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $this->checkPermission($lehreinheit_id);
+
+ $result = $this->_ci->LehreinheitgruppeModel->addGroup($lehreinheit_id, $gid, !($lehrverband === 'false'));
+
+ if (isError($result))
+ $this->terminateWithError(getError($result));
+
+ $this->terminateWithSuccess($result);
+ }
+
+ public function getByLehreinheit($lehreinheit_id = null)
+ {
+ if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $this->checkPermission($lehreinheit_id);
+
+ $gruppen = $this->_ci->LehreinheitgruppeModel->getByLehreinheit($lehreinheit_id);
+ $this->terminateWithSuccess(hasData($gruppen) ? getData($gruppen) : array());
+ }
+
+ public function deleteFromLVPlan()
+ {
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+ $lehreinheitgruppe_id = $this->input->post('lehreinheitgruppe_id');
+
+ if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id) || is_null($lehreinheitgruppe_id) || !ctype_digit((string)$lehreinheitgruppe_id))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $lehreinheitgruppe_result = $this->_ci->LehreinheitgruppeModel->loadWhere(array('lehreinheitgruppe_id' => $lehreinheitgruppe_id));
+ if (!hasData($lehreinheitgruppe_result) || isError($lehreinheitgruppe_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $this->checkPermission($lehreinheit_id);
+
+ $result = $this->_ci->StundenplandevModel->deleteGroupPlanning($lehreinheit_id, $lehreinheitgruppe_id);
+
+ if (isError($result))
+ $this->terminateWithError(getError($result));
+
+ $this->terminateWithSuccess($result);
+ }
+
+
+ public function getAll()
+ {
+ $this->_ci->GruppeModel->addSelect('gruppe_kurzbz,
+ studiengang_kz,
+ semester,
+ bezeichnung,
+ gid,
+ \'false\' as lehrverband');
+ $gruppen_result = $this->_ci->GruppeModel->loadWhere(array('sichtbar' => true, 'aktiv' => true, 'lehre' => true, 'direktinskription' => false, 'semester IS NOT NULL' => null));
+
+ $gruppen_array = array();
+
+ if (isError($gruppen_result))
+ $this->terminateWithError(getError($gruppen_result), self::ERROR_TYPE_GENERAL);
+
+ if (hasData($gruppen_result))
+ $gruppen_array = getData($gruppen_result);
+
+ $this->_ci->LehrverbandModel->addSelect('CONCAT(UPPER(CONCAT(typ, kurzbz)), \'\', semester, verband, COALESCE(gruppe,\'\')) as gruppe_kurzbz,
+ studiengang_kz,
+ semester,
+ tbl_lehrverband.bezeichnung,
+ gid,
+ \'true\' as lehrverband');
+ $this->_ci->LehrverbandModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
+ $this->_ci->LehrverbandModel->addOrder('verband');
+ $this->_ci->LehrverbandModel->addOrder('gruppe');
+ $lehrverband_result = $this->_ci->LehrverbandModel->loadWhere(array('tbl_lehrverband.aktiv' => true));
+
+ $lehrverband_array = array();
+
+ if (isError($lehrverband_result))
+ $this->terminateWithError(getError($lehrverband_result), self::ERROR_TYPE_GENERAL);
+
+ if (hasData($lehrverband_result))
+ $lehrverband_array = getData($lehrverband_result);
+
+ $all_gruppen = array_merge($gruppen_array, $lehrverband_array);
+
+ $this->terminateWithSuccess($all_gruppen);
+ }
+
+ public function getBenutzer()
+ {
+ $this->_ci->PersonModel->addSelect('vorname, nachname, uid, semester, UPPER(CONCAT(tbl_studiengang.typ, tbl_studiengang.kurzbz)) as studiengang');
+ $this->_ci->PersonModel->addJoin('public.tbl_benutzer', 'person_id');
+ $this->_ci->PersonModel->addJoin('public.tbl_mitarbeiter', 'uid = mitarbeiter_uid', 'LEFT');
+ $this->_ci->PersonModel->addJoin('public.tbl_student', 'uid = student_uid', 'LEFT');
+ $this->_ci->PersonModel->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT');
+
+ $personen = $this->_ci->PersonModel->loadWhere(array('tbl_benutzer.aktiv' => true));
+ $this->terminateWithSuccess(hasData($personen) ? getData($personen) : array());
+ }
+
+ private function _setAuthUID()
+ {
+ $this->_uid = getAuthUID();
+
+ if (!$this->_uid)
+ show_error('User authentification failed');
+ }
+
+ private function checkPermission($lehreinheit_id)
+ {
+ $lehreinheit_result = $this->_ci->LehreinheitModel->load($lehreinheit_id);
+
+ if (!hasData($lehreinheit_result) || isError($lehreinheit_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $result = $this->_ci->LehreinheitModel->getOes($lehreinheit_id);
+
+ if (isError($result))
+ $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
+
+ $oe_array = [];
+ if (hasData($result))
+ $oe_array = getData($result);
+
+ if (!$this->_ci->permissionlib->isBerechtigtMultipleOe('admin', $oe_array, 'suid') &&
+ !$this->_ci->permissionlib->isBerechtigtMultipleOe('assistenz', $oe_array, 'suid') &&
+ !$this->_ci->permissionlib->isBerechtigtMultipleOe('lv-plan', $oe_array, 'suid'))
+ $this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
+ }
+
+}
diff --git a/application/controllers/api/frontend/v1/lv/Lehreinheit.php b/application/controllers/api/frontend/v1/lv/Lehreinheit.php
new file mode 100644
index 000000000..958007901
--- /dev/null
+++ b/application/controllers/api/frontend/v1/lv/Lehreinheit.php
@@ -0,0 +1,446 @@
+ ['admin:rw', 'assistenz:rw'],
+ 'copy' => ['admin:rw', 'assistenz:rw'],
+ 'delete' => ['admin:rw', 'assistenz:rw'],
+ 'update' => ['admin:rw', 'assistenz:rw'],
+
+ 'get' => ['admin:r', 'assistenz:r'],
+ 'getStudiensemester' => ['admin:r', 'assistenz:r'],
+ 'getLehrfach' => ['admin:r', 'assistenz:r'],
+ 'getSprache' => ['admin:r', 'assistenz:r'],
+ 'getRaumtyp' => ['admin:r', 'assistenz:r'],
+ 'getLehrform' => ['admin:r', 'assistenz:r']
+ ]);
+
+ $this->_ci = &get_instance();
+ $this->_setAuthUID();
+ $this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
+ $this->_ci->load->library('PhrasesLib');
+ $this->loadPhrases(
+ array(
+ 'global',
+ 'ui'
+ )
+ );
+
+ $this->_ci->load->model('education/Lehreinheit_model', 'LehreinheitModel');
+ $this->_ci->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
+ $this->_ci->load->model('education/Lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel');
+ }
+
+ public function get($lehreinheit_id)
+ {
+ $lehreinheit = $this->checkLehreinheit($lehreinheit_id);
+ $lehreinheit->lehrfaecher = $this->getLehrfaecher($lehreinheit);
+ $this->terminateWithSuccess($lehreinheit);
+ }
+
+ private function getLehrfaecher($lehreinheit)
+ {
+ $lehrfacher_array = array($lehreinheit->lehrfach_id);
+ $this->_ci->LehreinheitModel->addSelect('lehrveranstaltung_id_kompatibel');
+ $this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrveranstaltung_kompatibel', 'lehrveranstaltung_id');
+ $lehrfaecher = $this->_ci->LehreinheitModel->loadWhere(array('lehrveranstaltung_id' => $lehreinheit->lehrveranstaltung_id));
+
+
+ if (hasData($lehrfaecher))
+ $lehrfaecher_array = array_merge($lehrfacher_array, array_column(getData($lehrfaecher), 'lehrveranstaltung_id_kompatibel'));
+
+ $lehrfaecher_array[] = $lehreinheit->lehrveranstaltung_id;
+
+ $this->_ci->LehrveranstaltungModel->addDistinct('lehrfach_id');
+ $this->_ci->LehrveranstaltungModel->addSelect("tbl_lehrveranstaltung.lehrveranstaltung_id, CONCAT(tbl_lehrveranstaltung.bezeichnung || '(' || tbl_lehrveranstaltung.oe_kurzbz || ')') as lehrfach");
+ $this->_ci->LehrveranstaltungModel->db->where_in('tbl_lehrveranstaltung.lehrveranstaltung_id', $lehrfaecher_array);
+ $lehrfaecher_result = $this->_ci->LehrveranstaltungModel->load();
+
+ return hasData($lehrfaecher_result) ? getData($lehrfaecher_result) : array();
+ }
+
+ public function add()
+ {
+ $lehrveranstaltung_id = $this->input->post('lehrveranstaltung_id');
+
+ if (is_null($lehrveranstaltung_id) || !ctype_digit((string)$lehrveranstaltung_id))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $lehrveranstaltung_result = $this->_ci->LehrveranstaltungModel->loadWhere(array('lehrveranstaltung_id' => $lehrveranstaltung_id));
+
+ if (!hasData($lehrveranstaltung_result) || isError($lehrveranstaltung_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $lehrveranstaltung = getData($lehrveranstaltung_result)[0];
+
+ $oe_result = $this->_ci->LehrveranstaltungModel->getAllOe($lehrveranstaltung->lehrveranstaltung_id);
+ $oe_array = hasData($oe_result) ? array_column(getData($oe_result), 'oe_kurzbz') : array();
+
+ if (!$this->_ci->permissionlib->isBerechtigtMultipleOe('admin', $oe_array, 'suid') &&
+ !$this->_ci->permissionlib->isBerechtigtMultipleOe('assistenz', $oe_array, 'suid') &&
+ !$this->_ci->permissionlib->isBerechtigtMultipleOe('lv-plan', $oe_array, 'suid'))
+ $this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
+
+ $this->_ci->load->library('form_validation');
+
+ $updatableFields = array(
+ 'lehrveranstaltung_id',
+ 'studiensemester_kurzbz',
+ 'lehrfach_id',
+ 'lehrform_kurzbz',
+ 'stundenblockung',
+ 'wochenrythmus',
+ 'gewicht',
+ 'start_kw',
+ 'raumtyp',
+ 'raumtypalternativ',
+ 'sprache',
+ 'lehre',
+ 'anmerkung',
+ 'lvnr',
+ 'unr',
+ );
+
+ foreach ($updatableFields as $field)
+ {
+ switch ($field) {
+ case 'lehrveranstaltung_id':
+ $this->form_validation->set_rules($field, 'Lehrveranstaltung ID', 'required|integer');
+ break;
+ case 'studiensemester_kurzbz':
+ $this->form_validation->set_rules($field, 'Studiensemester', 'required|max_length[16]');
+ break;
+ case 'lehrfach_id':
+ $this->form_validation->set_rules($field, 'Lehrfach ID', 'required|integer');
+ break;
+ case 'lehrform_kurzbz':
+ $this->form_validation->set_rules($field, 'Lehrform', 'required|max_length[8]');
+ break;
+ case 'stundenblockung':
+ $this->form_validation->set_rules($field, 'Stundenblockung', 'required|integer|greater_than_equal_to[0]');
+ break;
+ case 'wochenrythmus':
+ $this->form_validation->set_rules($field, 'Wochenrhytmus', 'required|integer|greater_than_equal_to[0]');
+ break;
+ case 'start_kw':
+ $this->form_validation->set_rules($field, 'Start KW', 'integer|greater_than[0]|less_than_equal_to[53]');
+ break;
+ case 'gewicht':
+ $this->form_validation->set_rules($field, 'Gewicht', 'numeric');
+ break;
+ case 'raumtyp':
+ $this->form_validation->set_rules($field, 'Raumtyp', 'required|max_length[16]');
+ break;
+ case 'raumtypalternativ':
+ $this->form_validation->set_rules($field, 'Raumtyp Alternativ', 'required|max_length[16]');
+ break;
+ case 'sprache':
+ $this->form_validation->set_rules($field, 'Sprache', 'required|max_length[16]');
+ break;
+ case 'lvnr':
+ $this->form_validation->set_rules($field, 'LVNR', 'integer');
+ break;
+ case 'unr':
+ $this->form_validation->set_rules($field, 'UNR', 'integer');
+ break;
+ case 'lehre':
+ $this->form_validation->set_rules($field, 'Lehre', 'trim');
+ break;
+ case 'anmerkung':
+ $this->form_validation->set_rules($field, 'Anmerkung', 'trim');
+ break;
+ }
+ }
+
+ if ($this->form_validation->run() === false)
+ {
+ $this->terminateWithValidationErrors($this->form_validation->error_array());
+ }
+
+ $updateData = array();
+ foreach ($updatableFields as $field)
+ {
+ $value = $this->input->post($field);
+
+ if ($value !== null)
+ {
+ $updateData[$field] = $value;
+ }
+ }
+
+ $updateData['insertvon'] = $this->_uid;
+ $updateData['insertamum'] = date('Y-m-d H:i:s');
+
+ $result = $this->_ci->LehreinheitModel->insert(
+ $updateData
+ );
+
+ if (!isset($updateData['unr']))
+ {
+ $unr = getData($result);
+ $this->_ci->LehreinheitModel->update($unr, array('unr' => $unr));
+ }
+
+ $this->terminateWithSuccess($result);
+ }
+
+ public function copy()
+ {
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+ $art = $this->input->post('art');
+
+ $lehreinheit_old = $this->checkLehreinheit($lehreinheit_id);
+ $this->checkPermission($lehreinheit_old->lehreinheit_id);
+
+ $lehreinheit_new = $lehreinheit_old;
+
+ $lehreinheit_new->unr = null;
+ unset($lehreinheit_new->lehreinheit_id);
+ $lehreinheit_new->updateamum = date('Y-m-d H:i:s');
+ $lehreinheit_new->updatevon = $this->_uid;
+ $lehreinheit_new->insertamum = date('Y-m-d H:i:s');
+ $lehreinheit_new->insertvon = $this->_uid;
+
+ $insert_result = $this->_ci->LehreinheitModel->insert($lehreinheit_new);
+
+ if (isError($insert_result))
+ $this->terminateWithError(getError($insert_result), self::ERROR_TYPE_GENERAL);
+
+ $lehreinheit_id_new = getData($insert_result);
+
+ $this->_ci->LehreinheitModel->update(array('lehreinheit_id' => $lehreinheit_id_new), array('unr' => $lehreinheit_id_new));
+ if (in_array($art, array('gruppen', 'alle')))
+ {
+ $gruppen_result = $this->_ci->LehreinheitgruppeModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
+
+ if (isError($gruppen_result))
+ $this->terminateWithError(getError($gruppen_result), self::ERROR_TYPE_GENERAL);
+
+ if (hasData($gruppen_result))
+ {
+ $gruppen = getData($gruppen_result);
+
+ foreach ($gruppen as $gruppe)
+ {
+ $gruppe_new = $gruppe;
+ unset($gruppe_new->lehreinheitgruppe_id);
+ $gruppe_new->lehreinheit_id = $lehreinheit_id_new;
+ $gruppe_new->insertamum = date('Y-m-d H:i:s');
+ $gruppe_new->insertvon = $this->_uid;
+ $gruppe_new->updateamum = date('Y-m-d H:i:s');
+ $gruppe_new->updatevon = $this->_uid;
+
+ $gruppe_new_result = $this->_ci->LehreinheitgruppeModel->insert($gruppe_new);
+
+ if (isError($gruppe_new_result))
+ $this->terminateWithError(getError($gruppe_new_result), self::ERROR_TYPE_GENERAL);
+ }
+ }
+ }
+
+ if (in_array($art, array('lektoren', 'alle')))
+ {
+ $lektoren_result = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
+
+ if (isError($lektoren_result))
+ $this->terminateWithError(getError($lektoren_result), self::ERROR_TYPE_GENERAL);
+
+ if (hasData($lektoren_result))
+ {
+ $lektoren = getData($lektoren_result);
+
+ foreach ($lektoren as $lektor)
+ {
+
+ $lektor_new = $lektor;
+ $lektor_new->lehreinheit_id = $lehreinheit_id_new;
+ $lektor_new->insertamum = date('Y-m-d H:i:s');
+ $lektor_new->insertvon = $this->_uid;
+ $lektor_new->updateamum = date('Y-m-d H:i:s');
+ $lektor_new->updatevon = $this->_uid;
+ unset($lektor_new->vertrag_id);
+
+ $lektor_new_result = $this->_ci->LehreinheitmitarbeiterModel->insert((array)$lektor_new);
+
+ if (isError($lektor_new_result))
+ $this->terminateWithError(getError($lektor_new_result), self::ERROR_TYPE_GENERAL);
+ }
+ }
+ }
+
+ $this->terminateWithSuccess("Erfolgeich gespeichert");
+ }
+
+ public function delete()
+ {
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+ $lehreinheit = $this->checkLehreinheit($lehreinheit_id);
+ $this->checkPermission($lehreinheit->lehreinheit_id);
+
+ $result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
+
+ if (isError($result))
+ $this->terminateWithValidationErrors(getError($result));
+
+ $this->terminateWithSuccess('Erfolgreich geloescht');
+ }
+
+ public function update()
+ {
+ $lehreinheit = $this->checkLehreinheit($this->input->post('lehreinheit_id'));
+
+ $this->checkPermission($lehreinheit->lehreinheit_id);
+
+ $this->_ci->load->library('form_validation');
+
+ $formData = $this->input->post('formData');
+
+ $updatableFields = array(
+ 'lehrveranstaltung_id',
+ 'studiensemester_kurzbz',
+ 'lehrfach_id',
+ 'lehrform_kurzbz',
+ 'stundenblockung',
+ 'wochenrythmus',
+ 'gewicht',
+ 'start_kw',
+ 'raumtyp',
+ 'raumtypalternativ',
+ 'sprache',
+ 'lehre',
+ 'anmerkung',
+ 'lvnr',
+ 'unr',
+ );
+
+ $this->form_validation->set_data($formData);
+
+ foreach ($updatableFields as $field)
+ {
+ if (array_key_exists($field, $formData))
+ {
+ switch ($field)
+ {
+ case 'lehrveranstaltung_id':
+ $this->form_validation->set_rules($field, 'Lehrveranstaltung ID', 'required|integer');
+ break;
+ case 'studiensemester_kurzbz':
+ $this->form_validation->set_rules($field, 'Studiensemester', 'required|max_length[16]');
+ break;
+ case 'lehrfach_id':
+ $this->form_validation->set_rules($field, 'Lehrfach ID', 'required|integer');
+ break;
+ case 'lehrform_kurzbz':
+ $this->form_validation->set_rules($field, 'Lehrform', 'required|max_length[8]');
+ break;
+ case 'stundenblockung':
+ $this->form_validation->set_rules($field, 'Stundenblockung', 'required|integer|greater_than_equal_to[0]');
+ break;
+ case 'wochenrythmus':
+ $this->form_validation->set_rules($field, 'Wochenrhytmus', 'required|integer|greater_than_equal_to[0]');
+ break;
+ case 'start_kw':
+ $this->form_validation->set_rules($field, 'Start KW', 'integer|greater_than[0]|less_than_equal_to[53]');
+ break;
+ case 'gewicht':
+ $this->form_validation->set_rules($field, 'Gewicht', 'numeric|greater_than_equal_to[0]');
+ break;
+ case 'raumtyp':
+ $this->form_validation->set_rules($field, 'Raumtyp', 'required|max_length[16]');
+ break;
+ case 'raumtypalternativ':
+ $this->form_validation->set_rules($field, 'Raumtyp Alternativ', 'required|max_length[16]');
+ break;
+ case 'sprache':
+ $this->form_validation->set_rules($field, 'Sprache', 'required|max_length[16]');
+ break;
+ case 'lvnr':
+ $this->form_validation->set_rules($field, 'LVNR', 'integer');
+ break;
+ case 'unr':
+ $this->form_validation->set_rules($field, 'UNR', 'integer|greater_than_equal_to[0]');
+ break;
+ case 'lehre':
+ $this->form_validation->set_rules($field, 'Lehre', 'trim');
+ break;
+ case 'anmerkung':
+ $this->form_validation->set_rules($field, 'Anmerkung', 'trim');
+ break;
+ }
+ }
+ }
+
+ if ($this->form_validation->run() === false)
+ {
+ $this->terminateWithValidationErrors($this->form_validation->error_array());
+ }
+
+ $updateData = [];
+ foreach ($updatableFields as $field)
+ {
+ if (array_key_exists($field, $formData))
+ {
+ $updateData[$field] = $formData[$field];
+ }
+ }
+
+
+ $updateData['updatevon'] = $this->_uid;
+ $updateData['updateamum'] = date('Y-m-d H:i:s');
+ $result = $this->_ci->LehreinheitModel->update(
+ [
+ 'lehreinheit_id' => $this->input->post('lehreinheit_id'),
+ ],
+ $updateData
+ );
+
+ if (isError($result))
+ $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
+ $this->terminateWithSuccess($this->p->t('global', 'gespeichert'));
+ }
+
+
+ private function checkPermission($lehreinheit_id)
+ {
+ $result = $this->_ci->LehreinheitModel->getOes($lehreinheit_id);
+
+ if (isError($result))
+ $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
+
+ $oe_array = [];
+ if (hasData($result))
+ $oe_array = getData($result);
+
+ if (!$this->_ci->permissionlib->isBerechtigtMultipleOe('admin', $oe_array, 'suid') &&
+ !$this->_ci->permissionlib->isBerechtigtMultipleOe('assistenz', $oe_array, 'suid') &&
+ !$this->_ci->permissionlib->isBerechtigtMultipleOe('lv-plan', $oe_array, 'suid'))
+ $this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
+ }
+ private function checkLehreinheit($lehreinheit_id)
+ {
+ if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $lehreinheit_result = $this->_ci->LehreinheitModel->load($lehreinheit_id);
+
+ if (!hasData($lehreinheit_result) || isError($lehreinheit_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ return getData($lehreinheit_result)[0];
+ }
+
+ private function _setAuthUID()
+ {
+ $this->_uid = getAuthUID();
+
+ if (!$this->_uid)
+ show_error('User authentification failed');
+ }
+}
diff --git a/application/controllers/api/frontend/v1/lv/Lektor.php b/application/controllers/api/frontend/v1/lv/Lektor.php
new file mode 100644
index 000000000..68bec1bc4
--- /dev/null
+++ b/application/controllers/api/frontend/v1/lv/Lektor.php
@@ -0,0 +1,409 @@
+ ['admin:rw', 'assistenz:rw'],
+ 'update' => ['admin:rw', 'assistenz:rw'],
+ 'cancelVertrag' => ['admin:rw', 'assistenz:rw'],
+ 'deleteLVPlan' => ['admin:rw', 'assistenz:rw'],
+ 'deletePerson' => ['admin:rw', 'assistenz:rw'],
+ 'getLehrfunktionen' => ['admin:r', 'assistenz:r'],
+ 'getLektoren' => ['admin:r', 'assistenz:r'],
+ 'getLektorenByLE' => ['admin:r', 'assistenz:r'],
+ 'getLektorDaten' => ['admin:r', 'assistenz:r'],
+ 'getLektorVertrag' => ['admin:r', 'assistenz:r'],
+
+ ]);
+
+ $this->_ci = &get_instance();
+ $this->_setAuthUID();
+ $this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
+ $this->_ci->load->library('PermissionLib');
+ $this->_ci->load->library('LektorLib');
+ $this->_ci->load->library('form_validation');
+ $this->loadPhrases([
+ 'ui'
+ ]);
+
+ $this->_ci->load->model('accounting/Vertrag_model', 'VertragModel');
+ $this->_ci->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
+ $this->_ci->load->model('education/lehreinheit_model', 'LehreinheitModel');
+ $this->_ci->load->model('education/Lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel');
+ $this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
+ $this->_ci->load->model('ressource/Stundensatz_model', 'StundensatzModel');
+
+ }
+
+ private function checkMitarbeiter($mitarbeiter_uid)
+ {
+ if (is_null($mitarbeiter_uid))
+ $this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $mitarbeiter_result = $this->_ci->MitarbeiterModel->load($mitarbeiter_uid);
+
+ if (!hasData($mitarbeiter_result) || isError($mitarbeiter_result))
+ $this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+ }
+
+ public function add()
+ {
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+ $mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
+
+ $this->checkLehreinheit($lehreinheit_id);
+ $this->checkMitarbeiter($mitarbeiter_uid);
+ $lehrfach_permission = $this->checkLehrfachPermission($lehreinheit_id, array('assistenz', 'admin'));
+ $lehreinheit_permission = $this->checkPermission($lehreinheit_id, array('admin', 'assistenz', 'lv-plan'));
+
+ if (!$lehrfach_permission && !$lehreinheit_permission)
+ $this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
+
+ $result = $this->_ci->lektorlib->addLektorToLehreinheit($lehreinheit_id, $mitarbeiter_uid);
+
+ if (isError($result)) $this->terminateWithError(getError($result));
+
+ $this->terminateWithSuccess("Erfolgreich gespeichert");
+ }
+
+ public function update()
+ {
+ $formData = $this->input->post('formData');
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+ $mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
+
+ $this->checkLehreinheit($lehreinheit_id);
+ $this->checkMitarbeiter($mitarbeiter_uid);
+
+ $updatableFields = array(
+ 'lehrfunktion_kurzbz',
+ 'planstunden',
+ 'stundensatz',
+ 'faktor',
+ 'anmerkung',
+ 'bismelden',
+ 'semesterstunden',
+ 'mitarbeiter_uid'
+ );
+
+ $this->form_validation->set_data($formData);
+
+ foreach ($updatableFields as $field)
+ {
+ if (array_key_exists($field, $formData))
+ {
+ switch ($field)
+ {
+ case 'lehrfunktion_kurzbz':
+ $this->form_validation->set_rules($field, 'Lehrfunktion', 'required|max_length[16]');
+ break;
+ case 'planstunden':
+ $this->form_validation->set_rules($field, 'Planstunden', 'integer|greater_than_equal_to[0]');
+ break;
+ case 'stundensatz':
+ $formData['stundensatz'] = str_replace(',', '.', $formData['stundensatz']);
+ $this->form_validation->set_rules($field, 'Stundensatz', 'callback__check_stundensatz');
+ break;
+ case 'faktor':
+ $this->form_validation->set_rules($field, 'Faktor', 'numeric|greater_than_equal_to[0]');
+ break;
+ case 'anmerkung':
+ $this->form_validation->set_rules($field, 'Anmerkung', 'max_length[256]');
+ break;
+ case 'bismelden':
+ $this->form_validation->set_rules($field, 'Bis Melden', 'trim');
+ break;
+ case 'semesterstunden':
+ $formData['semesterstunden'] = str_replace(',', '.', $formData['semesterstunden']);
+ $this->form_validation->set_rules($field, 'Semesterstunden', 'callback__check_semesterstunden');
+ break;
+ case 'mitarbeiter_uid':
+ $this->form_validation->set_rules($field, 'Semesterstunden', 'required|max_length[32]');
+ break;
+ }
+ }
+ }
+ if (!$this->form_validation->run())
+ {
+ $this->terminateWithValidationErrors($this->form_validation->error_array());
+ }
+
+ if (isset($formData['semesterstunden']) && (!is_numeric($formData['semesterstunden']) || $formData['semesterstunden'] === ''))
+ {
+ $formData['semesterstunden'] = null;
+ }
+
+ $lehreinheit_permission = $this->checkPermission($lehreinheit_id, array('admin', 'assistenz', 'lv-plan'));
+
+ if (!$lehreinheit_permission)
+ $this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
+
+ $result = $this->_ci->lektorlib->updateLektorFromLehreinheit($lehreinheit_id, $mitarbeiter_uid, $formData);
+
+ if (isError($result)) $this->terminateWithError(getError($result));
+ $this->terminateWithSuccess($result);
+ }
+
+ public function _check_stundensatz($value)
+ {
+ $value = str_replace(',', '.', $value);
+
+ if (!is_numeric($value))
+ {
+ $this->form_validation->set_message('_check_decimal', 'Das Feld {field} muss eine Zahl sein.');
+ return false;
+ }
+
+ if ($value < 0 || $value >= 10000) {
+ $this->form_validation->set_message('_check_decimal', 'Das Feld {field} muss zwischen 0 und 10000 liegen.');
+ return false;
+ }
+
+ return true;
+ }
+ public function _check_semesterstunden($value)
+ {
+ if ($value === null || $value === '') {
+ return true;
+ }
+
+ if (!is_numeric($value))
+ {
+ $this->form_validation->set_message(
+ '_check_semesterstunden',
+ 'Das Feld {field} muss eine Zahl sein.'
+ );
+ return false;
+ }
+
+ if ($value < 0)
+ {
+ $this->form_validation->set_message(
+ '_check_semesterstunden',
+ 'Das Feld {field} muss eine Zahl größer oder gleich 0 sein.'
+ );
+ return false;
+ }
+ if ($value > 999.99)
+ {
+ $this->form_validation->set_message(
+ '_check_semesterstunden',
+ 'Das Feld {field} darf maximal 999,99 betragen.'
+ );
+ return false;
+ }
+
+ return true;
+ }
+ public function getLehrfunktionen()
+ {
+ $this->_ci->load->model('education/Lehrfunktion_model', 'LehrfunktionModel');
+ $this->_ci->LehrfunktionModel->addOrder('lehrfunktion_kurzbz');
+ $this->terminateWithSuccess(getData($this->_ci->LehrfunktionModel->load()));
+ }
+
+ public function getLektoren()
+ {
+ $this->_ci->MitarbeiterModel->addSelect('uid, person_id, vorname, nachname');
+ $this->_ci->MitarbeiterModel->addJoin('public.tbl_benutzer', 'uid = mitarbeiter_uid');
+ $this->_ci->MitarbeiterModel->addJoin('public.tbl_person', 'person_id');
+ $this->terminateWithSuccess(getData($this->_ci->MitarbeiterModel->loadWhere(array('public.tbl_benutzer.aktiv' => true))));
+ }
+
+ private function checkLehreinheit($lehreinheit_id)
+ {
+ if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $lehreinheit_result = $this->_ci->LehreinheitModel->load($lehreinheit_id);
+
+ if (!hasData($lehreinheit_result) || isError($lehreinheit_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ return getData($lehreinheit_result)[0];
+
+ }
+ public function getLektorenByLE($lehreinheit_id = null)
+ {
+ $this->checkLehreinheit($lehreinheit_id);
+ $le_mitarbeiter_data = $this->_ci->LehreinheitmitarbeiterModel->getLektorenByLe($lehreinheit_id);
+ $this->terminateWithSuccess(hasData($le_mitarbeiter_data) ? getData($le_mitarbeiter_data) : array());
+ }
+
+ public function getLektorDaten($lehreinheit_id = null, $mitarbeiter_uid = null)
+ {
+ $lehreinheit = $this->checkLehreinheit($lehreinheit_id);
+
+ if (is_null($mitarbeiter_uid))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $mitarbeiter_result = $this->_ci->MitarbeiterModel->load($mitarbeiter_uid);
+
+ if (!hasData($mitarbeiter_result) || isError($mitarbeiter_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
+ $studiensemester_result = $this->_ci->StudiensemesterModel->loadWhere(array('studiensemester_kurzbz' => $lehreinheit->studiensemester_kurzbz));
+ $studiensemester = getData($studiensemester_result)[0];
+
+ $defaultStundensatz = $this->_ci->StundensatzModel->getDefaultStundensatz($mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'lehre');
+
+ $le_mitarbeiter_result = $this->_ci->LehreinheitmitarbeiterModel->getByLeLektor($lehreinheit_id, $mitarbeiter_uid);
+
+ $le_mitarbeiter_data = array();
+ if (hasData($le_mitarbeiter_result))
+ {
+ $le_mitarbeiter_data = getData($le_mitarbeiter_result)[0];
+ $le_mitarbeiter_data->default_stundensatz = $defaultStundensatz;
+ }
+ $vertrag = $this->getLektorVertrag($lehreinheit_id, $mitarbeiter_uid);
+ $le_mitarbeiter_data->vertrag = $vertrag;
+ $this->terminateWithSuccess($le_mitarbeiter_data);
+ }
+
+ private function getLektorVertrag($lehreinheit_id = null, $mitarbeiter_uid = null)
+ {
+ $this->_ci->load->model('accounting/Vertrag_model', 'VertragModel');
+ $vertrag = $this->_ci->VertragModel->getVertrag($mitarbeiter_uid, $lehreinheit_id);
+ return hasData($vertrag) ? getData($vertrag)[0] : null;
+ }
+
+ private function checkLehrfachPermission($lehreinheit_id, $permissions)
+ {
+ $lehrfach_oe_kurzbz = $this->_ci->LehreinheitModel->getLehrfachOe($lehreinheit_id);
+
+ if (isError($lehrfach_oe_kurzbz))
+ $this->terminateWithError(getError($lehrfach_oe_kurzbz), self::ERROR_TYPE_GENERAL);
+
+ $lehrfach_oe_kurzbz = array('');
+ if (hasData($lehrfach_oe_kurzbz))
+ $lehrfach_oe_kurzbz = array_column(getData($lehrfach_oe_kurzbz), 'oe_kurzbz');
+
+
+ return $this->checkPermissionGenerel($permissions, $lehrfach_oe_kurzbz);
+ }
+
+ private function checkPermissionGenerel($permissions, $oe_array)
+ {
+ $hasPermission = false;
+ foreach ($permissions as $permission)
+ {
+ if ($this->_ci->permissionlib->isBerechtigtMultipleOe($permission, $oe_array, 'suid'))
+ {
+ $hasPermission = true;
+ break;
+ }
+ }
+
+ return $hasPermission;
+ }
+
+ private function checkPermission($lehreinheit_id, $permissions)
+ {
+ $result = $this->_ci->LehreinheitModel->getOes($lehreinheit_id);
+
+ if (isError($result))
+ $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
+
+ $oe_array = [];
+ if (hasData($result))
+ $oe_array = getData($result);
+
+ return $this->checkPermissionGenerel($permissions, $oe_array);
+ }
+ public function cancelVertrag()
+ {
+ $vertrag_id = $this->input->post('vertrag_id');
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+ $mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
+
+ $this->checkLehreinheit($lehreinheit_id);
+ $this->checkPermission($lehreinheit_id, array('admin', 'lehre/lehrauftrag_bestellen'));
+
+ if (is_null($vertrag_id) || !ctype_digit((string)$vertrag_id))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $vertrag_result = $this->_ci->VertragModel->load($vertrag_id);
+
+ if (!hasData($vertrag_result) || isError($vertrag_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ if (is_null($mitarbeiter_uid))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $mitarbeiter_result = $this->_ci->MitarbeiterModel->load($mitarbeiter_uid);
+
+ if (!hasData($mitarbeiter_result) || isError($mitarbeiter_result))
+ $this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $result = $this->_ci->VertragModel->cancelVertrag($vertrag_id, $mitarbeiter_uid);
+
+ if (isError($result))
+ $this->terminateWithError(getError($result));
+
+ $this->terminateWithSuccess($result);
+ }
+
+ public function deletePerson()
+ {
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+ $mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
+
+ $this->checkLehreinheit($lehreinheit_id);
+ $this->checkPermission($lehreinheit_id, array('admin', 'assistenz', 'lv-plan'));
+
+ if (is_null($mitarbeiter_uid))
+ $this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $mitarbeiter_result = $this->_ci->MitarbeiterModel->load($mitarbeiter_uid);
+
+ if (!hasData($mitarbeiter_result) || isError($mitarbeiter_result))
+ $this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $delete_result =$this->_ci->LehreinheitmitarbeiterModel->deleteLektorFromLe($lehreinheit_id, $mitarbeiter_uid);
+
+ if (isError($delete_result))
+ $this->terminateWithError(getError($delete_result));
+
+ $this->terminateWithSuccess($delete_result);
+ }
+
+ public function deleteLVPlan()
+ {
+ $lehreinheit_id = $this->input->post('lehreinheit_id');
+ $mitarbeiter_uid = $this->input->post('mitarbeiter_uid');
+
+ $this->checkLehreinheit($lehreinheit_id);
+ $this->checkPermission($lehreinheit_id, array('lv-plan/lektorentfernen'));
+
+ if (is_null($mitarbeiter_uid))
+ $this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $mitarbeiter_result = $this->_ci->MitarbeiterModel->load($mitarbeiter_uid);
+
+ if (!hasData($mitarbeiter_result) || isError($mitarbeiter_result))
+ $this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+
+ $delete_result = $this->_ci->StundenplandevModel->deleteLektorPlanning($lehreinheit_id, $mitarbeiter_uid);
+
+ if (isError($delete_result))
+ $this->terminateWithError(getError($delete_result));
+
+ $this->terminateWithSuccess($delete_result);
+ }
+
+ private function _setAuthUID()
+ {
+ $this->_uid = getAuthUID();
+
+ if (!$this->_uid)
+ show_error('User authentification failed');
+ }
+}
diff --git a/application/controllers/api/frontend/v1/lv/Setup.php b/application/controllers/api/frontend/v1/lv/Setup.php
new file mode 100644
index 000000000..a2c167dd6
--- /dev/null
+++ b/application/controllers/api/frontend/v1/lv/Setup.php
@@ -0,0 +1,121 @@
+.
+ */
+
+if (!defined('BASEPATH'))
+ exit('No direct script access allowed');
+
+class Setup extends FHCAPI_Controller
+{
+ private $_ci;
+ private $_uid;
+
+ public function __construct()
+ {
+ parent::__construct([
+ 'getTabs' => ['admin:r', 'assistenz:r'],
+ 'getStudiensemester' => ['admin:r', 'assistenz:r'],
+ 'getSprache' => ['admin:r', 'assistenz:r'],
+ 'getRaumtyp' => ['admin:r', 'assistenz:r'],
+ 'getLehrform' => ['admin:r', 'assistenz:r'],
+ ]);
+
+ $this->_ci = &get_instance();
+ $this->_setAuthUID();
+
+ $this->_ci->load->model('education/Lehreinheit_model', 'LehreinheitModel');
+ $this->_ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
+
+ $this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
+ }
+
+ public function getTabs()
+ {
+ $tabs['details'] = array (
+ 'title' => 'Details',
+ 'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Details.js',
+ 'config' => []
+ );
+ $tabs['gruppen'] = array (
+ 'title' => 'Gruppen',
+ 'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Gruppen.js',
+ 'config' => []
+ );
+ $tabs['lektor'] = array (
+ 'title' => 'LektorInnenzuteilung',
+ 'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Lektor.js',
+ 'config' => []
+ );
+ $tabs['notiz'] = array (
+ 'title' => 'Notizen',
+ 'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Notiz.js',
+ 'config' => []
+ );
+ $this->terminateWithSuccess($tabs);
+ }
+
+ public function getStudiensemester()
+ {
+ $this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
+ $this->_ci->StudiensemesterModel->addOrder('start', 'DESC');
+ $this->terminateWithSuccess(getData($this->_ci->StudiensemesterModel->load()));
+ }
+ public function getSprache()
+ {
+ $this->_ci->load->model('system/Sprache_model', 'SpracheModel');
+ $this->terminateWithSuccess(getData($this->_ci->SpracheModel->load()));
+ }
+
+ public function getRaumtyp()
+ {
+ $this->_ci->load->model('ressource/Raumtyp_model', 'RaumtypModel');
+ $this->_ci->RaumtypModel->addOrder('raumtyp_kurzbz');
+ $this->terminateWithSuccess(getData($this->_ci->RaumtypModel->loadWhere(array('aktiv' => true))));
+ }
+
+ public function getLehrform()
+ {
+ $language = $this->_getLanguageIndex();
+
+ $this->_ci->load->model('codex/lehrform_model', 'LehrformModel');
+
+ $this->_ci->LehrformModel->addSelect(
+ '*,
+ bezeichnung_kurz[('.$language.')] as bez_kurz,
+ bezeichnung_lang[('.$language.')] as bez
+ '
+ );
+ $this->terminateWithSuccess(getData($this->_ci->LehrformModel->load()));
+ }
+
+ private function _getLanguageIndex()
+ {
+ $this->_ci->load->model('system/Sprache_model', 'SpracheModel');
+ $this->_ci->SpracheModel->addSelect('index');
+ $result = $this->_ci->SpracheModel->loadWhere(array('sprache' => getUserLanguage()));
+
+ return hasData($result) ? getData($result)[0]->index : 1;
+ }
+
+ private function _setAuthUID()
+ {
+ $this->_uid = getAuthUID();
+
+ if (!$this->_uid)
+ show_error('User authentification failed');
+ }
+}
diff --git a/application/controllers/api/frontend/v1/lv/StgTree.php b/application/controllers/api/frontend/v1/lv/StgTree.php
new file mode 100644
index 000000000..8272da978
--- /dev/null
+++ b/application/controllers/api/frontend/v1/lv/StgTree.php
@@ -0,0 +1,117 @@
+method] = ['admin:r', 'assistenz:r'];
+ parent::__construct($permissions);
+
+ $this->load->model('organisation/Studiengang_model', 'StudiengangModel');
+ }
+
+ public function _remap($method, $params = [])
+ {
+ if ($method == '' || $method == 'index')
+ return $this->getBase();
+
+ if (!$this->permissionlib->isBerechtigt('assistenz', 's', $method)
+ && !$this->permissionlib->isBerechtigt('admin', 's', $method)
+ ) {
+ return $this->_outputAuthError([$method => ['admin:r', 'assistenz:r']]);
+ }
+
+ return $this->getStudiengang($method);
+ show_404();
+ }
+
+ 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->addSelect('studiengang_kz');
+ $this->StudiengangModel->addSelect('studiengang_kz AS stg_kz');
+
+ $this->StudiengangModel->addOrder('erhalter_kz');
+ $this->StudiengangModel->addOrder('typ');
+ $this->StudiengangModel->addOrder('kurzbz');
+
+ $stgs = $this->permissionlib->getSTG_isEntitledFor('admin') ?: [];
+ $stgs = array_merge($stgs, $this->permissionlib->getSTG_isEntitledFor('assistenz') ?: []);
+
+ if (!$stgs)
+ $this->terminateWithSuccess([]);
+
+ $this->StudiengangModel->db->where_in('studiengang_kz', $stgs);
+
+ $result = $this->StudiengangModel->loadWhere(['v.aktiv' => true]);
+
+ $list = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess($list);
+ }
+
+ protected function getStudiengang($studiengang_kz)
+ {
+ $link = $studiengang_kz . '/';
+
+ $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("TRUE AS leaf", false);
+
+ $this->StudiengangModel->addSelect('semester');
+ $this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
+
+ $this->StudiengangModel->addOrder('semester');
+
+ $result = $this->StudiengangModel->loadWhere([
+ 'v.studiengang_kz' => $studiengang_kz,
+ 'v.aktiv' => true
+ ]);
+ $list = $this->getDataOrTerminateWithError($result);
+
+ $result = $this->StudiengangModel->load($studiengang_kz);
+ $result = $this->getDataOrTerminateWithError($result);
+ if ($result)
+ {
+ if (current($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");
+ $this->StudienordnungModel->addSelect("TRUE as leaf", false);
+
+ $this->StudienordnungModel->addJoin('lehre.tbl_studienplan p', 'studienordnung_id');
+
+ $result = $this->StudienordnungModel->loadWhere([
+ 'aktiv' => true,
+ 'studiengang_kz' => $studiengang_kz,
+ 'p.orgform_kurzbz !=' => 'DDP'
+ ]);
+ $result = $this->getDataOrTerminateWithError($result);
+
+ $list = array_merge($list, $result);
+ }
+ }
+
+ $this->terminateWithSuccess($list);
+ }
+}
diff --git a/application/controllers/api/frontend/v1/lv/Tags.php b/application/controllers/api/frontend/v1/lv/Tags.php
new file mode 100644
index 000000000..a22a4c82e
--- /dev/null
+++ b/application/controllers/api/frontend/v1/lv/Tags.php
@@ -0,0 +1,50 @@
+ self::BERECHTIGUNG_KURZBZ,
+ 'getTags' => self::BERECHTIGUNG_KURZBZ,
+ 'addTag' => self::BERECHTIGUNG_KURZBZ,
+ 'updateTag' => self::BERECHTIGUNG_KURZBZ,
+ 'doneTag' => self::BERECHTIGUNG_KURZBZ,
+ 'deleteTag' => self::BERECHTIGUNG_KURZBZ,
+ 'updateLehre' => self::BERECHTIGUNG_KURZBZ,
+ 'doneLehre' => self::BERECHTIGUNG_KURZBZ,
+ 'deleteLehre' => self::BERECHTIGUNG_KURZBZ,
+ ]);
+
+ $this->config->load('lvverwaltung');
+ }
+ public function getTag($readonly_tags = null)
+ {
+ parent::getTag($this->config->item('lvverwaltung_tags'));
+ }
+ public function getTags($tags = null)
+ {
+ parent::getTags($this->config->item('lvverwaltung_tags'));
+ }
+ public function addTag($withZuordnung = true, $updatable_tags = null)
+ {
+ parent::addTag(true, $this->config->item('lvverwaltung_tags'));
+ }
+ public function updateTag($updatable_tags = null)
+ {
+ parent::updateTag($this->config->item('lvverwaltung_tags'));
+ }
+ public function deleteTag($withZuordnung = true, $updatable_tags = null)
+ {
+ parent::deleteTag(true, $this->config->item('lvverwaltung_tags'));
+ }
+ public function doneTag($updatable_tags = null)
+ {
+ parent::doneTag($this->config->item('lvverwaltung_tags'));
+ }
+}
\ No newline at end of file
diff --git a/application/controllers/api/frontend/v1/notiz/NotizLehreinheit.php b/application/controllers/api/frontend/v1/notiz/NotizLehreinheit.php
new file mode 100644
index 000000000..f8e1f816b
--- /dev/null
+++ b/application/controllers/api/frontend/v1/notiz/NotizLehreinheit.php
@@ -0,0 +1,21 @@
+ ['admin:r', 'assistenz:r'],
+ 'getNotizen' => ['admin:r', 'assistenz:r'],
+ 'loadNotiz' => ['admin:r', 'assistenz:r'],
+ 'addNewNotiz' => ['admin:rw', 'assistenz:rw'],
+ 'updateNotiz' => ['admin:rw', 'assistenz:rw'],
+ 'deleteNotiz' => ['admin:rw', 'assistenz:rw'],
+ 'loadDokumente' => ['admin:r', 'assistenz:r'],
+ 'getMitarbeiter' => ['admin:r', 'assistenz:r'],
+ 'isBerechtigt' => ['admin:r', 'assistenz:r'],
+ ]);
+ }
+}
\ No newline at end of file
diff --git a/application/controllers/api/frontend/v1/stv/Favorites.php b/application/controllers/api/frontend/v1/stv/Favorites.php
index ca8b62da6..951eb01a4 100644
--- a/application/controllers/api/frontend/v1/stv/Favorites.php
+++ b/application/controllers/api/frontend/v1/stv/Favorites.php
@@ -60,17 +60,6 @@ class Favorites extends FHCAPI_Controller
$favorites = $this->input->post('favorites');
- $removed = [];
- while (strlen($favorites) > 64) {
- $favObj = json_decode($favorites);
- if (!$favObj->list)
- break;
- $removed[] = array_shift($favObj->list);
- $favorites = json_encode($favObj);
- }
- if ($removed)
- $this->addMeta('removed', $removed);
-
$result = $this->VariableModel->setVariable(getAuthUID(), 'stv_favorites', $favorites);
$this->getDataOrTerminateWithError($result);
diff --git a/application/controllers/api/frontend/v1/stv/Kontakt.php b/application/controllers/api/frontend/v1/stv/Kontakt.php
index 9b713b5f9..3a8268775 100644
--- a/application/controllers/api/frontend/v1/stv/Kontakt.php
+++ b/application/controllers/api/frontend/v1/stv/Kontakt.php
@@ -434,7 +434,10 @@ class Kontakt extends FHCAPI_Controller
$this->FirmaModel->addJoin('public.tbl_firma f', 'ON (f.firma_id = st.firma_id)', 'LEFT');
$this->KontakttypModel->addJoin('public.tbl_kontakttyp kt', 'ON (public.tbl_kontakt.kontakttyp = kt.kontakttyp)');
$result = $this->KontaktModel->loadWhere(
- array('person_id' => $person_id)
+ array(
+ 'person_id' => $person_id,
+ 'public.tbl_kontakt.kontakttyp !=' => 'hidden'
+ )
);
if (isError($result))
@@ -442,20 +445,18 @@ class Kontakt extends FHCAPI_Controller
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
}
$this->terminateWithSuccess((getData($result) ?: []));
+
}
public function getKontakttypen()
{
$this->load->model('person/Kontakttyp_model', 'KontakttypModel');
+ $this->KontakttypModel->addOrder('beschreibung', 'ASC');
+ $result = $this->KontakttypModel->loadWhere(array('kontakttyp !=' => 'hidden'));
- $result = $this->KontakttypModel->load();
- if (isError($result)) {
- $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
- }
- else
- {
- $this->terminateWithSuccess(getData($result) ?: []);
- }
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess($data);
}
public function loadContact()
diff --git a/application/controllers/api/frontend/v1/stv/Konto.php b/application/controllers/api/frontend/v1/stv/Konto.php
index a33680ea0..384452f3e 100644
--- a/application/controllers/api/frontend/v1/stv/Konto.php
+++ b/application/controllers/api/frontend/v1/stv/Konto.php
@@ -352,7 +352,7 @@ class Konto extends FHCAPI_Controller
continue;
}
-
+
$result = $this->KontoModel->insert([
'person_id' => $buchung['person_id'],
'studiengang_kz' => $buchung['studiengang_kz'],
@@ -361,7 +361,7 @@ class Konto extends FHCAPI_Controller
'buchungstyp_kurzbz' => $buchung['buchungstyp_kurzbz'],
'credit_points' => $buchung['credit_points'],
'zahlungsreferenz' => $buchung['zahlungsreferenz'],
- 'betrag' => $betrag,
+ 'betrag' => number_format($betrag, 2, '.', ''),
'buchungsdatum' => $buchungsdatum,
'mahnspanne' => '0',
'buchungsnr_verweis' => $buchung['buchungsnr'],
diff --git a/application/controllers/api/frontend/v1/stv/Prestudent.php b/application/controllers/api/frontend/v1/stv/Prestudent.php
index 4d0aa5fe1..7dc607d1a 100644
--- a/application/controllers/api/frontend/v1/stv/Prestudent.php
+++ b/application/controllers/api/frontend/v1/stv/Prestudent.php
@@ -138,13 +138,24 @@ class Prestudent extends FHCAPI_Controller
{
$val = $this->input->post($prop, true);
- if ($val !== null || $prop === 'foerderrelevant') {
+ if ($val !== null) {
+ if(in_array($prop, ['dual', 'bismelden', 'foerderrelevant']))
+ {
+ $val = boolval($val);
+ }
+ elseif (
+ $val === ''
+ && in_array($prop, ['zgvnation', 'zgvmanation', 'zgvdoktornation', 'berufstaetigkeit_code', 'ausbildungcode'])
+ )
+ {
+ $val = null;
+ }
$update_prestudent[$prop] = $val;
}
// allowed to be null, but has to be in postparameter
if (
- in_array($prop, ['zgvdatum', 'zgvmadatum', 'zgvdoktordatum', 'zgv_code', 'zgvmas_code', 'zgvdoktor_code'])
+ in_array($prop, ['foerderrelevant', 'zgvdatum', 'zgvmadatum', 'zgvdoktordatum', 'zgv_code', 'zgvmas_code', 'zgvdoktor_code'])
&& !isset($update_prestudent[$prop])
&& array_key_exists($prop, $_POST)
)
diff --git a/application/controllers/api/frontend/v1/stv/Status.php b/application/controllers/api/frontend/v1/stv/Status.php
index 665fb620f..dc48a47ff 100644
--- a/application/controllers/api/frontend/v1/stv/Status.php
+++ b/application/controllers/api/frontend/v1/stv/Status.php
@@ -286,11 +286,11 @@ class Status extends FHCAPI_Controller
]);
$this->form_validation->set_rules('_default', '', [
- ['meldestichtag_not_exceeded', function () use ($datum, $isBerechtigtNoStudstatusCheck) {
+ ['meldestichtag_not_exceeded', function () use ($datum_string, $isBerechtigtNoStudstatusCheck) {
if ($isBerechtigtNoStudstatusCheck)
return true; // Skip if access right says so
- $result = $this->prestudentstatuschecklib->checkIfMeldestichtagErreicht($datum);
+ $result = $this->prestudentstatuschecklib->checkIfMeldestichtagErreicht($datum_string);
return !$this->getDataOrTerminateWithError($result);
}],
@@ -733,8 +733,9 @@ class Status extends FHCAPI_Controller
);
$result = $this->prestudentstatuschecklib->checkIfMeldestichtagErreicht($oldstatus->datum);
+ $isMeldestichtagErreicht = $this->getDataOrTerminateWithError($result);
- if (!$this->getDataOrTerminateWithError($result))
+ if ($isMeldestichtagErreicht)
$this->terminateWithError(
$this->p->t('lehre', 'error_dataVorMeldestichtag'),
self::ERROR_TYPE_GENERAL,
diff --git a/application/controllers/api/frontend/v1/stv/Student.php b/application/controllers/api/frontend/v1/stv/Student.php
index 0cfd82c36..f2845572f 100644
--- a/application/controllers/api/frontend/v1/stv/Student.php
+++ b/application/controllers/api/frontend/v1/stv/Student.php
@@ -276,7 +276,17 @@ class Student extends FHCAPI_Controller
$update_person = array();
foreach ($array_allowed_props_person as $prop) {
$val = $this->input->post($prop);
- if ($val !== null) {
+ if ($val === null)
+ {
+ continue;
+ }
+ if($prop == 'foto')
+ {
+ $fotoval = ($val == '') ? null : str_replace('data:image/jpeg;base64,', '', $val);
+ $update_person[$prop] = $fotoval;
+ }
+ else
+ {
$update_person[$prop] = $val;
}
}
diff --git a/application/controllers/jobs/MeldezettelJob.php b/application/controllers/jobs/MeldezettelJob.php
new file mode 100644
index 000000000..329597985
--- /dev/null
+++ b/application/controllers/jobs/MeldezettelJob.php
@@ -0,0 +1,86 @@
+_ci =& get_instance();
+
+ $this->_ci->load->model('crm/Dokumentprestudent_model', 'DokumentprestudentModel');
+ }
+
+ /**
+ * Sets Meldezettel to "accepted" for all students with Meldeadresse.
+ */
+ public function acceptMeldezettel()
+ {
+ $this->logInfo('Start Meldezettel Job');
+
+ $params = array(self::DOKUMENT_KURZBZ);
+
+ $qry = "
+ -- get all prestudents with meldeadresse, but no accepted Meldezettel
+ SELECT
+ DISTINCT prestudent_id
+ FROM
+ public.tbl_adresse
+ JOIN public.tbl_person USING (person_id)
+ JOIN public.tbl_prestudent ps USING (person_id)
+ WHERE
+ typ = 'm'
+ AND NOT EXISTS (
+ SELECT
+ 1
+ FROM
+ public.tbl_dokumentprestudent
+ WHERE
+ prestudent_id = ps.prestudent_id
+ AND dokument_kurzbz = ?
+ )";
+
+ // get all prestudents with Meldeadresse and no accpeted Meldezettel
+ $result = $this->_ci->DokumentprestudentModel->execReadOnlyQuery($qry, $params);
+
+ if (isError($result))
+ {
+ $this->logError(getError($result));
+ }
+
+ $count = 0;
+
+ if (hasData($result))
+ {
+ $prestudents = getData($result);
+
+ foreach ($prestudents as $prestudent)
+ {
+ // set Meldezettel to accepted
+ $result = $this->_ci->DokumentprestudentModel->insert(
+ array(
+ 'prestudent_id' => $prestudent->prestudent_id,
+ 'dokument_kurzbz' => self::DOKUMENT_KURZBZ,
+ 'datum' => date('Y-m-d'),
+ 'insertamum' => strftime('%Y-%m-%d %H:%M'),
+ 'insertvon' => self::INSERT_VON
+ )
+ );
+
+ if (isError($result))
+ $this->logError(getError($result));
+ else
+ $count++;
+ }
+ }
+
+ $this->logInfo('End Meldezettel Job', array('Number of changes ' => $count));
+ }
+}
diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php
index 1fc49c72f..1a4f566e6 100644
--- a/application/controllers/system/infocenter/InfoCenter.php
+++ b/application/controllers/system/infocenter/InfoCenter.php
@@ -362,6 +362,8 @@ class InfoCenter extends Auth_Controller
$data[self::ORIGIN_PAGE] = $origin_page;
$data[self::PREV_FILTER_ID] = $this->input->get(self::PREV_FILTER_ID);
+ $data['studiensemester'] = $this->variablelib->getVar('infocenter_studiensemester');
+
$this->load->view('system/infocenter/infocenterDetails.php', $data);
}
diff --git a/application/core/Notiz_Controller.php b/application/core/Notiz_Controller.php
index c2bb03267..cfc54d5f5 100644
--- a/application/core/Notiz_Controller.php
+++ b/application/core/Notiz_Controller.php
@@ -393,10 +393,10 @@ abstract class Notiz_Controller extends FHCAPI_Controller
foreach ($result as $doc) {
$res = $this->dmslib->removeAll($doc->dms_id);
- if (isError($result))
+ if (isError($res))
{
$this->db->trans_rollback();
- $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
+ $this->terminateWithError(getError($res), self::ERROR_TYPE_GENERAL);
}
}
diff --git a/application/core/Tag_Controller.php b/application/core/Tag_Controller.php
index 10e54780e..5b9bac6c5 100644
--- a/application/core/Tag_Controller.php
+++ b/application/core/Tag_Controller.php
@@ -29,13 +29,36 @@ class Tag_Controller extends FHCAPI_Controller
$this->load->model('person/Notiz_model', 'NotizModel');
$this->load->model('system/Notiztyp_model', 'NotiztypModel');
$this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel');
+
+ $this->loadPhrases([
+ 'ui'
+ ]);
}
- public function getTag()
+ public function getTag($readonly_tags = null)
{
$language = $this->_getLanguageIndex();
$id = $this->input->get('id');
+ if (is_array($readonly_tags) && !isEmptyArray($readonly_tags))
+ {
+ $readonly_tags = $this->_filterTag($readonly_tags, true);
+
+ foreach ($readonly_tags as $key => $tag)
+ {
+ $readonly_tags[$key] = $this->NotizModel->db->escape($tag);
+ }
+ $tags = '(' . implode(',', $readonly_tags) . ')';
+
+ $this->NotizModel->addSelect("
+ CASE
+ WHEN tbl_notiz_typ.typ_kurzbz IN $tags
+ THEN TRUE
+ ELSE FALSE
+ END as readonly
+ ");
+ }
+
$this->NotizModel->addSelect(
"tbl_notiz.titel,
tbl_notiz.text,
@@ -54,7 +77,7 @@ class Tag_Controller extends FHCAPI_Controller
$this->NotizModel->addJoin('public.tbl_benutzer verfasserbenutzer', 'tbl_notiz.verfasser_uid = verfasserbenutzer.uid', 'LEFT');
$this->NotizModel->addJoin('public.tbl_person verfasserperson', 'verfasserbenutzer.person_id = verfasserperson.person_id', 'LEFT');
- $this->NotizModel->addJoin('public.tbl_benutzer bearbeiterbenutzer', 'tbl_notiz.verfasser_uid = bearbeiterbenutzer.uid', 'LEFT');
+ $this->NotizModel->addJoin('public.tbl_benutzer bearbeiterbenutzer', 'tbl_notiz.bearbeiter_uid = bearbeiterbenutzer.uid', 'LEFT');
$this->NotizModel->addJoin('public.tbl_person bearbeiterperson', 'bearbeiterbenutzer.person_id = bearbeiterperson.person_id', 'LEFT');
$notiz = $this->NotizModel->loadWhere(array('notiz_id' => $id));
@@ -62,7 +85,7 @@ class Tag_Controller extends FHCAPI_Controller
$this->terminateWithSuccess(hasData($notiz) ? getData($notiz)[0] : array());
}
- public function getTags()
+ public function getTags($tags = null)
{
$this->NotiztypModel->addSelect(
'typ_kurzbz as tag_typ_kurzbz,
@@ -73,19 +96,36 @@ class Tag_Controller extends FHCAPI_Controller
'
);
$this->NotiztypModel->addOrder('prioritaet');
+
+ if (is_array($tags) && !isEmptyArray($tags))
+ {
+ $tags = $this->_filterTag($tags, false);
+ $this->NotiztypModel->db->where_in('typ_kurzbz', $tags);
+ }
+
$notiztypen = $this->NotiztypModel->loadWhere(array('aktiv' => true));
$this->terminateWithSuccess(hasData($notiztypen) ? getData($notiztypen) : array());
}
- public function addTag($withZuordnung = true)
+ public function addTag($withZuordnung = true, $updatable_tags = null)
{
$postData = $this->getPostJson();
$checkTyp = $this->NotiztypModel->loadWhere(array('typ_kurzbz' => $postData->tag_typ_kurzbz));
- if (!hasData($checkTyp))
- $this->terminateWithError('Error occurred', self::ERROR_TYPE_GENERAL);
+ if (isError($checkTyp))
+ $this->terminateWithError($this->p->t('ui', 'fehlerBeimLesen'));
+ if (!hasData($checkTyp))
+ $this->terminateWithError($this->p->t('ui', 'fehlerBeimLesen'));
+
+ if (is_array($updatable_tags) && !isEmptyArray($updatable_tags))
+ {
+ $tags = $this->_filterTag($updatable_tags, false);
+
+ if (!in_array($postData->tag_typ_kurzbz, $tags))
+ $this->terminateWithError($this->p->t('ui', 'keineBerechtigung'));
+ }
if ($withZuordnung)
{
@@ -125,48 +165,88 @@ class Tag_Controller extends FHCAPI_Controller
}
}
- private function addNotiz($postData)
- {
- return $this->NotizModel->insert(array(
- 'titel' => 'TAG', //TODO klären
- 'text' => $postData->notiz,
- 'verfasser_uid' => $this->_uid,
- 'erledigt' => false,
- 'insertamum' => date('Y-m-d H:i:s'),
- 'insertvon' => $this->_uid,
- 'typ' => $postData->tag_typ_kurzbz
- ));
-
- }
- public function updateTag()
+ public function updateTag($updatable_tags = null)
{
$postData = $this->getPostJson();
+ $post_tag = $this->NotizModel->loadWhere(array('notiz_id' => $postData->id));
+
+ if (isError($post_tag))
+ $this->terminateWithError($this->p->t('ui', 'fehlerBeimLesen'));
+
+ if (!hasData($post_tag))
+ $this->terminateWithError($this->p->t('ui', 'fehlerBeimLesen'));
+
+ if (is_array($updatable_tags) && !isEmptyArray($updatable_tags))
+ {
+ $tags = $this->_filterTag($updatable_tags, false);
+
+ $post_tag_typ = getData($post_tag)[0]->typ;
+
+ if (!in_array($post_tag_typ, $tags))
+ $this->terminateWithError($this->p->t('ui', 'keineBerechtigung'));
+ }
+
$updateData = $this->NotizModel->update(array('notiz_id' => $postData->id),
array('text' => $postData->notiz,
'updateamum' => date('Y-m-d H:i:s'),
'updatevon' => $this->_uid,
'bearbeiter_uid' => $this->_uid,
- )
+ )
);
$this->terminateWithSuccess($updateData);
}
- public function doneTag()
+ public function doneTag($updatable_tags = null)
{
$postData = $this->getPostJson();
+ $post_tag = $this->NotizModel->loadWhere(array('notiz_id' => $postData->id));
+
+ if (isError($post_tag))
+ $this->terminateWithError($this->p->t('ui', 'fehlerBeimLesen'));
+
+ if (!hasData($post_tag))
+ $this->terminateWithError($this->p->t('ui', 'fehlerBeimLesen'));
+
+ if (is_array($updatable_tags) && !isEmptyArray($updatable_tags))
+ {
+ $tags = $this->_filterTag($updatable_tags, false);
+
+ $post_tag_typ = getData($post_tag)[0]->typ;
+
+ if (!in_array($post_tag_typ, $tags))
+ $this->terminateWithError($this->p->t('ui', 'keineBerechtigung'));
+ }
+
$updateData = $this->NotizModel->update(array('notiz_id' => $postData->id),
array('erledigt' => !$postData->done,
+ 'text' => $postData->notiz,
'updateamum' => date('Y-m-d H:i:s'),
'updatevon' => $this->_uid,
'bearbeiter_uid' => $this->_uid,
)
);
-
$this->terminateWithSuccess($updateData);
}
- public function deleteTag($withZuordnung = true)
+ public function deleteTag($withZuordnung = true, $updatable_tags = null)
{
$postData = $this->getPostJson();
+ $post_tag = $this->NotizModel->loadWhere(array('notiz_id' => $postData->id));
+
+ if (isError($post_tag))
+ $this->terminateWithError($this->p->t('ui', 'fehlerBeimLesen'));
+
+ if (!hasData($post_tag))
+ $this->terminateWithError($this->p->t('ui', 'fehlerBeimLesen'));
+
+ if (is_array($updatable_tags) && !isEmptyArray($updatable_tags))
+ {
+ $tags = $this->_filterTag($updatable_tags, false);
+
+ $post_tag_typ = getData($post_tag)[0]->typ;
+
+ if (!in_array($post_tag_typ, $tags))
+ $this->terminateWithError($this->p->t('ui', 'keineBerechtigung'));
+ }
$deleteNotiz = "";
if ($withZuordnung)
@@ -208,5 +288,27 @@ class Tag_Controller extends FHCAPI_Controller
return hasData($result) ? getData($result)[0]->index : 1;
}
+ private function _filterTag($tags, $readonly = true)
+ {
+ $filtered_tags = array_filter($tags, function ($tag) use ($readonly)
+ {
+ return isset($tag['readonly']) && $tag['readonly'] === $readonly;
+ });
+
+ return array_keys($filtered_tags);
+ }
+
+ private function addNotiz($postData)
+ {
+ return $this->NotizModel->insert(array(
+ 'titel' => 'TAG', //TODO klären
+ 'text' => $postData->notiz,
+ 'verfasser_uid' => $this->_uid,
+ 'erledigt' => false,
+ 'insertamum' => date('Y-m-d H:i:s'),
+ 'insertvon' => $this->_uid,
+ 'typ' => $postData->tag_typ_kurzbz
+ ));
+ }
}
\ No newline at end of file
diff --git a/application/libraries/FilterCmptLib.php b/application/libraries/FilterCmptLib.php
index 272899de6..b1de89245 100644
--- a/application/libraries/FilterCmptLib.php
+++ b/application/libraries/FilterCmptLib.php
@@ -1,7 +1,7 @@
getSession();
// If session is NOT empty -> a filter was already loaded
- if ($session != null)
+ if (!isError($session) && $session != null)
{
// Retrieve the filterId stored in the session
$sessionFilterId = $this->_getSessionElement(FilterCmptLib::FILTER_ID);
@@ -219,9 +219,7 @@ class FilterCmptLib
}
}
}
-
- // If the session is empty -> first time that this filter is loaded
- if ($session == null)
+ else
{
// Load filter definition data from DB
$definition = $this->_loadDefinition(
@@ -602,7 +600,7 @@ class FilterCmptLib
{
$session = getSessionElement(self::SESSION_NAME, $this->_filterUniqueId);
- if (isset($session[$name]))
+ if (!isError($session) && isset($session[$name]))
{
return $session[$name];
}
@@ -623,7 +621,7 @@ class FilterCmptLib
if (!$this->_ci->permissionlib->hasAtLeastOne($this->_requiredPermissions, self::PERMISSION_FILTER_METHOD, self::PERMISSION_TYPE))
{
- $this->_setSession(error('The required permission is not help by the logged user'));
+ $this->_setSession(error('The required permission is not held by the logged user'));
return false;
}
@@ -904,7 +902,7 @@ class FilterCmptLib
$filterCmptsSession = getSession(self::SESSION_NAME);
// If something is present in session
- if ($filterCmptsSession != null)
+ if (!isError($filterCmptsSession) && $filterCmptsSession != null)
{
// Loops in the session for all the filter components
foreach ($filterCmptsSession as $filterCmpt => $filterCmptData)
@@ -951,9 +949,11 @@ class FilterCmptLib
{
$session = getSessionElement(self::SESSION_NAME, $this->_filterUniqueId);
- $session[$name] = $value;
-
- setSessionElement(self::SESSION_NAME, $this->_filterUniqueId, $session); // stores the single value
+ if (!isError($session) && $session != null)
+ {
+ $session[$name] = $value;
+ setSessionElement(self::SESSION_NAME, $this->_filterUniqueId, $session); // stores the single value
+ }
}
/**
@@ -965,7 +965,7 @@ class FilterCmptLib
$filterCmptsSession = getSession(self::SESSION_NAME);
// If something is present in session
- if ($filterCmptsSession != null)
+ if (!isError($filterCmptsSession) && $filterCmptsSession != null)
{
// Loops in the session for all the filter components
foreach ($filterCmptsSession as $filterCmpt => $filterCmptData)
@@ -1174,3 +1174,4 @@ class FilterCmptLib
return $filterName;
}
}
+
diff --git a/application/libraries/LektorLib.php b/application/libraries/LektorLib.php
new file mode 100644
index 000000000..e06e2b728
--- /dev/null
+++ b/application/libraries/LektorLib.php
@@ -0,0 +1,342 @@
+_ci =& get_instance();
+ $this->_ci->load->model('education/lehreinheit_model', 'LehreinheitModel');
+ $this->_ci->load->model('education/Lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel');
+ $this->_ci->load->model('organisation/Studiensemester_model','StudiensemesterModel');
+ $this->_ci->load->model('ressource/Stundensatz_model', 'StundensatzModel');
+ $this->_ci->load->model('vertragsbestandteil/Dienstverhaeltnis_model','DienstverhaeltnisModel');
+ $this->_ci->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
+ $this->_ci->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
+ $this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
+ }
+
+ public function addLektorToLehreinheit($lehreinheit_id, $mitarbeiter_uid)
+ {
+ $this->_ci->LehreinheitModel->addSelect('tbl_lehreinheit.*, tbl_lehrveranstaltung.studiengang_kz, semesterstunden');
+ $this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
+ $lehreinheit_result = $this->_ci->LehreinheitModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
+
+ if (isError($lehreinheit_result)) return $lehreinheit_result;
+
+ if (!hasData($lehreinheit_result)) return error("Lehreinheit not found");
+
+ $lehreinheit = getData($lehreinheit_result)[0];
+
+ $already_assigned = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('lehreinheit_id' => $lehreinheit->lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
+
+ if (isError($already_assigned)) return $already_assigned;
+
+ if (hasData($already_assigned)) return error('Lektor already assigned');
+
+ $studiensemester_result = $this->_ci->StudiensemesterModel->loadWhere(array('studiensemester_kurzbz' => $lehreinheit->studiensemester_kurzbz));
+ if (isError($studiensemester_result)) return $studiensemester_result;
+ $studiensemester = getData($studiensemester_result)[0];
+
+ $stundensatz = $this->_ci->StundensatzModel->getDefaultStundensatz($mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'lehre');
+ $echter_dv_result = $this->_ci->DienstverhaeltnisModel->existsDienstverhaeltnis($mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'echterdv');
+
+ $echter_dv = false;
+
+ if (hasData($echter_dv_result))
+ {
+ $echter_dv = true;
+ }
+
+ $maxstunden = $this->getMaxStunden($mitarbeiter_uid, $studiensemester->studiensemester_kurzbz, $lehreinheit->studiengang_kz, $echter_dv);
+
+ $newData['semesterstunden'] = 0;
+ $newData['planstunden'] = 0;
+ if (!is_null($lehreinheit->semesterstunden))
+ {
+ $newData['semesterstunden'] = min($lehreinheit->semesterstunden, $maxstunden);
+ $newData['planstunden'] = min($lehreinheit->semesterstunden, $maxstunden);
+ }
+
+ $newData['lehreinheit_id'] = $lehreinheit->lehreinheit_id;
+ $newData['mitarbeiter_uid'] = $mitarbeiter_uid;
+ $newData['lehrfunktion_kurzbz'] = 'Lektor';
+ $newData['bismelden'] = true;
+ $newData['insertvon'] = getAuthUID();
+ $newData['insertamum'] = date('Y-m-d H:i:s');
+ $newData['stundensatz'] = $stundensatz;
+ $result = $this->_ci->LehreinheitmitarbeiterModel->insert($newData);
+
+ if (isError($result)) return $result;
+
+ return success("Lektor added successfully");
+ }
+
+ public function updateLektorFromLehreinheit($lehreinheit_id, $mitarbeiter_uid, $new_data)
+ {
+ $this->_ci->LehreinheitmitarbeiterModel->addSelect('lehre.tbl_lehreinheitmitarbeiter.*, lehre.tbl_lehreinheit.studiensemester_kurzbz, tbl_lehrveranstaltung.studiengang_kz');
+ $this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
+ $this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
+ $lehreinheit_result = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
+
+ if (isError($lehreinheit_result)) return $lehreinheit_result;
+
+ if (!hasData($lehreinheit_result)) return error("Lehreinheit not found");
+
+ $lehreinheit = getData($lehreinheit_result)[0];
+
+ //TODO kollision check, wird vorerst nicht implementiert -> nur über das FAS möglich
+ if (isset($new_data['mitarbeiter_uid']) && $new_data['mitarbeiter_uid'] !== $mitarbeiter_uid)
+ {
+ $this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
+ $this->_ci->StundenplandevModel->addGroupBy('stundenplandev_id');
+ $this->_ci->StundenplandevModel->addGroupBy('mitarbeiter_uid');
+ $this->_ci->StundenplandevModel->addGroupBy('mitarbeiter_uid');
+ $verplant = $this->_ci->StundenplandevModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
+
+ if (hasData($verplant))
+ return error('Wechsel vom Mitarbeiter nicht möglich da er bereits verplant ist!');
+ }
+ $warning = '';
+ if (isset($new_data['semesterstunden']))
+ {
+ $studiengang_result = $this->_ci->StudiengangModel->loadWhere(array('studiengang_kz' => $lehreinheit->studiengang_kz));
+ if (isError($studiengang_result)) return $studiengang_result;
+ if (!hasData($studiengang_result)) return error('Studiengang not found');
+ $studiengang = getData($studiengang_result)[0];
+
+ $studiensemester_result = $this->_ci->StudiensemesterModel->loadWhere(array('studiensemester_kurzbz' => $lehreinheit->studiensemester_kurzbz));
+ if (isError($studiensemester_result)) return $studiensemester_result;
+ $studiensemester = getData($studiensemester_result)[0];
+
+ $echter_dv_result = $this->_ci->DienstverhaeltnisModel->existsDienstverhaeltnis($mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'echterdv');
+
+ $echter_dv = false;
+
+ if (hasData($echter_dv_result))
+ {
+ $echter_dv = true;
+ }
+
+ $neue_stunden_eingerechnet = isset($new_data['bismelden']) ? $new_data['bismelden'] : $lehreinheit->bismelden;
+ $alte_stunden_eingerechnet = $lehreinheit->bismelden;
+
+ if (($new_data['semesterstunden'] > $lehreinheit->semesterstunden) || $neue_stunden_eingerechnet)
+ {
+ $stundengrenze_result = $this->_ci->OrganisationseinheitModel->getStundengrenze($studiengang->oe_kurzbz, $echter_dv);
+ if (isError($stundengrenze_result)) return $stundengrenze_result;
+
+ $stundengrenze = getData($stundengrenze_result)[0];
+
+ $oe_result = $this->_ci->OrganisationseinheitModel->getChilds($stundengrenze->oe_kurzbz);
+ $oe_array = hasData($oe_result) ? array_column(getData($oe_result), 'oe_kurzbz') : array('');
+
+ if ($alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
+ $this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($lehreinheit->semesterstunden) + {$this->_ci->LehreinheitmitarbeiterModel->db->escape($new_data['semesterstunden'])}) as summe");
+ else if ($alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
+ $this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($lehreinheit->semesterstunden)) as summe");
+ else if (!$alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
+ $this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) + ({$this->_ci->LehreinheitmitarbeiterModel->db->escape($new_data['semesterstunden'])})) as summe");
+ else if (!$alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
+ $this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden)) as summe");
+
+ $this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
+ $this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
+ $this->_ci->LehreinheitmitarbeiterModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
+
+ $this->_ci->LehreinheitmitarbeiterModel->db->where('mitarbeiter_uid', (isset($new_data['mitarbeiter_uid']) ? $new_data['mitarbeiter_uid'] : $mitarbeiter_uid));
+ $this->_ci->LehreinheitmitarbeiterModel->db->where('studiensemester_kurzbz', $lehreinheit->studiensemester_kurzbz);
+ $this->_ci->LehreinheitmitarbeiterModel->db->where('bismelden', true);
+ $this->_ci->LehreinheitmitarbeiterModel->db->where('lower(mitarbeiter_uid) NOT LIKE', '_dummy%');
+
+ $this->_ci->LehreinheitmitarbeiterModel->db->where_in('tbl_studiengang.oe_kurzbz', $oe_array);
+
+
+ if(defined('FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE')
+ && is_array(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE)
+ && count(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE) > 0)
+ {
+ $this->_ci->LehreinheitmitarbeiterModel->db->where_not_in('tbl_studiengang.oe_kurzbz', FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE);
+ }
+
+ $summe_result = $this->_ci->LehreinheitmitarbeiterModel->load();
+
+ if (isError($summe_result)) return $summe_result;
+
+ if (!hasData($summe_result)) return error('Fehler beim Ermitteln der Gesamtstunden');
+
+ $summe = getData($summe_result)[0]->summe;
+
+ if ($summe > $stundengrenze->stunden)
+ {
+
+ if (!$echter_dv && (!$this->_ci->permissionlib->isBerechtigt('admin')))
+ {
+ if (!$this->LehrauftragAufFirma(isset($formData['mitarbeiter_uid']) ? $formData['mitarbeiter_uid'] : $mitarbeiter_uid))
+ return error("ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden NICHT gespeichert!\n\n");
+ }
+ else
+ {
+ $warning .= "ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden gespeichert!\n\n";
+ }
+
+ $stunden_limit_result = $this->getStundenInstitut($mitarbeiter_uid, $lehreinheit->studiensemester_kurzbz, $oe_array);
+
+ if (hasData($stunden_limit_result))
+ {
+ $stunden_limit_array = getData($stunden_limit_result);
+ foreach ($stunden_limit_array as $stunden_limit)
+ {
+ $warning .= $stunden_limit->summe . ' Stunden ' . $stunden_limit->bezeichnung . "\n";
+ }
+ }
+ }
+ }
+ }
+
+ $benutzer_result = $this->_ci->BenutzerModel->load(array(isset($formData['mitarbeiter_uid']) ? $formData['mitarbeiter_uid'] : $mitarbeiter_uid));
+
+ if (isError($benutzer_result)) return $benutzer_result;
+
+ if (!hasData($benutzer_result)) return error('Benutzer not found');
+
+ $benutzer_aktiv = getData($benutzer_result)[0]->aktiv;
+
+ if (!$benutzer_aktiv)
+ $warning .= "Achtung: Der/Die Benutzer*in ist inaktiv!\nBitte informieren Sie die Personalbteilung.\nDaten wurden gespeichert.\n\n";
+
+ $updatableFields = array(
+ 'semesterstunden',
+ 'planstunden',
+ 'stundensatz',
+ 'faktor',
+ 'anmerkung',
+ 'lehrfunktion_kurzbz',
+ 'mitarbeiter_uid',
+ 'bismelden'
+ );
+
+ $updateData = array();
+ foreach ($updatableFields as $field)
+ {
+ $value = isset($new_data[$field]) ? $new_data[$field] : null;
+
+ if ($value !== null)
+ {
+ $updateData[$field] = $value;
+ }
+ }
+ $updateData['updatevon'] = getAuthUID();
+ $updateData['updateamum'] = date('Y-m-d H:i:s');
+
+ $result = $this->_ci->LehreinheitmitarbeiterModel->update(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid), $updateData);
+
+ if (isError($result)) return $result;
+
+ if ($warning !== '') return success(['warning' => $warning]);
+
+ return success('Erfolgreich geupdated');
+ }
+
+ private function getMaxStunden($mitarbeiter_uid, $studiensemester_kurzbz, $studiengang_kz, $echter_dv)
+ {
+ $maxstunden = 9999;
+
+ $studiengang_result = $this->_ci->StudiengangModel->loadWhere(array('studiengang_kz' => $studiengang_kz));
+ if (isError($studiengang_result)) return $studiengang_result;
+
+ $studiengang = getData($studiengang_result)[0];
+
+ $stundengrenze_result = $this->_ci->OrganisationseinheitModel->getStundengrenze($studiengang->oe_kurzbz, $echter_dv);
+ if (isError($stundengrenze_result)) return $stundengrenze_result;
+
+ $stundengrenze = getData($stundengrenze_result)[0];
+ $maxstunden = $stundengrenze->stunden;
+
+ $lehrauftrag_firma = $this->LehrauftragAufFirma($mitarbeiter_uid);
+
+ if (!$echter_dv && !$lehrauftrag_firma)
+ {
+ $oe_result = $this->_ci->OrganisationseinheitModel->getChilds($stundengrenze->oe_kurzbz);
+ $oe_array = hasData($oe_result) ? array_column(getData($oe_result), 'oe_kurzbz') : array('');
+
+ $stunden_summe_result = $this->getSumSemesterstunden($mitarbeiter_uid, $studiensemester_kurzbz, $oe_array);
+
+ $stunden_summe = hasData($stunden_summe_result) ? getData($stunden_summe_result)[0]->summe : 0;
+
+ if ($stunden_summe >= $maxstunden && (!$this->_ci->permissionlib->isBerechtigt('admin')))
+ {
+ $stunden_limit_result = $this->getStundenInstitut($mitarbeiter_uid, $studiensemester_kurzbz, $oe_array);
+
+ $error = "ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $maxstunden Stunden ($stundengrenze->oe_kurzbz) wurde ueberschritten!\n
+ Daten wurden NICHT gespeichert!\n\n";
+
+ if (hasData($stunden_limit_result))
+ {
+ $stunden_limit_array = getData($stunden_limit_result);
+
+ foreach ($stunden_limit_array as $stunden_limit)
+ {
+ $error .= $stunden_limit->summe . ' Stunden ' . $stunden_limit->bezeichnung . "\n";
+ }
+ }
+ return error($error);
+ }
+ else
+ $maxstunden =- $stunden_summe;
+ }
+ return $maxstunden;
+ }
+
+ private function LehrauftragAufFirma($mitarbeiter_uid)
+ {
+ $this->_ci->MitarbeiterModel->addJoin('tbl_benutzer', 'tbl_mitarbeiter.mitarbeiter_uid = tbl_benutzer.uid');
+ $this->_ci->MitarbeiterModel->addJoin('tbl_person', 'person_id');
+ $this->_ci->MitarbeiterModel->addJoin('tbl_adresse', 'person_id', 'LEFT');
+ $this->_ci->MitarbeiterModel->addOrder('zustelladresse', 'DESC');
+ $this->_ci->MitarbeiterModel->addOrder('firma_id');
+ $this->_ci->MitarbeiterModel->addLimit(1);
+ $firma_result = $this->_ci->MitarbeiterModel->loadWhere(array('mitarbeiter_uid' => $mitarbeiter_uid));
+ $firma = getData($firma_result)[0]->firma_id;
+ return !is_null($firma);
+ }
+
+ private function getSumSemesterstunden($mitarbeiter_uid, $studiensemester_kurzbz, $oe_array = array())
+ {
+ $this->_ci->LehreinheitmitarbeiterModel->addSelect('SUM(tbl_lehreinheitmitarbeiter.semesterstunden) as summe');
+ $this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
+ $this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
+ $this->_ci->LehreinheitmitarbeiterModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
+ $this->_ci->LehreinheitmitarbeiterModel->db->where('mitarbeiter_uid', $mitarbeiter_uid);
+ $this->_ci->LehreinheitmitarbeiterModel->db->where('studiensemester_kurzbz', $studiensemester_kurzbz);
+ $this->_ci->LehreinheitmitarbeiterModel->db->where('bismelden', true);
+ $this->_ci->LehreinheitmitarbeiterModel->db->where('lower(mitarbeiter_uid) NOT LIKE', '_dummy%');
+ $this->_ci->LehreinheitmitarbeiterModel->db->where_in('tbl_studiengang.oe_kurzbz', $oe_array);
+ return $this->_ci->LehreinheitmitarbeiterModel->load();
+ }
+
+ private function getStundenInstitut($mitarbeiter_uid, $studiensemester_kurzbz, $oe_array = array())
+ {
+ $this->_ci->LehreinheitmitarbeiterModel->addSelect('SUM(tbl_lehreinheitmitarbeiter.semesterstunden) as summe, tbl_studiengang.bezeichnung');
+ $this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
+ $this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
+ $this->_ci->LehreinheitmitarbeiterModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
+ $this->_ci->LehreinheitmitarbeiterModel->db->where('mitarbeiter_uid', $mitarbeiter_uid);
+ $this->_ci->LehreinheitmitarbeiterModel->db->where('studiensemester_kurzbz', $studiensemester_kurzbz);
+ $this->_ci->LehreinheitmitarbeiterModel->db->where('bismelden', true);
+ $this->_ci->LehreinheitmitarbeiterModel->db->where_in('tbl_studiengang.oe_kurzbz', $oe_array);
+
+ if(defined('FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE')
+ && is_array(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE)
+ && count(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE) > 0)
+ {
+ $this->_ci->LehreinheitmitarbeiterModel->db->where_not_in('tbl_studiengang.oe_kurzbz', FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE);
+ }
+
+ $this->_ci->LehreinheitmitarbeiterModel->addGroupBy('tbl_studiengang.bezeichnung');
+ return $this->_ci->LehreinheitmitarbeiterModel->load();
+ }
+}
diff --git a/application/libraries/ProfilLib.php b/application/libraries/ProfilLib.php
index 50b8bc264..97cb8ce5d 100644
--- a/application/libraries/ProfilLib.php
+++ b/application/libraries/ProfilLib.php
@@ -183,7 +183,10 @@ class ProfilLib{
$zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam ? current($zutrittskarte_ausgegebenam)->ausgegebenam : null;
//? formats date from 01-01-2000 to 01.01.2000
- $zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam);
+ if ($zutrittskarte_ausgegebenam !== NULL)
+ {
+ $zutrittskarte_ausgegebenam = (new DateTime($zutrittskarte_ausgegebenam))->format('d.m.Y');
+ }
return $zutrittskarte_ausgegebenam;
}
@@ -196,7 +199,7 @@ class ProfilLib{
private function getAdressenInfo($pid)
{
$this->ci->load->model("person/Adresse_model","AdresseModel");
- $adresse_res = $this->ci->AdresseModel->addSelect(["adresse_id", "strasse", "tbl_adressentyp.bezeichnung as typ", "plz", "ort", "zustelladresse", "gemeinde", "nation"]);
+ $adresse_res = $this->ci->AdresseModel->addSelect(["adresse_id", "strasse", "tbl_adressentyp.bezeichnung as typ", "plz", "ort", "heimatadresse", "zustelladresse", "gemeinde", "nation"]);
$adresse_res = $this->ci->AdresseModel->addOrder("zustelladresse", "DESC");
$adresse_res = $this->ci->AdresseModel->addJoin("tbl_adressentyp", "typ=adressentyp_kurzbz");
@@ -214,7 +217,7 @@ class ProfilLib{
* @param integer $uid the userID used to get the kontakt information
* @return array all the kontakt information corresponding to a userID
*/
- private function getKontaktInfo($pid)
+ private function getKontaktInfo($pid, $includehidden=false)
{
$this->ci->load->model("person/Kontakt_model","KontaktModel");
$this->ci->KontaktModel->addSelect(['kontakttyp', 'kontakt_id', 'kontakt', 'tbl_kontakt.anmerkung', 'tbl_kontakt.zustellung']);
@@ -222,7 +225,13 @@ class ProfilLib{
$this->ci->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT');
$this->ci->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum');
- $kontakte_res = $this->ci->KontaktModel->loadWhere(['person_id' => $pid]);
+ $params = array('person_id' => $pid);
+ if(!$includehidden)
+ {
+ $params['kontakttyp <>'] = 'hidden';
+ }
+
+ $kontakte_res = $this->ci->KontaktModel->loadWhere($params);
if(isError($kontakte_res)){
return error(getData($kontakte_res));
}
diff --git a/application/libraries/StundenplanLib.php b/application/libraries/StundenplanLib.php
index 6d53a2e2e..7ed64da2c 100644
--- a/application/libraries/StundenplanLib.php
+++ b/application/libraries/StundenplanLib.php
@@ -229,9 +229,10 @@ class StundenplanLib
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
$is_mitarbeiter = getData($this->_ci->MitarbeiterModel->isMitarbeiter(getAuthUID()));
-
- if ($is_mitarbeiter) {
- $reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz);
+
+ if ($is_mitarbeiter && empty($ort_kurzbz)) {
+ // request for personal lvplan show only reservations of logged in user
+ $reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date);
} else {
// querying the reservierungen
$reservierungen = $this->_ci->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz);
diff --git a/application/models/accounting/Vertrag_model.php b/application/models/accounting/Vertrag_model.php
index abc2114a6..c17c676c7 100644
--- a/application/models/accounting/Vertrag_model.php
+++ b/application/models/accounting/Vertrag_model.php
@@ -384,6 +384,60 @@ class Vertrag_model extends DB_Model
}
}
+ public function getVertrag($mitarbeiter_uid, $lehreinheit_id)
+ {
+ $this->addSelect('tbl_lehreinheitmitarbeiter.*, tbl_vertrag.*, status.bezeichnung as vertragsstatus, status.vertragsstatus_kurzbz');
+ $this->addJoin('lehre.tbl_lehreinheitmitarbeiter', 'vertrag_id');
+ $this->addJoin('lehre.tbl_vertragstyp', 'vertragstyp_kurzbz', 'LEFT');
+ $this->addJoin('
+ (
+ SELECT DISTINCT ON(vertrag_id) vertrag_id,
+ bezeichnung,
+ tbl_vertragsstatus.vertragsstatus_kurzbz
+ FROM lehre.tbl_vertrag_vertragsstatus
+ JOIN lehre.tbl_vertragsstatus USING(vertragsstatus_kurzbz)
+ ORDER BY vertrag_id, datum DESC
+ ) as status', 'status.vertrag_id = lehre.tbl_vertrag.vertrag_id', 'LEFT');
+
+ return $this->loadWhere(array('mitarbeiter_uid' => $mitarbeiter_uid, 'lehreinheit_id' => $lehreinheit_id));
+ }
+
+ public function cancelVertrag($vertrag_id, $mitarbeiter_uid)
+ {
+ $vertrag = $this->load($vertrag_id);
+
+ if (!hasData($vertrag))
+ return error("Contract not found");
+
+ $vertrag = getData($vertrag)[0];
+
+ $this->_updateVertragRelevant($vertrag->vertrag_id);
+
+ return $this->VertragvertragsstatusModel->insert(array(
+ 'vertrag_id' => $vertrag->vertrag_id,
+ 'vertragsstatus_kurzbz' => 'storno',
+ 'uid' => $mitarbeiter_uid,
+ 'datum' => 'NOW()',
+ 'insertamum' => 'NOW()',
+ 'insertvon' => getAuthUID()
+ ));
+ }
+
+ public function deleteVertrag($vertrag_id)
+ {
+ $vertrag = $this->load($vertrag_id);
+
+ if (!hasData($vertrag))
+ return error("Contract not found");
+
+ $vertrag = getData($vertrag)[0];
+
+ $this->_updateVertragRelevant($vertrag->vertrag_id);
+
+ $this->VertragvertragsstatusModel->delete(array('vertrag_id' => $vertrag->vertrag_id));
+ return $this->delete(array('vertrag_id' => $vertrag->vertrag_id));
+ }
+
// -----------------------------------------------------------------------------------------------------------------
// Private methods
@@ -415,4 +469,20 @@ class Vertrag_model extends DB_Model
return $bezeichnung;
}
+
+ private function _updateVertragRelevant($vertrag_id)
+ {
+ $this->LehreinheitmitarbeiterModel->update(
+ array("vertrag_id" => $vertrag_id),
+ array(
+ 'vertrag_id' => null
+ )
+ );
+ $this->ProjektbetreuerModel->update(
+ array("vertrag_id" => $vertrag_id),
+ array(
+ 'vertrag_id' => null
+ )
+ );
+ }
}
diff --git a/application/models/education/Lehreinheit_model.php b/application/models/education/Lehreinheit_model.php
index fadb7e113..e52af4cba 100644
--- a/application/models/education/Lehreinheit_model.php
+++ b/application/models/education/Lehreinheit_model.php
@@ -1,4 +1,6 @@
load->model('education/lehreinheitgruppe_model', 'LehreinheitgruppeModel');
$this->load->model('education/lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel');
$this->load->model('organisation/studiengang_model', 'StudiengangModel');
+ $this->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
+ $this->load->model('ressource/stundenplan_model', 'StundenplanModel');
+ $this->load->model('system/Log_model', 'LogModel');
}
/**
@@ -308,4 +313,424 @@ EOSQL;
return $this->execQuery($query, $params);
}
+
+
+ public function getOes($lehreinheit_id)
+ {
+ $this->addSelect('tbl_lehrveranstaltung.studiengang_kz,
+ tbl_lehrveranstaltung.lehrveranstaltung_id');
+ $this->addJoin('lehre.tbl_lehrveranstaltung', 'tbl_lehrveranstaltung.lehrveranstaltung_id = tbl_lehreinheit.lehrveranstaltung_id');
+ $result = $this->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
+
+ if (isError($result)) return $result;
+
+ if (hasData($result))
+ {
+ $lehrveranstaltung = getData($result)[0];
+ $oe_result = $this->LehrveranstaltungModel->getAllOe($lehrveranstaltung->lehrveranstaltung_id);
+ return success(hasData($oe_result) ? array_column(getData($oe_result), 'oe_kurzbz') : array(''));
+ }
+ }
+
+ public function getLehrfachOe($lehreinheit_id)
+ {
+ $this->addSelect('lehrfach.oe_kurzbz');
+ $this->addJoin('lehre.tbl_lehrveranstaltung lehrfach', 'lehrfach.lehrveranstaltung_id = tbl_lehreinheit.lehrfach_id', 'LEFT');
+ return $this->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
+ }
+
+
+ public function getByLvidStudiensemester($lv_id, $studiensemester_kurzbz, $mitarbeiter_uid = null, $fachbereich_kurzbz = null)
+ {
+ $qry = "WITH lehreinheiten AS (
+ SELECT *
+ FROM lehre.tbl_lehreinheit
+ WHERE lehrveranstaltung_id = ?
+ AND studiensemester_kurzbz = ?
+ ),
+ ". $this->_getGruppenCTE() . ",
+ ". $this->_getLektorenCTE() . ",
+ ". $this->_getFachbereichCTE() . ",
+ ". $this->_getTagsCTE() . "
+
+ SELECT lehreinheiten.*,
+ lehreinheiten.lehrform_kurzbz as lv_lehrform_kurzbz,
+ tbl_lehrveranstaltung.kurzbz as lv_kurzbz,
+ tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
+ COALESCE(tag_data_agg.tags, '[]'::json) AS tags,
+ gruppen.gruppen,
+ mitarbeiter.lektoren,
+ mitarbeiter.le_planstunden,
+ mitarbeiter.vorname,
+ mitarbeiter.nachname,
+ mitarbeiter.semesterstunden,
+ fachbereich.bezeichnung as fachbereich,
+ UPPER(CONCAT(tbl_studiengang.typ,tbl_studiengang.kurzbz)) as studiengang,
+ semester
+ FROM lehreinheiten
+ LEFT JOIN lehre.tbl_lehrveranstaltung ON tbl_lehrveranstaltung.lehrveranstaltung_id = lehreinheiten.lehrfach_id
+ LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
+ LEFT JOIN tag_data_agg ON tag_data_agg.lehreinheit_id = lehreinheiten.lehreinheit_id
+ LEFT JOIN mitarbeiter ON lehreinheiten.lehreinheit_id = mitarbeiter.lehreinheit_id
+ LEFT JOIN fachbereich ON lehreinheiten.lehreinheit_id = fachbereich.lehreinheit_id
+ LEFT JOIN gruppen ON lehreinheiten.lehreinheit_id = gruppen.lehreinheit_id
+ WHERE true
+ ";
+
+ $params = array($lv_id, $studiensemester_kurzbz);
+
+ if ($mitarbeiter_uid !== null)
+ {
+ $qry .= " AND lehreinheiten.lehreinheit_id IN ( SELECT lehreinheit_id FROM lehre.tbl_lehreinheitmitarbeiter WHERE mitarbeiter_uid = ?) ";
+ $params[] = $mitarbeiter_uid;
+ }
+
+ if($fachbereich_kurzbz !== null)
+ {
+ $qry .= " AND EXISTS ( SELECT 1 FROM lehre.tbl_lehrveranstaltung JOIN public.tbl_fachbereich USING(oe_kurzbz) WHERE fachbereich_kurzbz= ? AND lehrveranstaltung_id=lehreinheiten.lehrfach_id)";
+ $params[] = $fachbereich_kurzbz;
+ }
+ $qry .= " ORDER BY lehrveranstaltung_id;";
+
+ return $this->execReadOnlyQuery($qry, $params);
+ }
+
+ private function getLVTmp($stg_kz = null)
+ {
+ $qry = "SELECT DISTINCT ON(lehrveranstaltung_id) *,
+ '' as stundenblockung,
+ '' as lehreinheit_id,
+ '' as wochenrythmus,
+ '' as raumtyp,
+ '' as raumtypalternativ,
+ '' as gruppen,
+ '' as studienplan_id,
+ '' as studienplan_beeichnung,
+ UPPER(CONCAT(vw_lehreinheit.stg_typ, vw_lehreinheit.stg_kurzbz)) as studiengang
+ FROM campus.vw_lehreinheit
+ WHERE mitarbeiter_uid = ?
+ AND studiensemester_kurzbz = ?";
+
+ if (!is_null($stg_kz)) {
+ $qry .= " AND lv_studiengang_kz = ?";
+ }
+
+ return $qry;
+ }
+
+ public function getLvsByEmployee($mitarbeiter_uid, $studiensemester_kurzbz, $stg_kz = null)
+ {
+ $qry = "WITH lvs AS (" . $this->getLVTmp($stg_kz) . ")
+ SELECT lvs.*
+ FROM lvs
+ ";
+
+ $params = array($mitarbeiter_uid, $studiensemester_kurzbz);
+ if (!is_null($stg_kz))
+ {
+ $params[] = $stg_kz;
+ }
+ return $this->execReadOnlyQuery($qry, $params);
+ }
+
+ public function deleteLehreinheit($lehreinheit_id)
+ {
+ $lehreinheit = $this->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
+
+ if (isError($lehreinheit)) return $lehreinheit;
+
+ if (!hasData($lehreinheit))
+ return error("Lehreinheit not found!");
+
+ $errorReasons = [];
+ $addError = function ($reason = null) use (&$errorReasons)
+ {
+ if ($reason !== null)
+ {
+ $errorReasons[] = $reason;
+ }
+ };
+
+ $stundenplandev_result = $this->StundenplandevModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
+ $stundenplan_result = $this->StundenplanModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
+
+ if (hasData($stundenplan_result) || hasData($stundenplandev_result))
+ $addError('Dieser LV-Teil ist bereits im LV-Plan verplant und kann daher nicht geloescht werden!');
+
+ Events::trigger(
+ 'lehreinheit_delete_check',
+ $addError,
+ $lehreinheit_id
+ );
+
+ if (!empty($errorReasons)) return error($errorReasons);
+
+ $this->db->trans_begin();
+
+ Events::trigger(
+ 'lehreinheit_delete',
+ $addError,
+ $lehreinheit_id
+ );
+
+ $undosql = '';
+
+ $lehreinheit_gruppe_result = $this->LehreinheitgruppeModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
+ if (hasData($lehreinheit_gruppe_result))
+ {
+ foreach (getData($lehreinheit_gruppe_result) as $row)
+ {
+ $values = [
+ $this->db->escape($row->lehreinheitgruppe_id),
+ $this->db->escape($row->lehreinheit_id),
+ $this->db->escape($row->studiengang_kz),
+ $this->db->escape($row->semester),
+ $this->db->escape($row->verband),
+ $this->db->escape($row->gruppe),
+ $this->db->escape($row->gruppe_kurzbz),
+ $this->db->escape($row->updateamum),
+ $this->db->escape($row->updatevon),
+ $this->db->escape($row->insertamum),
+ $this->db->escape($row->insertvon)
+ ];
+
+ $undosql .= "INSERT INTO lehre.tbl_lehreinheitgruppe (
+ lehreinheitgruppe_id,
+ lehreinheit_id,
+ studiengang_kz,
+ semester,
+ verband,
+ gruppe,
+ gruppe_kurzbz,
+ updateamum,
+ updatevon,
+ insertamum,
+ insertvon
+ ) VALUES (" . implode(', ', $values) . ");\n";
+ }
+
+ $lehreinheit_gruppe_delete_result = $this->LehreinheitgruppeModel->delete(array('lehreinheit_id' => $lehreinheit_id));
+
+ if (isError($lehreinheit_gruppe_delete_result))
+ $addError(getError($lehreinheit_gruppe_delete_result));
+ }
+
+ $lehreinheit_mitarbeiter_result = $this->LehreinheitmitarbeiterModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
+ if (hasData($lehreinheit_mitarbeiter_result))
+ {
+ foreach (getData($lehreinheit_mitarbeiter_result) as $row)
+ {
+ $values = [
+ $this->db->escape($row->lehreinheit_id),
+ $this->db->escape($row->mitarbeiter_uid),
+ $this->db->escape($row->lehrfunktion_kurzbz),
+ $this->db->escape($row->planstunden),
+ $this->db->escape($row->stundensatz),
+ $this->db->escape($row->faktor),
+ $this->db->escape($row->anmerkung),
+ $this->db->escape($row->bismelden),
+ $this->db->escape($row->updateamum),
+ $this->db->escape($row->updatevon),
+ $this->db->escape($row->insertamum),
+ $this->db->escape($row->insertvon),
+ $this->db->escape($row->semesterstunden)
+ ];
+
+ $undosql .= "INSERT INTO lehre.tbl_lehreinheitmitarbeiter (
+ lehreinheit_id,
+ mitarbeiter_uid,
+ lehrfunktion_kurzbz,
+ planstunden,
+ stundensatz,
+ faktor,
+ anmerkung,
+ bismelden,
+ updateamum,
+ updatevon,
+ insertamum,
+ insertvon,
+ semesterstunden
+ ) VALUES (" . implode(', ', $values) . ");\n";
+ }
+
+ $lehreinheit_mitarbeiter_delete_result = $this->LehreinheitmitarbeiterModel->delete(array('lehreinheit_id' => $lehreinheit_id));
+ if (isError($lehreinheit_mitarbeiter_delete_result))
+ $addError(getError($lehreinheit_mitarbeiter_delete_result));
+ }
+
+ foreach (getData($lehreinheit) as $row)
+ {
+ $values = [
+ $this->db->escape($row->lehreinheit_id),
+ $this->db->escape($row->lehrveranstaltung_id),
+ $this->db->escape($row->studiensemester_kurzbz),
+ $this->db->escape($row->lehrfach_id),
+ $this->db->escape($row->lehrform_kurzbz),
+ $this->db->escape($row->stundenblockung),
+ $this->db->escape($row->wochenrythmus),
+ $this->db->escape($row->start_kw),
+ $this->db->escape($row->raumtyp),
+ $this->db->escape($row->raumtypalternativ),
+ $this->db->escape($row->sprache),
+ $this->db->escape($row->lehre),
+ $this->db->escape($row->anmerkung),
+ $this->db->escape($row->unr),
+ $this->db->escape($row->lvnr),
+ $this->db->escape($row->updateamum),
+ $this->db->escape($row->updatevon),
+ $this->db->escape($row->insertamum),
+ $this->db->escape($row->insertvon),
+ ];
+
+ $undosql .= "INSERT INTO lehre.tbl_lehreinheit (
+ lehreinheit_id,
+ lehrveranstaltung_id,
+ studiensemester_kurzbz,
+ lehrfach_id,
+ lehrform_kurzbz,
+ stundenblockung,
+ wochenrythmus,
+ start_kw,
+ raumtyp,
+ raumtypalternativ,
+ sprache,
+ lehre,
+ anmerkung,
+ unr,
+ lvnr,
+ updateamum,
+ updatevon,
+ insertamum,
+ insertvon
+ ) VALUES (" . implode(', ', $values) . ");\n";
+ }
+ $lehreinheit_result = $this->delete($lehreinheit_id);
+
+ $deleteSql = "DELETE FROM lehre.tbl_lehreinheitmitarbeiter WHERE lehreinheit_id = " . $this->db->escape($lehreinheit_id) ."; \n
+ DELETE FROM lehre.tbl_lehreinheitgruppe WHERE lehreinheit_id = " . $this->db->escape($lehreinheit_id) ."; \n
+ DELETE FROM lehre.tbl_lehreinheit WHERE lehreinheit_id = " . $this->db->escape($lehreinheit_id) .";";
+ if (isError($lehreinheit_result))
+ $addError($lehreinheit_result);
+
+ $log_result = $this->LogModel->insert([
+ 'sql' => $deleteSql,
+ 'sqlundo' => $undosql,
+ 'beschreibung' => 'Lehreinheit loeschen - ' . $lehreinheit_id,
+ 'mitarbeiter_uid' => getAuthUID(),
+ ]);
+
+ if (isError($log_result))
+ $addError($log_result);
+
+ if (!empty($errorReasons))
+ {
+ $this->db->trans_rollback();
+ return error($errorReasons);
+ }
+
+ $this->db->trans_commit();
+ return success('Contract successfully updated.');
+ }
+
+ private function _getGruppenCTE()
+ {
+ return "gruppen AS (
+ SELECT
+ lehreinheit_id,
+ STRING_AGG(
+ CASE
+ WHEN (tbl_lehreinheitgruppe.gruppe_kurzbz IS NULL OR tbl_lehreinheitgruppe.gruppe_kurzbz = '')
+ THEN
+ UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) ||
+ COALESCE(TRIM(tbl_lehreinheitgruppe.semester::text), '') ||
+ COALESCE(TRIM(tbl_lehreinheitgruppe.verband), '') ||
+ COALESCE(TRIM(tbl_lehreinheitgruppe.gruppe), '')
+ ELSE
+ CASE
+ WHEN NOT tbl_gruppe.direktinskription THEN tbl_lehreinheitgruppe.gruppe_kurzbz
+ ELSE NULL
+ END
+ END,
+ ' '
+ ) AS gruppen
+ FROM lehre.tbl_lehreinheitgruppe
+ LEFT JOIN public.tbl_studiengang USING (studiengang_kz)
+ LEFT JOIN public.tbl_gruppe USING (gruppe_kurzbz)
+ JOIN lehreinheiten USING(lehreinheit_id)
+ GROUP BY lehreinheit_id
+ )";
+ }
+ private function _getLektorenCTE()
+ {
+ return "mitarbeiter AS (
+ SELECT
+ tbl_lehreinheitmitarbeiter.lehreinheit_id,
+ STRING_AGG(m.kurzbz, ' ') AS lektoren,
+ STRING_AGG(tbl_person.vorname, ' ') AS vorname,
+ STRING_AGG(tbl_person.nachname, ' ') AS nachname,
+ STRING_AGG(tbl_lehreinheitmitarbeiter.semesterstunden::text, ' ') AS semesterstunden,
+ STRING_AGG(tbl_lehreinheitmitarbeiter.planstunden::text, ' ') AS le_planstunden
+ FROM lehre.tbl_lehreinheitmitarbeiter
+ JOIN public.tbl_mitarbeiter m USING (mitarbeiter_uid)
+ JOIN lehreinheiten USING(lehreinheit_id)
+ JOIN public.tbl_benutzer ON mitarbeiter_uid = uid
+ JOIN public.tbl_person ON tbl_benutzer.person_id = tbl_person.person_id
+ GROUP BY tbl_lehreinheitmitarbeiter.lehreinheit_id
+ )";
+ }
+
+ private function _getFachbereichCTE()
+ {
+ return "fachbereich AS (
+ SELECT
+ CONCAT(tbl_organisationseinheit.bezeichnung, ' (', tbl_organisationseinheit.organisationseinheittyp_kurzbz, ')') as bezeichnung,
+ lehreinheiten.lehreinheit_id
+ FROM public.tbl_organisationseinheit
+ JOIN lehre.tbl_lehrveranstaltung AS lehrfach ON tbl_organisationseinheit.oe_kurzbz = lehrfach.oe_kurzbz
+ JOIN lehre.tbl_lehreinheit ON lehrfach.lehrveranstaltung_id = tbl_lehreinheit.lehrfach_id
+ JOIN lehreinheiten ON tbl_lehreinheit.lehreinheit_id = lehreinheiten.lehreinheit_id
+ )";
+ }
+
+ private function _getTagsCTE()
+ {
+ $this->load->config('lvverwaltung');
+ $tags = $this->config->item('tags');
+
+ $whereTags = '';
+ if (is_array($tags) && !isEmptyArray($tags))
+ {
+ $tags = array_keys($tags);
+
+ foreach ($tags as $key => $tag)
+ {
+ $tags[$key] = $this->db->escape($tag);
+ }
+
+ $whereTags = " AND tbl_notiz_typ.typ_kurzbz IN (" . implode(",", $tags) . ")";
+ }
+
+ return "tag_data_agg AS (
+ SELECT
+ lehreinheit_id,
+ COALESCE(json_agg(tag ORDER BY done), '[]'::json) AS tags
+ FROM (
+ SELECT DISTINCT ON (public.tbl_notiz.notiz_id)
+ tbl_notiz.notiz_id AS id,
+ typ_kurzbz,
+ array_to_json(tbl_notiz_typ.bezeichnung_mehrsprachig)->>0 AS beschreibung,
+ text AS notiz,
+ style,
+ erledigt AS done,
+ lehreinheit_id
+ FROM public.tbl_notizzuordnung
+ JOIN public.tbl_notiz ON tbl_notizzuordnung.notiz_id = tbl_notiz.notiz_id
+ JOIN public.tbl_notiz_typ ON tbl_notiz.typ = tbl_notiz_typ.typ_kurzbz
+ WHERE lehreinheit_id IN (SELECT lehreinheit_id FROM lehreinheiten)"
+ . $whereTags.
+ ") AS tag
+ GROUP BY lehreinheit_id
+ )";
+ }
+
}
diff --git a/application/models/education/Lehreinheitgruppe_model.php b/application/models/education/Lehreinheitgruppe_model.php
index 2a6f9571a..bca395f31 100644
--- a/application/models/education/Lehreinheitgruppe_model.php
+++ b/application/models/education/Lehreinheitgruppe_model.php
@@ -14,6 +14,7 @@ class Lehreinheitgruppe_model extends DB_Model
$this->load->model('organisation/studiengang_model', 'StudiengangModel');
$this->load->model('organisation/gruppe_model', 'GruppeModel');
$this->load->model('person/benutzergruppe_model', 'BenutzergruppeModel');
+ $this->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
}
/**
@@ -23,7 +24,15 @@ class Lehreinheitgruppe_model extends DB_Model
*/
public function getDirectGroup($lehreinheit_id)
{
+ $this->addSelect('tbl_lehreinheitgruppe.*');
+ $this->addSelect('tbl_gruppe.*');
+ $this->addSelect('uid');
+ $this->addSelect('vorname');
+ $this->addSelect('nachname');
$this->addJoin('public.tbl_gruppe', 'gruppe_kurzbz');
+ $this->addJoin('public.tbl_benutzergruppe', 'gruppe_kurzbz', 'LEFT');
+ $this->addJoin('public.tbl_benutzer', 'uid', 'LEFT');
+ $this->addJoin('public.tbl_person', 'person_id', 'LEFT');
return $this->loadWhere(
array(
'tbl_gruppe.direktinskription' => true,
@@ -264,4 +273,209 @@ class Lehreinheitgruppe_model extends DB_Model
}
return $result;
}
+
+ public function addGroup($lehreinheit_id, $gid, $verband)
+ {
+ $lehreinheit = $this->LehreinheitModel->load($lehreinheit_id);
+
+ if (!hasData($lehreinheit))
+ return error ('No Lehreinheit found!');
+
+ if ($verband === false)
+ {
+ $gruppen_result = $this->GruppeModel->loadWhere(array('gid' => $gid));
+
+ if (!hasData($gruppen_result))
+ return error('No group found for gid ' . $gid);
+
+ $gruppen_array = getData($gruppen_result)[0];
+
+ if (!isEmptyString($gruppen_array->gruppe_kurzbz))
+ {
+ $this->db->where('trim(gruppe_kurzbz)', $gruppen_array->gruppe_kurzbz);
+ }
+ else
+ {
+ $this->db->group_start();
+ $this->db->where("trim(gruppe_kurzbz) = ''");
+ $this->db->or_where("gruppe_kurzbz IS NULL");
+ $this->db->group_end();
+ }
+ }
+ else if ($verband === true)
+ {
+ $gruppen_result = $this->LehrverbandModel->loadWhere(array('gid' => $gid));
+
+ if (!hasData($gruppen_result))
+ return error('No group found for gid ' . $gid);
+
+ $gruppen_array = getData($gruppen_result)[0];
+
+ if (!isEmptyString($gruppen_array->verband))
+ {
+ $this->db->where('verband', $gruppen_array->verband);
+ }
+ else
+ {
+ $this->db->group_start();
+ $this->db->where("trim(verband) = ''");
+ $this->db->or_where("verband IS NULL");
+ $this->db->group_end();
+ }
+
+ if (!isEmptyString($gruppen_array->gruppe))
+ {
+ $this->db->where('gruppe', $gruppen_array->gruppe);
+ }
+ else
+ {
+ $this->db->group_start();
+ $this->db->where("trim(gruppe) = ''");
+ $this->db->or_where("gruppe IS NULL");
+ $this->db->group_end();
+ }
+ }
+ else
+ return error('Wrong type of verband');
+
+ $this->db->where('lehreinheit_id', $lehreinheit_id);
+ $this->db->where('studiengang_kz', $gruppen_array->studiengang_kz);
+
+ if (!isEmptyString($gruppen_array->semester))
+ {
+ $this->db->where('semester', $gruppen_array->semester);
+ }
+ else
+ {
+ $this->db->group_start();
+ $this->db->where("semester = ''");
+ $this->db->or_where("semester IS NULL");
+ $this->db->group_end();
+ }
+
+ $exist_result = $this->load();
+
+ if (!hasData($exist_result))
+ {
+ $new_group_result = $this->insert(array(
+ 'lehreinheit_id' => $lehreinheit_id,
+ 'studiengang_kz' => $gruppen_array->studiengang_kz,
+ 'gruppe_kurzbz' => isset($gruppen_array->gruppe_kurzbz) ? $gruppen_array->gruppe_kurzbz : null,
+ 'semester' => $gruppen_array->semester,
+ 'verband' => isset($gruppen_array->verband) && !isEmptyString($gruppen_array->verband) ? $gruppen_array->verband : null,
+ 'gruppe' => isset($gruppen_array->gruppe) && !isEmptyString($gruppen_array->gruppe) ? $gruppen_array->gruppe : null,
+ 'insertamum' => date('Y-m-d H:i:s'),
+ 'insertvon' => getAuthUID()
+ ));
+
+ if (isError($new_group_result))
+ return error('Error when adding Group');
+
+ return success('Group assigned successfully to Lehreinheit');
+ }
+ else
+ return error('Group already assigned');
+ }
+
+ public function deleteGroup($lehreinheit_id, $lehreinheitgruppe_id)
+ {
+ $lehreinheit = $this->LehreinheitModel->load($lehreinheit_id);
+
+ if (!hasData($lehreinheit))
+ return error ('No Lehreinheit found!');
+
+ $lehreinheitgruppe = $this->load($lehreinheitgruppe_id);
+
+ if (!hasData($lehreinheitgruppe))
+ return error ('No Lehreinheitgruppe found!');
+
+ $this->addSelect('stundenplandev_id');
+ $this->addJoin('lehre.tbl_stundenplandev',
+ "tbl_stundenplandev.lehreinheit_id = tbl_lehreinheitgruppe.lehreinheit_id
+ AND tbl_stundenplandev.studiengang_kz = tbl_lehreinheitgruppe.studiengang_kz
+ AND tbl_stundenplandev.semester = tbl_lehreinheitgruppe.semester
+ AND trim(COALESCE(tbl_stundenplandev.verband, '')) = trim(COALESCE(tbl_lehreinheitgruppe.verband, ''))
+ AND trim(COALESCE(tbl_stundenplandev.gruppe, '')) = trim(COALESCE(tbl_lehreinheitgruppe.gruppe, ''))
+ AND trim(COALESCE(tbl_stundenplandev.gruppe_kurzbz, '')) = trim(COALESCE(tbl_lehreinheitgruppe.gruppe_kurzbz, ''))"
+ );
+ $stundenplan_result = $this->loadWhere(array('tbl_lehreinheitgruppe.lehreinheitgruppe_id' => $lehreinheitgruppe_id));
+
+ if (hasData($stundenplan_result))
+ return error('Gruppe already verplant');
+
+ $delete_result = $this->delete($lehreinheitgruppe_id);
+
+ if (isError($delete_result))
+ return error('Error deleting Group');
+
+ return success('Group deleted');
+ }
+
+ public function getByLehreinheit($lehreinheit_id)
+ {
+ $lehreinheit = $this->LehreinheitModel->load($lehreinheit_id);
+
+ if (!hasData($lehreinheit))
+ return error ('No Lehreinheit found!');
+
+ $this->addSelect('tbl_lehreinheitgruppe.*');
+ $this->addSelect('tbl_gruppe.direktinskription');
+ $this->addSelect('tbl_gruppe.gruppe_kurzbz');
+ $this->addSelect("CASE
+ WHEN tbl_lehreinheitgruppe.gruppe_kurzbz IS NULL THEN
+ COALESCE (
+ UPPER(tbl_studiengang.typ || tbl_studiengang.kurzbz) ||
+ COALESCE(tbl_lehreinheitgruppe.semester::varchar, '') ||
+ COALESCE(tbl_lehreinheitgruppe.verband::varchar, '') ||
+ COALESCE(tbl_lehreinheitgruppe.gruppe, ''),
+ '')
+ ELSE tbl_lehreinheitgruppe.gruppe_kurzbz
+ END AS bezeichnung");
+ $this->addSelect("CASE
+ WHEN tbl_lehreinheitgruppe.gruppe_kurzbz IS NULL THEN
+ (
+ SELECT bezeichnung
+ FROM public.tbl_lehrverband
+ WHERE studiengang_kz = tbl_lehreinheitgruppe.studiengang_kz
+ AND semester = tbl_lehreinheitgruppe.semester
+ AND verband = tbl_lehreinheitgruppe.verband
+ AND gruppe = tbl_lehreinheitgruppe.gruppe
+ LIMIT 1
+ )
+ ELSE tbl_gruppe.beschreibung
+ END AS beschreibung");
+ $this->addSelect("CASE
+ WHEN tbl_lehreinheitgruppe.gruppe_kurzbz IS NULL THEN
+ (
+ SELECT EXISTS (
+ SELECT 1
+ FROM lehre.tbl_stundenplandev
+ WHERE lehreinheit_id = tbl_lehreinheitgruppe.lehreinheit_id
+ AND studiengang_kz = tbl_lehreinheitgruppe.studiengang_kz
+ AND semester = tbl_lehreinheitgruppe.semester
+ AND TRIM(COALESCE(verband, '')) = TRIM(tbl_lehreinheitgruppe.verband)
+ AND TRIM(COALESCE(gruppe, '')) = TRIM(tbl_lehreinheitgruppe.gruppe)
+ AND (gruppe_kurzbz IS NULL OR gruppe_kurzbz = '')
+ )
+ )
+ ELSE
+ (
+ SELECT EXISTS (
+ SELECT 1
+ FROM lehre.tbl_stundenplandev
+ WHERE lehreinheit_id = tbl_lehreinheitgruppe.lehreinheit_id
+ AND gruppe_kurzbz = tbl_lehreinheitgruppe.gruppe_kurzbz
+ )
+ )
+ END AS verplant");
+ $this->addJoin('tbl_studiengang', 'studiengang_kz', 'LEFT');
+ $this->addJoin('public.tbl_gruppe', 'gruppe_kurzbz', 'LEFT');
+
+ $this->db->where('lehreinheit_id', $lehreinheit_id);
+ $this->db->group_start()
+ ->where('tbl_gruppe.direktinskription !=', true)
+ ->or_where('tbl_gruppe.direktinskription IS NULL')
+ ->group_end();
+ return $this->load();
+ }
}
diff --git a/application/models/education/Lehreinheitmitarbeiter_model.php b/application/models/education/Lehreinheitmitarbeiter_model.php
index ae1ac55d2..efdb2e74d 100644
--- a/application/models/education/Lehreinheitmitarbeiter_model.php
+++ b/application/models/education/Lehreinheitmitarbeiter_model.php
@@ -10,6 +10,14 @@ class Lehreinheitmitarbeiter_model extends DB_Model
parent::__construct();
$this->dbTable = 'lehre.tbl_lehreinheitmitarbeiter';
$this->pk = array('mitarbeiter_uid', 'lehreinheit_id');
+ $this->hasSequence = false;
+
+ $this->load->model('accounting/Vertrag_model', 'VertragModel');
+ $this->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
+ $this->load->model('ressource/stundenplan_model', 'StundenplanModel');
+ $this->load->model('organisation/Studiengang_model', 'StudiengangModel');
+ $this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
+ $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
}
/**
@@ -75,4 +83,67 @@ class Lehreinheitmitarbeiter_model extends DB_Model
]);
}
+ public function getLektorenByLe($lehreinheit_id)
+ {
+ $this->addSelect('vorname, nachname, tbl_lehreinheitmitarbeiter.*, stundenplan.verplant');
+ $this->addJoin('tbl_benutzer', 'uid = mitarbeiter_uid');
+ $this->addJoin('tbl_person', 'person_id');
+
+ $this->addJoin('(
+ SELECT 1 as verplant, lehreinheit_id, mitarbeiter_uid
+ FROM lehre.tbl_stundenplandev
+ GROUP BY lehreinheit_id, mitarbeiter_uid
+
+ ) stundenplan', 'stundenplan.mitarbeiter_uid = tbl_lehreinheitmitarbeiter.mitarbeiter_uid AND stundenplan.lehreinheit_id = tbl_lehreinheitmitarbeiter.lehreinheit_id', 'LEFT');
+
+ return $this->loadWhere(array('tbl_lehreinheitmitarbeiter.lehreinheit_id' => $lehreinheit_id));
+ }
+
+ public function getByLeLektor($lehreinheit_id, $mitarbeiter_uid)
+ {
+ $this->addSelect('vorname, nachname, tbl_lehreinheitmitarbeiter.*');
+ $this->addJoin('tbl_benutzer', 'uid = mitarbeiter_uid');
+ $this->addJoin('tbl_person', 'person_id');
+ return $this->loadWhere(array('tbl_lehreinheitmitarbeiter.lehreinheit_id' => $lehreinheit_id, 'tbl_lehreinheitmitarbeiter.mitarbeiter_uid' => $mitarbeiter_uid));
+ }
+
+ public function deleteLektorFromLe($lehreinheit_id, $mitarbeiter_uid)
+ {
+ if (defined('FAS_LV_LEKTORINNENZUTEILUNG_VERTRAGSDETAILS_ANZEIGEN') && FAS_LV_LEKTORINNENZUTEILUNG_VERTRAGSDETAILS_ANZEIGEN)
+ {
+ $vertrag_result = $this->VertragModel->getVertrag($mitarbeiter_uid, $lehreinheit_id);
+
+ if (hasData($vertrag_result))
+ return error("Loeschen nur nach Stornierung des Vertrags möglich");
+ }
+
+ $stundenplandev_result = $this->StundenplandevModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
+ $stundenplan_result = $this->StundenplanModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
+
+ if (hasData($stundenplandev_result) || hasData($stundenplan_result))
+ return error("Diese/r LektorIn kann nicht gelöscht werden da er schon verplant ist");
+
+ $result = $this->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
+
+ if (hasData($result))
+ {
+ $le_mitarbeiter_array = getData($result)[0];
+
+ if ($le_mitarbeiter_array->vertrag_id !== null)
+ {
+ $vertrag_result = $this->VertragModel->deleteVertrag($le_mitarbeiter_array->vertrag_id);
+ if (isError($vertrag_result))
+ return $vertrag_result;
+ }
+
+ $delete_result = $this->delete(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
+
+ if (isError($delete_result))
+ return $delete_result;
+
+ return success($delete_result);
+ }
+ }
+
+
}
diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php
index 3eb4d33a2..1b3b9e9d7 100644
--- a/application/models/education/Lehrveranstaltung_model.php
+++ b/application/models/education/Lehrveranstaltung_model.php
@@ -1019,4 +1019,240 @@ class Lehrveranstaltung_model extends DB_Model
return $this->execQuery($qry, $params);
}
+
+ public function getLvsByOrganization($oe_kurzbz)
+ {
+ $qry="
+ SELECT
+ distinct on (lehrveranstaltung_id)
+ tbl_lehrveranstaltung.studiengang_kz as lv_studiengang_kz, tbl_lehrveranstaltung.semester as lv_semester,
+ tbl_lehrveranstaltung.kurzbz as lv_kurzbz, tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung, tbl_lehrveranstaltung.ects as lv_ects,
+ tbl_lehrveranstaltung.lehreverzeichnis as lv_lehreverzeichnis, tbl_lehrveranstaltung.planfaktor as lv_planfaktor,
+ tbl_lehrveranstaltung.planlektoren as lv_planlektoren, tbl_lehrveranstaltung.planpersonalkosten as lv_planpersonalkosten,
+ tbl_lehrveranstaltung.plankostenprolektor as lv_plankostenprolektor, tbl_lehrveranstaltung.orgform_kurzbz as lv_orgform_kurzbz,
+ tbl_lehrveranstaltung.lehrveranstaltung_id,
+ tbl_lehrveranstaltung.lehrform_kurzbz as lehrform_kurzbz,
+ tbl_lehrveranstaltung.lehrform_kurzbz as lv_lehrform_kurzbz,
+ tbl_lehrveranstaltung.bezeichnung_english as lv_bezeichnung_english,
+ tbl_lehrveranstaltung.studiengang_kz, tbl_lehrveranstaltung.semester, tbl_lehrveranstaltung.anmerkung, tbl_lehrveranstaltung.sprache, tbl_lehrveranstaltung.semesterstunden,
+ tbl_lehrveranstaltung.lehre, tbl_lehrveranstaltung.aktiv,
+ '' as studienplan_id, '' as studienplan_bezeichnung, tbl_lehrveranstaltung.lehrtyp_kurzbz
+ FROM
+ lehre.tbl_lehrveranstaltung
+ WHERE
+ tbl_lehrveranstaltung.oe_kurzbz= ?
+ AND tbl_lehrveranstaltung.aktiv
+ ";
+
+ return $this->execReadOnlyQuery($qry, array($oe_kurzbz));
+ }
+
+ public function getLvsByFachbereich($fachbereich, $studiensemester_kurbz, $mitarbeiter_uid = null)
+ {
+ $qry = "";
+ if (!is_null($mitarbeiter_uid))
+ {
+ $qry = $this->getLvsFromStudienplanByEmp();
+ $params = array($fachbereich, $studiensemester_kurbz);
+ }
+
+ $qry .= "SELECT
+ distinct on(lehrveranstaltung_id)
+ lv_studiengang_kz, lv_semester, lv_kurzbz, lv_bezeichnung, lv_ects,
+ lv_lehreverzeichnis, lv_planfaktor, lv_planlektoren, lv_planpersonalkosten,
+ lv_plankostenprolektor, lv_orgform_kurzbz, lehrveranstaltung_id,
+ lehrform_kurzbz, lv_lehrform_kurzbz, lv_bezeichnung_english, studiengang_kz, semester, anmerkung, sprache, semesterstunden,
+ lehre, aktiv,
+ '' as studienplan_id, '' as studienplan_bezeichnung,
+ (SELECT lehrtyp_kurzbz FROM lehre.tbl_lehrveranstaltung WHERE lehrveranstaltung_id=vw_lehreinheit.lehrveranstaltung_id) as lehrtyp_kurzbz
+ FROM
+ campus.vw_lehreinheit
+ WHERE studiensemester_kurzbz = ?
+ AND fachbereich_kurzbz = ?";
+
+ $params[] = array($studiensemester_kurbz, $fachbereich);
+
+ if (!is_null($mitarbeiter_uid))
+ {
+ $qry .= " AND mitarbeiter_uid = ?";
+ $params[] = $mitarbeiter_uid;
+ }
+ else
+ {
+ $qry.=" AND lehrveranstaltung_id NOT IN (SELECT lehrveranstaltung_id
+ FROM
+ lehre.tbl_lehrveranstaltung
+ JOIN lehre.tbl_studienplan_lehrveranstaltung USING(lehrveranstaltung_id)
+ JOIN lehre.tbl_studienplan USING(studienplan_id)
+ JOIN lehre.tbl_studienordnung USING(studienordnung_id)
+ JOIN lehre.tbl_studienplan_semester USING(studienplan_id)
+ WHERE
+ tbl_lehrveranstaltung.oe_kurzbz=(Select oe_kurzbz from public.tbl_fachbereich where fachbereich_kurzbz= ?)
+ AND tbl_studienplan_semester.studiensemester_kurzbz= ?";
+
+ $params[] = array($fachbereich, $studiensemester_kurbz);
+ }
+
+ return $this->execReadOnlyQuery($qry, $params);
+ }
+
+ private function getLvsFromStudienplanByEmp()
+ {
+ return "
+ SELECT
+ distinct on (lehrveranstaltung_id)
+ tbl_lehrveranstaltung.studiengang_kz as lv_studiengang_kz,
+ tbl_lehrveranstaltung.semester as lv_semester,
+ tbl_lehrveranstaltung.kurzbz as lv_kurzbz,
+ tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
+ tbl_lehrveranstaltung.ects as lv_ects,
+ tbl_lehrveranstaltung.lehreverzeichnis as lv_lehreverzeichnis,
+ tbl_lehrveranstaltung.planfaktor as lv_planfaktor,
+ tbl_lehrveranstaltung.planlektoren as lv_planlektoren,
+ tbl_lehrveranstaltung.planpersonalkosten as lv_planpersonalkosten,
+ tbl_lehrveranstaltung.plankostenprolektor as lv_plankostenprolektor,
+ tbl_lehrveranstaltung.orgform_kurzbz as lv_orgform_kurzbz,
+ tbl_lehrveranstaltung.lehrveranstaltung_id,
+ tbl_lehrveranstaltung.lehrform_kurzbz as lehrform_kurzbz,
+ tbl_lehrveranstaltung.lehrform_kurzbz as lv_lehrform_kurzbz,
+ tbl_lehrveranstaltung.bezeichnung_english as lv_bezeichnung_english,
+ tbl_lehrveranstaltung.studiengang_kz,
+ tbl_studienplan_lehrveranstaltung.semester,
+ tbl_lehrveranstaltung.anmerkung,
+ tbl_lehrveranstaltung.sprache,
+ tbl_lehrveranstaltung.semesterstunden,
+ tbl_lehrveranstaltung.lehre,
+ tbl_lehrveranstaltung.aktiv,
+ tbl_studienplan.studienplan_id::text,
+ tbl_studienplan.bezeichnung as studienplan_bezeichnung,
+ tbl_lehrveranstaltung.lehrtyp_kurzbz
+ FROM
+ lehre.tbl_lehrveranstaltung
+ JOIN lehre.tbl_studienplan_lehrveranstaltung USING(lehrveranstaltung_id)
+ JOIN lehre.tbl_studienplan USING(studienplan_id)
+ JOIN lehre.tbl_studienordnung USING(studienordnung_id)
+ JOIN lehre.tbl_studienplan_semester USING(studienplan_id)
+ WHERE
+ tbl_lehrveranstaltung.oe_kurzbz=(Select oe_kurzbz from public.tbl_fachbereich where fachbereich_kurzbz= ?)
+ AND tbl_studienplan_semester.studiensemester_kurzbz = ?
+ AND tbl_lehrveranstaltung.aktiv
+ UNION
+ ";
+ }
+
+ public function getLvsByStudiengang($studienplan_ids, $placeholders, $only_ids, $studiengang_kz, $studiensemester_kurzbz, $semester = null, $verband = null)
+ {
+ $qry = "";
+ $params = array();
+
+ if (!empty($studienplan_ids))
+ {
+ $qry = $this->getLvsFromStudienplanByStudienplanID($placeholders);
+ $params = $studienplan_ids;
+ }
+
+ $qry .= "
+ SELECT DISTINCT on(lehrveranstaltung_id) lehrveranstaltung_id,
+ tbl_lehrveranstaltung.kurzbz as lv_kurzbz,
+ tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
+ tbl_lehrveranstaltung.bezeichnung_english as lv_bezeichnung_english,
+ studiengang_kz,
+ semester,
+ tbl_lehrveranstaltung.sprache,
+ ects as lv_ects,
+ semesterstunden,
+ tbl_lehrveranstaltung.anmerkung,
+ tbl_lehrveranstaltung.lehre,
+ lehreverzeichnis as lv_lehreverzeichnis,
+ tbl_lehrveranstaltung.aktiv,
+ planfaktor as lv_planfaktor,
+ planlektoren as lv_planlektoren,
+ planpersonalkosten as lv_planpersonalkosten,
+ plankostenprolektor as lv_plankostenprolektor,
+ tbl_lehrveranstaltung.lehrform_kurzbz as lv_lehrform_kurzbz,
+ tbl_lehrveranstaltung.orgform_kurzbz,
+ ''::text as studienplan_id,
+ '' as studienplan_bezeichnung,
+ '' as studienplan_lehrveranstaltung_id_parent,
+ tbl_lehrveranstaltung.lehrtyp_kurzbz,
+ UPPER(CONCAT(tbl_studiengang.typ,tbl_studiengang.kurzbz)) as studiengang
+ FROM lehre.tbl_lehrveranstaltung
+ JOIN lehre.tbl_lehreinheit USING (lehrveranstaltung_id)
+ JOIN public.tbl_studiengang USING(studiengang_kz)
+ WHERE studiengang_kz = ?
+ AND studiensemester_kurzbz = ?
+ ";
+
+ $params[] = $studiengang_kz;
+ $params[] = $studiensemester_kurzbz;
+ if (!is_null($semester))
+ {
+ $qry .= ' AND semester = ?';
+ $params[] = $semester;
+ }
+ if (!is_null($verband))
+ {
+ $qry .= ' AND (tbl_lehrveranstaltung.orgform_kurzbz = ? OR tbl_lehrveranstaltung.orgform_kurzbz IS NULL)';
+ $params[] = $verband;
+ }
+
+ if (!empty($only_ids))
+ {
+
+ $qry .= ' AND NOT EXISTS (SELECT 1 FROM lehre.tbl_studienplan_lehrveranstaltung where studienplan_id IN ?
+ AND lehrveranstaltung_id = tbl_lehrveranstaltung.lehrveranstaltung_id AND tbl_lehrveranstaltung.aktiv)';
+
+ $params[] = $only_ids;
+ }
+
+ return $this->execReadOnlyQuery($qry, $params);
+ }
+ private function getLvsFromStudienplanByStudienplanID($placeholders)
+ {
+ return "
+ SELECT
+ lehrveranstaltung_id, tbl_lehrveranstaltung.kurzbz as lv_kurzbz, tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung, bezeichnung_english as lv_bezeichnung_english, studiengang_kz,
+ tbl_studienplan_lehrveranstaltung.semester, tbl_lehrveranstaltung.sprache,
+ ects as lv_ects, semesterstunden, anmerkung, lehre, lehreverzeichnis as lv_lehreverzeichnis, tbl_lehrveranstaltung.aktiv,
+ planfaktor as lv_planfaktor, planlektoren as lv_planlektoren, planpersonalkosten as lv_planpersonalkosten,
+ plankostenprolektor as lv_plankostenprolektor, lehrform_kurzbz as lv_lehrform_kurzbz, tbl_lehrveranstaltung.orgform_kurzbz,
+ tbl_studienplan_lehrveranstaltung.studienplan_id::text as studienplan_id, tbl_studienplan.bezeichnung as studienplan_bezeichnung, tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id_parent::text,
+ tbl_lehrveranstaltung.lehrtyp_kurzbz, UPPER(CONCAT(tbl_studiengang.typ,tbl_studiengang.kurzbz)) as studiengang
+ FROM
+ lehre.tbl_lehrveranstaltung
+ JOIN lehre.tbl_studienplan_lehrveranstaltung USING(lehrveranstaltung_id)
+ JOIN lehre.tbl_studienplan USING(studienplan_id)
+ JOIN tbl_studiengang USING(studiengang_kz)
+ WHERE
+ tbl_lehrveranstaltung.aktiv AND ((studienplan_id, tbl_studienplan_lehrveranstaltung.semester) IN ( " . implode(',', $placeholders) . "))
+ UNION
+ ";
+ }
+
+ public function getAllOe($lv_id)
+ {
+ $qry = "SELECT DISTINCT oe_kurzbz
+ FROM lehre.tbl_studienplan_lehrveranstaltung
+ JOIN lehre.tbl_studienplan USING(studienplan_id)
+ JOIN lehre.tbl_studienordnung USING(studienordnung_id)
+ JOIN public.tbl_studiengang USING(studiengang_kz)
+ WHERE lehrveranstaltung_id = ?
+
+ UNION
+
+ (
+ SELECT oe_kurzbz
+ FROM public.tbl_studiengang
+ WHERE studiengang_kz = (
+ SELECT tbl_lehrveranstaltung.studiengang_kz
+ FROM lehre.tbl_lehrveranstaltung
+ WHERE lehrveranstaltung_id = ?
+ )
+ )
+ ";
+
+ $params = array($lv_id, $lv_id);
+
+ return $this->execReadOnlyQuery($qry, $params);
+ }
}
diff --git a/application/models/organisation/Organisationseinheit_model.php b/application/models/organisation/Organisationseinheit_model.php
index ba91964f6..db56c1930 100644
--- a/application/models/organisation/Organisationseinheit_model.php
+++ b/application/models/organisation/Organisationseinheit_model.php
@@ -213,4 +213,34 @@ class Organisationseinheit_model extends DB_Model
return $result;
}
+
+ /**
+ * Ermittelt die Stundenobergrenze fuer Lektoren
+ * Dabei wird im OE Baum nach oben nach Stundengrenzen gesucht und die niedrigste Stundengrenze ermittelt
+ * @param $oe_kurzbz Organisationseinheit
+ * @param $fixangestellt boolean legt fest ob die Grenze
+ * fuer Freie oder Fixangestellte Lektoren ermittelt werden soll
+
+ */
+ public function getStundengrenze($oe_kurzbz, $fixangestellt = true)
+ {
+ $fixfrei = $fixangestellt ? 'fix' : 'frei';
+
+ $qry = "
+ WITH RECURSIVE oes(oe_kurzbz, oe_parent_kurzbz) as
+ (
+ SELECT oe_kurzbz, oe_parent_kurzbz FROM public.tbl_organisationseinheit
+ WHERE oe_kurzbz= ?
+ UNION ALL
+ SELECT o.oe_kurzbz, o.oe_parent_kurzbz FROM public.tbl_organisationseinheit o, oes
+ WHERE o.oe_kurzbz=oes.oe_parent_kurzbz
+ )
+ SELECT oe_kurzbz, warn_semesterstunden_{$fixfrei} AS stunden
+ FROM oes
+ JOIN public.tbl_organisationseinheit USING (oe_kurzbz)
+ ORDER BY warn_semesterstunden_{$fixfrei} ASC
+ LIMIT 1";
+
+ return $this->execReadOnlyQuery($qry, array($oe_kurzbz));
+ }
}
diff --git a/application/models/organisation/Studienplan_model.php b/application/models/organisation/Studienplan_model.php
index 569aebd0b..481a0564c 100644
--- a/application/models/organisation/Studienplan_model.php
+++ b/application/models/organisation/Studienplan_model.php
@@ -107,6 +107,8 @@ class Studienplan_model extends DB_Model
));
}
+ // Deprecated
+ // im Lehrveranstaltung_model vorhanden
public function getAllOesForLv($lehrveranstaltung_id)
{
$this->addDistinct('oe_kurzbz');
@@ -135,6 +137,27 @@ class Studienplan_model extends DB_Model
]);
}
+ public function loadStudienplanLehrveranstaltung($lv_id)
+ {
+ $qry = "SELECT studienplan_lehrveranstaltung_id,
+ semester,
+ pflicht,
+ studienplan_id,
+ koordinator,
+ studienplan_lehrveranstaltung_id_parent,
+ lehrveranstaltung_id,
+ insertamum,
+ insertvon,
+ updateamum,
+ updatevon,
+ sort,
+ curriculum,
+ export
+ FROM lehre.tbl_studienplan_lehrveranstaltung WHERE studienplan_lehrveranstaltung_id = ? ";
+ return $this->execReadOnlyQuery($qry, array($lv_id));
+ }
+
+
public function getStudienplaeneForPerson($person_id)
{
$this->addDistinct();
diff --git a/application/models/person/Kontaktverifikation_model.php b/application/models/person/Kontaktverifikation_model.php
new file mode 100644
index 000000000..17bcb1c35
--- /dev/null
+++ b/application/models/person/Kontaktverifikation_model.php
@@ -0,0 +1,42 @@
+dbTable = 'public.tbl_kontakt_verifikation';
+ $this->pk = 'kontakt_verifikation_id';
+ }
+
+ /**
+ * Gets contact verification for a person and a verification code
+ * @param person_id
+ * @param kontakttyp
+ * @param verifikation_code
+ * @param expiration_days number of days after which verifikation code expires
+ * @return object success or error
+ */
+ public function getKontaktVerifikation($person_id, $kontakttyp, $verifikation_code, $expiration_days = 1)
+ {
+ $qry = "
+ SELECT
+ kt.kontakt_id,
+ kv.verifikation_code
+ FROM
+ public.tbl_kontakt_verifikation kv
+ JOIN public.tbl_kontakt kt USING(kontakt_id)
+ WHERE kt.person_id = ?
+ AND kt.kontakttyp = ?
+ AND kv.verifikation_code = ?
+ AND kv.erstelldatum >= NOW() - INTERVAL '".$this->escape($expiration_days)." days'
+ ORDER BY
+ kt.kontakt_id DESC
+ LIMIT 1";
+
+ return $this->execQuery($qry, array($person_id, $kontakttyp, $verifikation_code));
+ }
+}
diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php
index 1835296fe..bc4494f57 100644
--- a/application/models/person/Notiz_model.php
+++ b/application/models/person/Notiz_model.php
@@ -151,7 +151,7 @@ class Notiz_model extends DB_Model
* bestellung_id, lehreinheit_id, anrechnung_id, uid)
* @param $id the corresponding id, part of public.tbl_notizzuordnung
*/
- public function getNotizWithDocEntries($id, $type)
+ public function getNotizWithDocEntries($id, $type, $withoutTags = true)
{
$qry = "
SELECT
@@ -195,8 +195,12 @@ class Notiz_model extends DB_Model
LEFT JOIN
public.tbl_person person_bearbeiter ON (person_bearbeiter.person_id = p_bearbeiter.person_id)
WHERE
- z.$type = ?
- GROUP BY
+ z.$type = ?";
+
+ if ($withoutTags)
+ $qry .= " AND n.typ IS NULL ";
+
+ $qry .= "GROUP BY
notiz_id, z.notizzuordnung_id,
person_verfasser.vorname, person_verfasser.nachname,
person_bearbeiter.vorname, person_bearbeiter.nachname
diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php
index 997048972..3947378cf 100644
--- a/application/models/person/Person_model.php
+++ b/application/models/person/Person_model.php
@@ -307,72 +307,60 @@ class Person_model extends DB_Model
public function checkDuplicate($person_id)
{
- $qry = "SELECT person_id
- FROM public.tbl_prestudent p
- JOIN
- (
- SELECT DISTINCT ON(prestudent_id) *
- FROM public.tbl_prestudentstatus
- WHERE prestudent_id IN
- (
- SELECT prestudent_id
- FROM public.tbl_prestudent
- WHERE person_id IN
- (
- SELECT p2.person_id
- FROM public.tbl_person p
- JOIN public.tbl_person p2
- ON lower(p.vorname) = lower(p2.vorname)
- AND lower(p.nachname) = lower(p2.nachname)
- AND p.gebdatum = p2.gebdatum
- AND p.person_id = ?
- )
- )
- ORDER BY prestudent_id, datum DESC, insertamum DESC
- ) ps USING(prestudent_id)
- JOIN public.tbl_status USING(status_kurzbz)
+ $qry = "
+ WITH person AS (
+ SELECT *
+ FROM public.tbl_person
+ WHERE person_id = ?
+ ),
+ allePersonen AS (
+ SELECT p.person_id
+ FROM public.tbl_person p
+ JOIN person
+ ON lower(p.vorname) = lower(person.vorname)
+ AND lower(p.nachname) = lower(person.nachname)
+ AND p.gebdatum = person.gebdatum
+ ),
+ lastStatus AS (
+ SELECT DISTINCT ON (tbl_prestudentstatus.prestudent_id)
+ tbl_prestudentstatus.prestudent_id,
+ tbl_prestudentstatus.status_kurzbz,
+ tbl_prestudent.studiengang_kz,
+ tbl_prestudent.person_id
+ FROM public.tbl_prestudentstatus
+ JOIN public.tbl_prestudent USING (prestudent_id)
+ WHERE tbl_prestudent.person_id IN (SELECT person_id FROM allePersonen)
+ ORDER BY tbl_prestudentstatus.prestudent_id, tbl_prestudentstatus.datum DESC, tbl_prestudentstatus.insertamum DESC
+ ),
+ interessenten AS (
+ SELECT *
+ FROM lastStatus
WHERE status_kurzbz = 'Interessent'
- AND studiengang_kz IN
- (
- SELECT studiengang_kz
- FROM public.tbl_prestudent p
- JOIN
- (
- SELECT DISTINCT ON(prestudent_id) *
- FROM public.tbl_prestudentstatus
- WHERE prestudent_id IN
- (
- SELECT prestudent_id
- FROM public.tbl_prestudent
- WHERE person_id IN
- (
- SELECT p2.person_id
- FROM public.tbl_person p
- JOIN public.tbl_person p2
- ON lower(p.vorname) = lower(p2.vorname)
- AND lower(p.nachname) = lower(p2.nachname)
- AND p.gebdatum = p2.gebdatum
- AND p.person_id = ?
- )
- )
- ORDER BY prestudent_id, datum DESC, insertamum DESC
- ) ps USING(prestudent_id)
- JOIN public.tbl_status USING(status_kurzbz)
- WHERE status_kurzbz = 'Abbrecher'
- )
-
- UNION
-
+ ),
+ keineInteressenten AS (
+ SELECT *
+ FROM lastStatus
+ WHERE status_kurzbz != 'Interessent'
+ ),
+ doppeltePerson AS (
SELECT p2.person_id
- FROM tbl_person p1
- JOIN tbl_prestudent ps ON p1.person_id = ps.person_id
- INNER JOIN (
- SELECT vorname, nachname, gebdatum, person.person_id
- FROM tbl_person person
- JOIN tbl_prestudent sps ON person.person_id = sps.person_id
- ) p2
- ON (lower(p1.vorname) = lower(p2.vorname) AND lower(p1.nachname) = lower(p2.nachname) AND p1.gebdatum = p2.gebdatum)
- WHERE p1.person_id != p2.person_id AND (p1.person_id = ?)";
+ FROM public.tbl_person p1
+ JOIN public.tbl_prestudent ps1 ON ps1.person_id = p1.person_id
+ JOIN public.tbl_person p2
+ ON lower(p1.vorname) = lower(p2.vorname)
+ AND lower(p1.nachname) = lower(p2.nachname)
+ AND p1.gebdatum = p2.gebdatum
+ WHERE p1.person_id = ?
+ AND p1.person_id <> p2.person_id
+ )
+ SELECT DISTINCT(interessenten.person_id)
+ FROM interessenten
+ JOIN keineInteressenten
+ ON interessenten.studiengang_kz = keineInteressenten.studiengang_kz
+ WHERE interessenten.person_id = ?
+ UNION
+ SELECT DISTINCT person_id
+ FROM doppeltePerson";
return $this->execQuery($qry, array($person_id, $person_id, $person_id));
}
diff --git a/application/models/person/Profil_update_model.php b/application/models/person/Profil_update_model.php
index ffb04b7e7..31005c4b7 100644
--- a/application/models/person/Profil_update_model.php
+++ b/application/models/person/Profil_update_model.php
@@ -63,6 +63,7 @@ class Profil_update_model extends DB_Model
$this->addSelect(["public.tbl_profil_update.*", "public.tbl_person.vorname"]);
$this->addJoin("public.tbl_benutzer", "public.tbl_benutzer.uid = public.tbl_profil_update.uid");
$this->addJoin("public.tbl_person", "public.tbl_person.person_id = public.tbl_benutzer.person_id");
+ $this->db->order_by('COALESCE(public.tbl_profil_update.updateamum, public.tbl_profil_update.insertamum)', 'DESC', false);
$res = $this->loadWhere($whereClause);
if (isError($res)) {
return $res;
@@ -118,13 +119,47 @@ class Profil_update_model extends DB_Model
$parameters = [];
$query = "
SELECT
- profil_update_id, tbl_profil_update.uid, (tbl_person.vorname || ' ' || tbl_person.nachname) AS name , topic, requested_change, tbl_profil_update.updateamum, tbl_profil_update.updatevon, tbl_profil_update.insertamum, tbl_profil_update.insertvon, status, public.tbl_profil_update_status.bezeichnung_mehrsprachig[(" . $lang . ")] as status_translated, status_timestamp, status_message, attachment_id
+ profil_update_id,
+ tbl_profil_update.uid,
+ (tbl_person.vorname || ' ' || tbl_person.nachname) AS name ,
+ topic,
+ requested_change,
+ tbl_profil_update.updateamum,
+ tbl_profil_update.updatevon,
+ tbl_profil_update.insertamum,
+ tbl_profil_update.insertvon,
+ status,
+ public.tbl_profil_update_status.bezeichnung_mehrsprachig[(" . $lang . ")] as status_translated,
+ status_timestamp,
+ status_message,
+ attachment_id,
+ UPPER(public.tbl_studiengang.typ || public.tbl_studiengang.kurzbz) AS studiengang,
+ COALESCE(of.orgform_kurzbz, public.tbl_studiengang.orgform_kurzbz) AS orgform,
+ NULL as oezuordnung
FROM public.tbl_profil_update
JOIN public.tbl_profil_update_status ON public.tbl_profil_update_status.status_kurzbz = public.tbl_profil_update.status
JOIN public.tbl_student ON public.tbl_student.student_uid=public.tbl_profil_update.uid
JOIN public.tbl_benutzer ON public.tbl_benutzer.uid = public.tbl_student.student_uid
JOIN public.tbl_person ON public.tbl_benutzer.person_id=public.tbl_person.person_id
JOIN public.tbl_studiengang ON public.tbl_studiengang.studiengang_kz=public.tbl_student.studiengang_kz
+ LEFT JOIN (
+ select
+ pss.prestudent_id, COALESCE(sp.orgform_kurzbz, pss.orgform_kurzbz) as orgform_kurzbz
+ from (
+ select
+ prestudent_id, max(insertamum) as insertamum
+ from
+ public.tbl_prestudentstatus
+ where
+ datum <= NOW()
+ group by
+ prestudent_id
+ ) mpss
+ join
+ public.tbl_prestudentstatus pss on pss.prestudent_id = mpss.prestudent_id and pss.insertamum = mpss.insertamum
+ left join
+ lehre.tbl_studienplan sp on pss.studienplan_id = sp.studienplan_id
+ ) of ON of.prestudent_id = public.tbl_student.prestudent_id
Where public.tbl_studiengang.oe_kurzbz IN ? ";
$parameters[] = $oe_berechtigung;
if ($whereClause) {
@@ -144,12 +179,33 @@ class Profil_update_model extends DB_Model
}
}
if ($mitarbeiterBerechtigung) {
- $this->addSelect(["profil_update_id", "tbl_profil_update.uid", "(tbl_person.vorname || ' ' || tbl_person.nachname) AS name", "topic", "requested_change", "tbl_profil_update.updateamum", "tbl_profil_update.updatevon", "tbl_profil_update.insertamum", "tbl_profil_update.insertvon", "status", "public.tbl_profil_update_status.bezeichnung_mehrsprachig[(" . $lang . ")] AS status_translated", "status_timestamp", "status_message", "attachment_id"]);
+ $this->addSelect([
+ "profil_update_id",
+ "tbl_profil_update.uid",
+ "(tbl_person.vorname || ' ' || tbl_person.nachname) AS name",
+ "topic",
+ "requested_change",
+ "tbl_profil_update.updateamum",
+ "tbl_profil_update.updatevon",
+ "tbl_profil_update.insertamum",
+ "tbl_profil_update.insertvon",
+ "status",
+ "public.tbl_profil_update_status.bezeichnung_mehrsprachig[(" . $lang . ")] AS status_translated",
+ "status_timestamp",
+ "status_message",
+ "attachment_id",
+ "COALESCE(NULL) as studiengang",
+ "COALESCE(NULL) as orgform",
+ "oe.bezeichnung as oezuordnung"
+ ]);
$this->addJoin('tbl_profil_update_status', 'tbl_profil_update_status.status_kurzbz=tbl_profil_update.status');
$this->addJoin('tbl_mitarbeiter', 'tbl_mitarbeiter.mitarbeiter_uid=tbl_profil_update.uid');
$this->addJoin('tbl_benutzer', 'tbl_benutzer.uid=tbl_profil_update.uid');
$this->addJoin('tbl_person', 'tbl_benutzer.person_id=tbl_person.person_id');
+ $this->addJoin('tbl_benutzerfunktion bf', 'bf.uid = tbl_benutzer.uid AND bf.funktion_kurzbz = \'oezuordnung\' AND NOW() >= COALESCE(bf.datum_von, \'1970-01-01\'::date) AND NOW() <= COALESCE(bf.datum_bis, \'2170-12-31\'::date)', 'LEFT');
+ $this->addJoin('tbl_organisationseinheit oe', 'oe.oe_kurzbz = bf.oe_kurzbz', 'LEFT');
$mitarbeiterRequests = $this->loadWhere($whereClause);
+
if (isError($mitarbeiterRequests))
return error("db error: " . getData($mitarbeiterRequests));
$mitarbeiterRequests = getData($mitarbeiterRequests) ?: [];
@@ -179,8 +235,11 @@ class Profil_update_model extends DB_Model
private function formatProfilRequest($request)
{
$request->requested_change = json_decode($request->requested_change);
+ $request->insertamum_iso = !is_null($request->insertamum) ? date_create($request->insertamum)->format('Y-m-d') : null;
$request->insertamum = !is_null($request->insertamum) ? date_create($request->insertamum)->format('d.m.Y') : null;
+ $request->updateamum_iso = !is_null($request->updateamum) ? date_create($request->updateamum)->format('Y-m-d') : null;
$request->updateamum = !is_null($request->updateamum) ? date_create($request->updateamum)->format('d.m.Y') : null;
+ $request->status_timestamp_iso = !is_null($request->status_timestamp) ? date_create($request->status_timestamp)->format('Y-m-d') : null;
$request->status_timestamp = !is_null($request->status_timestamp) ? date_create($request->status_timestamp)->format('d.m.Y') : null;
}
diff --git a/application/models/ressource/Mitarbeiter_model.php b/application/models/ressource/Mitarbeiter_model.php
index bf4672070..f6cdc74b8 100644
--- a/application/models/ressource/Mitarbeiter_model.php
+++ b/application/models/ressource/Mitarbeiter_model.php
@@ -430,4 +430,18 @@ class Mitarbeiter_model extends DB_Model
return $this->execQuery($qry, $parametersArray);
}
+
+ public function isLehrauftragFirma($mitarbeiter_uid)
+ {
+ $this->addSelect('firma_id');
+ $this->addJoin('public.tbl_benutzer', 'uid = mitarbeiter_uid');
+ $this->addJoin('public.tbl_person', 'person_id');
+ $this->addJoin('public.tbl_adresse', 'person_id', 'LEFT');
+ $this->addOrder('zustelladresse', 'DESC');
+ $this->addOrder('firma_id');
+ $this->addLimit(1);
+ $firma_result = $this->loadWhere(array('mitarbeiter_uid' => $mitarbeiter_uid));
+ $firma = getData($firma_result)[0]->firma_id;
+ return !is_null($firma);
+ }
}
diff --git a/application/models/ressource/Reservierung_model.php b/application/models/ressource/Reservierung_model.php
index 789ff3d9c..0c391ea20 100644
--- a/application/models/ressource/Reservierung_model.php
+++ b/application/models/ressource/Reservierung_model.php
@@ -76,7 +76,7 @@ class Reservierung_model extends DB_Model
*
* @return stdClass
*/
- public function getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz = null)
+ public function getReservierungenMitarbeiter($start_date, $end_date)
{
$raum_reservierungen_query = "SELECT res.*, beginn, ende,
@@ -89,7 +89,6 @@ class Reservierung_model extends DB_Model
JOIN lehre.tbl_stunde ON lehre.tbl_stunde.stunde = res.stunde
WHERE res.uid = ? AND datum >= ? AND datum <= ?";
-// $subquery = is_null($ort_kurzbz)? $lvplan_reservierungen_query:$raum_reservierungen_query;
$subquery = $raum_reservierungen_query;
diff --git a/application/models/ressource/Stundenplandev_model.php b/application/models/ressource/Stundenplandev_model.php
index 800540d60..e718ba073 100644
--- a/application/models/ressource/Stundenplandev_model.php
+++ b/application/models/ressource/Stundenplandev_model.php
@@ -10,6 +10,9 @@ class Stundenplandev_model extends DB_Model
parent::__construct();
$this->dbTable = 'lehre.tbl_stundenplandev';
$this->pk = 'stundenplandev_id';
+
+ $this->load->model('education/lehreinheit_model', 'LehreinheitModel');
+ $this->load->model('education/Lehreinheitgruppe_model', 'LehreinheitgruppeModel');
}
@@ -157,4 +160,85 @@ class Stundenplandev_model extends DB_Model
return $this->execQuery($qry, $params);
}
+ public function deleteGroupPlanning($lehreinheit_id, $lehreinheitgruppe_id)
+ {
+ $lehreinheit = $this->LehreinheitModel->load($lehreinheit_id);
+
+ if (!hasData($lehreinheit))
+ return error ('No Lehreinheit found!');
+
+ $lehreinheitgruppe = $this->LehreinheitgruppeModel->load($lehreinheitgruppe_id);
+
+ if (!hasData($lehreinheitgruppe))
+ return error ('No Lehreinheitgruppe found!');
+
+ $this->addJoin('lehre.tbl_stundenplan_betriebsmittel', 'stundenplandev_id');
+ $this->addJoin('lehre.tbl_lehreinheitgruppe', 'lehreinheit_id');
+ $this->db->where('tbl_lehreinheitgruppe.lehreinheitgruppe_id', $lehreinheitgruppe_id);
+
+ $this->db->group_start();
+ $this->db->group_start();
+ $this->db->where('tbl_lehreinheitgruppe.gruppe_kurzbz IS NOT NULL', null, false);
+ $this->db->where('tbl_lehreinheitgruppe.gruppe_kurzbz = tbl_stundenplandev.gruppe_kurzbz', null, false);
+ $this->db->group_end();
+ $this->db->or_group_start();
+ $this->db->where('tbl_lehreinheitgruppe.gruppe_kurzbz IS NULL', null, false);
+ $this->db->where('tbl_lehreinheitgruppe.studiengang_kz = tbl_stundenplandev.studiengang_kz', null, false);
+ $this->db->where('tbl_lehreinheitgruppe.semester = tbl_stundenplandev.semester', null, false);
+ $this->db->where('tbl_lehreinheitgruppe.verband = tbl_stundenplandev.verband', null, false);
+ $this->db->where('tbl_lehreinheitgruppe.gruppe = tbl_stundenplandev.gruppe', null, false);
+ $this->db->group_end();
+ $this->db->group_end();
+
+ $betriebsmittel_result = $this->load();
+ $betriebsmittel_array = hasData($betriebsmittel_result) ? getData($betriebsmittel_result) : array();
+ if (sizeof($betriebsmittel_array) > 0)
+ {
+ return error ('Gruppe kann nicht entfernt werden da bereits Ressourcen zugeordnet wurden');
+ }
+
+ $this->addSelect('stundenplandev_id');
+ $this->addJoin('lehre.tbl_lehreinheitgruppe',
+ "tbl_stundenplandev.lehreinheit_id = tbl_lehreinheitgruppe.lehreinheit_id
+ AND tbl_stundenplandev.studiengang_kz = tbl_lehreinheitgruppe.studiengang_kz
+ AND tbl_stundenplandev.semester = tbl_lehreinheitgruppe.semester
+ AND trim(COALESCE(tbl_stundenplandev.verband, '')) = trim(COALESCE(tbl_lehreinheitgruppe.verband, ''))
+ AND trim(COALESCE(tbl_stundenplandev.gruppe, '')) = trim(COALESCE(tbl_lehreinheitgruppe.gruppe, ''))
+ AND trim(COALESCE(tbl_stundenplandev.gruppe_kurzbz, '')) = trim(COALESCE(tbl_lehreinheitgruppe.gruppe_kurzbz, ''))"
+ );
+ $stundenplan_result = $this->loadWhere(array('tbl_lehreinheitgruppe.lehreinheitgruppe_id' => $lehreinheitgruppe_id));
+
+ if (hasData($stundenplan_result))
+ {
+ $stundenplan_ids = array_column(getData($stundenplan_result), 'stundenplandev_id');
+ $this->db->where_in('stundenplandev_id', $stundenplan_ids);
+ $delete_result = $this->db->delete('lehre.tbl_stundenplandev');
+
+ if ($delete_result)
+ return success('Group deleted successfully from Stundenplandev');
+ else
+ return error('Error deleting Group from Stundenplandev');
+ }
+ }
+
+ public function deleteLektorPlanning($lehreinheit_id, $mitarbeiter_uid)
+ {
+ //TODO (david) prüfen ob der check notwendig ist
+ /*$this->addDistinct('mitarbeiter_uid');
+ $this->addSelect('mitarbeiter_uid');
+ $stundenplan_result = $this->loadWhere(array('lehreinheit_id' => $lehreinheit_id));
+ $stundenplan_array = hasData($stundenplan_result) ? (getData($stundenplan_result)) : array();
+
+ if (sizeof($stundenplan_array) <= 1)
+ return error('Diese/r LektorIn kann nicht aus dem LVPlan entfernt werden da dies der/die letzte verplante LektorIn ist');*/
+
+ $this->addJoin('lehre.tbl_stundenplan_betriebsmittel', 'stundenplandev_id');
+ $betriebsmittel_result = $this->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'tbl_stundenplandev.mitarbeiter_uid' => $mitarbeiter_uid));
+ $betriebsmittel_array = hasData($betriebsmittel_result) ? getData($betriebsmittel_result) : array();
+
+ if (sizeof($betriebsmittel_array) > 0)
+ return error('Gruppe kann nicht entfernt werden da bereits Ressourcen zugeordnet wurden');
+
+ return $this->delete(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
+ }
}
diff --git a/application/models/ressource/Stundensatz_model.php b/application/models/ressource/Stundensatz_model.php
index 10f5a6aa1..f34ad07ed 100644
--- a/application/models/ressource/Stundensatz_model.php
+++ b/application/models/ressource/Stundensatz_model.php
@@ -42,4 +42,20 @@ class Stundensatz_model extends DB_Model
return $this->execQuery($qry, $params);
}
+
+ public function getDefaultStundensatz($mitarbeiter_uid, $beginn, $ende = null, $typ = null)
+ {
+ $stundensatz_result = $this->getStundensatzByDatum($mitarbeiter_uid, $beginn, $ende, $typ);
+ $default_stundensatz = hasData($stundensatz_result) ? getData($stundensatz_result)[0]->stundensatz : null;
+ if (defined('FAS_LV_LEKTORINNENZUTEILUNG_FIXANGESTELLT_STUNDENSATZ') && !FAS_LV_LEKTORINNENZUTEILUNG_FIXANGESTELLT_STUNDENSATZ)
+ {
+ $this->load->model('vertragsbestandteil/Dienstverhaeltnis_model','DienstverhaeltnisModel');
+ $echterdv_result = $this->DienstverhaeltnisModel->existsDienstverhaeltnis($mitarbeiter_uid, $beginn, $ende, 'echterdv');
+ if (hasData($echterdv_result))
+ {
+ $default_stundensatz = null;
+ }
+ }
+ return $default_stundensatz;
+ }
}
\ No newline at end of file
diff --git a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php
index f81a2d518..b055ee954 100644
--- a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php
+++ b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php
@@ -253,4 +253,25 @@ EOSQL;
}
return $dvs;
}
+
+ public function existsDienstverhaeltnis($mitarbeiter_uid, $start, $ende = null, $vertragsart_kurzbz = null)
+ {
+ $this->addOrder('von', 'DESC');
+ $this->db->where('mitarbeiter_uid', $mitarbeiter_uid);
+ if (!is_null($vertragsart_kurzbz))
+ $this->db->where('vertragsart_kurzbz', $this->escape($vertragsart_kurzbz));
+
+ $this->db->where('von <=', $ende);
+
+ if (!is_null($ende))
+ {
+ $this->db->group_start();
+ $this->db->where('bis >=', $start);
+ $this->db->or_where('bis IS NULL', null, false);
+ $this->db->group_end();
+ }
+
+ $this->addLimit(1);
+ return $this->load();
+ }
}
diff --git a/application/phrases/abgabetool.php b/application/phrases/abgabetool.php
index 92304cbba..41c87ca62 100644
--- a/application/phrases/abgabetool.php
+++ b/application/phrases/abgabetool.php
@@ -1048,4 +1048,28 @@ array (
),
),
),
+,
+array (
+ 'app' => 'core',
+ 'category' => 'abgabetool',
+ 'phrase' => 'c4abgabeStgSpezifischeRichtlinienBeachten',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Bitte beachten Sie gegebenenfalls existierende studiengangsspezifische Richtlinien und informieren Sie sich diesbezüglich. Vielen Dank.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Please note any existing program-specific guidelines and inform yourself about them. Thank you.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
);
\ No newline at end of file
diff --git a/application/phrases/global.php b/application/phrases/global.php
index 09748e45d..ba3b7f79b 100644
--- a/application/phrases/global.php
+++ b/application/phrases/global.php
@@ -8731,5 +8731,29 @@ array (
),
),
)
+,
+array (
+ 'app' => 'anwesenheiten',
+ 'category' => 'global',
+ 'phrase' => 'jetztStarten',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Jetzt Starten',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Start Now',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
);
diff --git a/application/phrases/lehre.php b/application/phrases/lehre.php
index d1c46a87e..4ec2786ba 100644
--- a/application/phrases/lehre.php
+++ b/application/phrases/lehre.php
@@ -3681,5 +3681,725 @@ array (
),
),
)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'cancelvertrag',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Vertrag stornieren',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Cancel Contract',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'vertragConfirm',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Möchten Sie den Vertrag wirklich stornieren?',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Do you really want to cancel the contract?',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'fachbereich',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Institut',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Institute',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'lehrtyp',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Lehrtyp',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Teaching type',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'newlehreinheit',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Neuer LV-Teil',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'New teaching unit',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'bezeichnungeng',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Bezeichnung Englisch',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'title english',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'detailanmerkung',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Info an LV-Planung',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Info to LV Planning',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'unr',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'UNR',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'UNR',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'raumtyp',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Raumtyp',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Room',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'raumtypalternativ',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Raumtyp Alternativ',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Room Alternative',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'startkw',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Start KW',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Start CW',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'stundenblockung',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Stunden Block',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Hours Block',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'wochenrhythmus',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Wochenrhythmus',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Weekly rhythm',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'lehrfunktion',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Lehrfunktion',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Teaching function',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'planstunden',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'LV-Plan Stunden',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Course-Plan Hours',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'leplanstunden',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Planstunden',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Plan Hours',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'default',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Default',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Default',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'bismelden',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'BIS-Melden',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Report BIS',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'gesamtkosten',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Gesamtkosten',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Total costs',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'lehreinheit_id',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Lehreinheit ID',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Teaching Unit ID',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'verplant',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Verplant',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Planned',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'addLektor',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'LektorIn hinzufügen',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Add lector',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'addGroup',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Gruppe hinzufügen',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Add group',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'assignPerson',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Person zuordnen',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Assign person',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'assignedPersons',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Direkt zugeordnete Personen',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Directly assigned persons',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'vertragurfassung',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Vertragsdetails lt. Urfassung',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Contract details as per original version',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'semesterstunden',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Semesterstunden',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Semester hours',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'vertragsstatus',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Vertragsstatus',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Contract status',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'auslvplanentfernen',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Stunden aus LV-Plan entfernen',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Remove hours from course plan',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'lehre',
+ 'phrase' => 'lehrfach',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Lehrfach',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Course',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
);
diff --git a/application/phrases/onboarding.php b/application/phrases/onboarding.php
new file mode 100644
index 000000000..302599836
--- /dev/null
+++ b/application/phrases/onboarding.php
@@ -0,0 +1,661 @@
+ 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'emailFehlt',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Email fehlt',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Email is missing',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'emailUngueltig',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Email ist ungültig',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'The email is not valid',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'emailRegistriert',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Diese Email ist bereits registriert. Bitte verwenden sie eine andere Email oder loggen sie sich mit einer anderen Methode ein.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'The email is already registered. Please choose a different email or use a different login method.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bewerbungZugangEmailBetreff',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Zugang zu Ihrer Bewerbung',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Access to your application',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bewerbungZugangEmailAnredeWeiblich',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Sehr geehrte Frau',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Dear Ms',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bewerbungZugangEmailAnredeMaennlich',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Sehr geehrter Herr',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Dear Mr',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bewerbungZugangEmailAnredeNeutral',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Sehr geehrte/r',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Dear',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bewerbungVerifzieren',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Bewerbung verifizieren',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Verify application',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bewerbungVerifizierungEinleitung',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Wenn Ihre Daten stimmen, geben Sie bitte Ihre E-Mail Adresse ein und drücken Sie auf "Bewerbung verifizieren".
+Danach erhalten Sie eine E-Mail mit dem Link zu Ihrer Bewerbung an die angegebene Adresse.
+Dort können Sie Studienrichtungen hinzufügen, Ihre Daten vervollständigen, und sich unverbindlich bewerben.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'If your data is correct, please enter your email and click "Verify application".
+We will then send you a link via e-mail to the address specified. There, you can add personal information or degree programs and submit non-binding applications.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bewerbungVerifizierungKontakthinweis',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Wenn Sie mehr Informationen benötigen, steht Ihnen unsere Studienberatung gerne persönlich, telefonisch, per E-Mail oder WhatsApp zur Verfügung.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Should you require any additional information, please do not hesitate to contact our student counselling team in person, by phone, or via e-mail or WhatsApp.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bewerbungVerifizierungDatenschutzhinweis',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Datenschutz-Hinweis',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Privacy information',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bewerbungVerifizierungDatenschutzhinweisText',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Die uns von Ihnen zum Zwecke der Bewerbung bekanntgegebenen Daten werden von uns ausschließlich zur Abwicklung der Bewerbung auf der Grundlage von vor- bzw vertraglichen Zwecken verarbeitet und mit der unten beschriebenen Ausnahme bei Unklarheiten betreffend die Zugangsvoraussetzungen nicht an Dritte weitergegeben.
+Kommt es zu keinem weiteren Kontakt bzw zu keiner Aufnahme, löschen wir Ihre Daten nach drei Jahren.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'The data communicated to us by you for the purpose of the application will be used by us exclusively for the processing of the application on the basis of pre-contractual or contractual purposes and will not be passed on to third parties with the exception described below in case of uncertainties regarding the entry requirements.
+If there is no further contact or enrolment, your data will be deleted after three years.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bewerbungVerifizierungInformationenDatenschutzGrundverordnung',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Informationen zu Ihren Betroffenenrechten finden Sie hier:',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Information on your data subject rights can be found here:',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bewerbungVerifizierungDatenschutzFragen',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Bei Fragen stehen wir Ihnen jederzeit unter folgender Mail zur Verfügung: ',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'If you have any questions, please contact us at ',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'vorname',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Vorname',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'First name',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'nachname',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Nachname',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Last name',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'geburtsdatum',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Geburtsdatum',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Birth date',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'emailAdresse',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'E-Mail Adresse',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'E-mail address',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'emailGesendet',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Die E-Mail mit dem Link zu Ihrer Bewerbung wurde erfolgreich an {0} verschickt.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'The email with the link to your application has been successfully sent to {0}.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'emailGesendetHinweis',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'In der Regel erhalten Sie das Mail in wenigen Minuten. Wenn Sie nach 24 Stunden noch kein Mail erhalten haben,
+ kontaktieren Sie bitte unsere {0}Studienberatung{1}',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'You should receive an e-mail within a few minutes. If you receive no e-mail within 24 hours please contact
+ our {0}student counselling team{1}.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'fehlerBeiRegistrierung',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Fehler bei der Registrierung',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Error when registering',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'fehlerBeiRegistrierungText',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Es ist ein Fehler bei der Registrierung aufgetreten.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'An error occured during registration.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'fehlerBeiRegistrierungNochmalVersuchen',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Nochmals versuchen',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Try again',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'zustimmungDatenuebermittlung',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Können in Ausnahmefällen die Zugangsvoraussetzungen von der FH Technikum Wien nicht abschließend abgeklärt werden, erteile ich die Zustimmung, dass die FH Technikum Wien die Dokumente zur Überprüfung an die zuständigen Behörden weiterleiten kann.
+Ich wurde darüber informiert, dass ich nicht verpflichtet bin, der Übermittlung meiner Daten zuzustimmen. Diese Zustimmung ist allerdings notwendig, um die Bewerbung berücksichtigen zu können.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'If in exceptional cases the admission requirements can not be finally clarified by the UAS Technikum Wien, I give my consent that the UAS Technikum Wien can forward the documents to the competent authorities for verification.
+I have been informed that I am under no obligation to consent to the transmission of my data. However, this consent is necessary in order for the application to be considered.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'zustimmungDatenschutzerklaerung',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Ich habe die Datenschutzerklärung zu Kenntnis genommen.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'I have taken note of the privacy policy.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bitteDatenuebermittlungZustimmen',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Sie müssen der Datenübermittlung zustimmen, um Ihre Bewerbung abschicken zu können.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'You have to consent the transmission of your data to send the application.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'onboarding',
+ 'phrase' => 'bitteDatenschutzerklaerungZustimmen',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Sie müssen der Datenschutzerklärung zustimmen, um Ihre Bewerbung abschicken zu können.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'You have to consent to the privacy statement to send the application.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+);
\ No newline at end of file
diff --git a/application/phrases/profilUpdate.php b/application/phrases/profilUpdate.php
index 653d20714..bf2ce4451 100644
--- a/application/phrases/profilUpdate.php
+++ b/application/phrases/profilUpdate.php
@@ -1681,4 +1681,52 @@ array (
),
),
),
+,
+array (
+ 'app' => 'core',
+ 'category' => 'profilUpdate',
+ 'phrase' => 'infoHeimatadresse',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Die initiale Meldeadresse kann aufgrund von Berichtspflichten nicht verändert oder gelöscht werden.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'The initial official address can not be changed or deleted due to reporting obligations.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'core',
+ 'category' => 'profilUpdate',
+ 'phrase' => 'infoZustelladresse',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => '(Soll etwaige Post an diese Adresse geschickt werden?)',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => '(Should any paper mail be sent to this address?)',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
);
\ No newline at end of file
diff --git a/application/phrases/ui.php b/application/phrases/ui.php
index 8ac8d3deb..298e15ba0 100644
--- a/application/phrases/ui.php
+++ b/application/phrases/ui.php
@@ -4761,5 +4761,125 @@ array (
),
),
)
+,
+array (
+ 'app' => 'pep',
+ 'category' => 'ui',
+ 'phrase' => 'kategorie',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Kategorie',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Category',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'pep',
+ 'category' => 'ui',
+ 'phrase' => 'lventwicklung',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'LV-Weiterentwicklung',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Course Development',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'pep',
+ 'category' => 'ui',
+ 'phrase' => 'readonlycategory',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Die Kategorie ist deaktiviert und kann nur im Lesemodus angezeigt werden.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'The category is deactivated and can only be viewed in read-only mode.',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'pep',
+ 'category' => 'ui',
+ 'phrase' => 'werksvertragsects',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Werkvertragsvolumen in ECTS',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Work contract volume in ECTS',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
+,
+array (
+ 'app' => 'pep',
+ 'category' => 'ui',
+ 'phrase' => 'lv_entwicklung_rolle',
+ 'insertvon' => 'system',
+ 'phrases' =>
+ array (
+ 0 =>
+ array (
+ 'sprache' => 'German',
+ 'text' => 'Rolle',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ 1 =>
+ array (
+ 'sprache' => 'English',
+ 'text' => 'Role',
+ 'description' => '',
+ 'insertvon' => 'system',
+ ),
+ ),
+)
);
diff --git a/application/views/Cis/ProfilUpdate.php b/application/views/Cis/ProfilUpdate.php
index e797d436f..2e69208c7 100644
--- a/application/views/Cis/ProfilUpdate.php
+++ b/application/views/Cis/ProfilUpdate.php
@@ -2,10 +2,14 @@
$includesArray = array(
'title' => 'Profil Änderungen',
'vue3' => true,
+ 'primevue3' => true,
'bootstrap5' => true,
'fontawesome6'=> true,
'axios027' => true,
'tabulator5' => true,
+ 'customJSs' => array(
+ 'vendor/moment/luxonjs/luxon.min.js'
+ ),
'customJSModules' => array(
'public/js/apps/Cis/ProfilUpdateRequests.js'
),
diff --git a/application/views/LVVerwaltung.php b/application/views/LVVerwaltung.php
new file mode 100644
index 000000000..4cebae839
--- /dev/null
+++ b/application/views/LVVerwaltung.php
@@ -0,0 +1,39 @@
+ 'LVVerwaltung',
+ 'axios027' => true,
+ 'bootstrap5' => true,
+ 'fontawesome6' => true,
+ 'vue3' => true,
+ 'primevue3' => true,
+ 'tabulator6' => true,
+ 'tinymce5' => true,
+ 'tags' => true,
+
+ 'customCSSs' => [
+ 'public/css/components/vue-datepicker.css',
+ 'public/css/components/primevue.css',
+ 'public/css/Studentenverwaltung.css',
+ 'public/css/Lvverwaltung.css'
+
+ ],
+ 'customJSModules' => [
+ 'public/js/apps/LVVerwaltung.js'
+ ]
+ );
+
+ $this->load->view('templates/FHC-Header', $includesArray);
+
+?>
+