From 01032c63d3a04c40f32ff182d37269d5e38dd74f Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 4 Nov 2020 15:29:36 +0100 Subject: [PATCH 01/95] Update der Person in ALMA Tabelle, wenn Personen zusammengelegt werden MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Falls nur die zu löschende Person in ALMA vorhanden ist, mit der zu behaltenden Person ersetzen. Falls bereits die zu ersetzende UND zu löschende Person in ALMA vorhanden sind, muss erst direkt im ALMA Bibliothekssystem und in der tbl_alma gelöscht werden. Signed-off-by: Cris --- vilesci/stammdaten/personen_wartung.php | 47 +++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/vilesci/stammdaten/personen_wartung.php b/vilesci/stammdaten/personen_wartung.php index c143a1390..6f4e25cc4 100644 --- a/vilesci/stammdaten/personen_wartung.php +++ b/vilesci/stammdaten/personen_wartung.php @@ -135,6 +135,52 @@ if (isset($personToDelete) && isset($personToKeep) && $personToDelete >= 0 && $p } else { + // Wenn Person in ALMA Bibliothek vorkommt, ggf. die Person dort übernehmen + $alma_has_personToKeep = false; + $alma_has_personToDelete = false; + $alma_update_obj = new StdClass(); + $alma_query_upd = ''; + + $alma_query = " + SELECT * + FROM sync.tbl_alma + WHERE ( + person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " OR + person_id = " . $db->db_add_param($personToDelete, FHC_INTEGER) . " + )"; + + + if ($result = $db->db_query($alma_query)) + { + while ($row = $db->db_fetch_object($result)) + { + if ($row->person_id == $personToKeep) + { + $alma_has_personToKeep = true; + } + if ($row->person_id == $personToDelete) + { + $alma_has_personToDelete = true; + $alma_update_obj = $row; + } + } + } + + // Falls nur die zu löschende Person in ALMA vorhanden ist, mit der zu behaltenden Person ersetzen + if ($alma_has_personToDelete && !$alma_has_personToKeep) + { + $alma_query_upd = " + UPDATE sync.tbl_alma + SET person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " + WHERE alma_match_id = " . $alma_update_obj->alma_match_id . " + AND person_id = " . $alma_update_obj->person_id . ";"; + } + // Falls bereits doppelte Einträge in ALMA vorhanden sind, manuell lösen + elseif ($alma_has_personToDelete && $alma_has_personToKeep) + { + die('Es sind bereits beide Personen in ALMA vorhanden. Bitte zuerst direkt im ALMA Bibliotheksystem und in der tbl_alma lösen.'); + } + $personToDelete_obj = new person(); if ($personToDelete_obj->load($personToDelete)) { @@ -346,6 +392,7 @@ if (isset($personToDelete) && isset($personToKeep) && $personToDelete >= 0 && $p $sql_query_upd1 .= "UPDATE system.tbl_person_lock SET person_id=" . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; $sql_query_upd1 .= "UPDATE wawi.tbl_betriebsmittelperson SET person_id=" . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; $sql_query_upd1 .= "UPDATE wawi.tbl_konto SET person_id=" . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; + $sql_query_upd1 .= $alma_query_upd; $sql_query_upd1 .= "DELETE FROM public.tbl_person WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; From adb96ed33f0b7ca4f843d027f8e1a64e1fa98ad1 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 16 Nov 2020 15:11:08 +0100 Subject: [PATCH 02/95] Automatisch Personen in tbl_sap_students zusammenlegen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wenn doppelt angelegte Personen zusammengeführt werden, wird nun ggf auch in der Tabelle tbl_sap_students die hinterlegte Person upgedatet. Ausnahme: wenn in der tbl_sap_students die Person auch schon doppelt angelegt ist. In diesem Fall gibt es ein exit mit der Aufforderung, dies direkt (manuell) in der tbl_sap_students zu ändern. Signed-off-by: cris-technikum --- vilesci/stammdaten/personen_wartung.php | 48 +++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/vilesci/stammdaten/personen_wartung.php b/vilesci/stammdaten/personen_wartung.php index 6f4e25cc4..9cc0bba15 100644 --- a/vilesci/stammdaten/personen_wartung.php +++ b/vilesci/stammdaten/personen_wartung.php @@ -181,6 +181,53 @@ if (isset($personToDelete) && isset($personToKeep) && $personToDelete >= 0 && $p die('Es sind bereits beide Personen in ALMA vorhanden. Bitte zuerst direkt im ALMA Bibliotheksystem und in der tbl_alma lösen.'); } + + // Wenn Person in SAP students vorkommt, ggf. die Person dort übernehmen + $sap_students_has_personToKeep = false; + $sap_students_has_personToDelete = false; + $sap_students_update_obj = new StdClass(); + $sap_students_query_upd = ''; + + $sap_students_query = " + SELECT * + FROM sync.tbl_sap_students + WHERE ( + person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " OR + person_id = " . $db->db_add_param($personToDelete, FHC_INTEGER) . " + )"; + + if ($result = $db->db_query($sap_students_query)) + { + while ($row = $db->db_fetch_object($result)) + { + if ($row->person_id == $personToKeep) + { + $sap_students_has_personToKeep = true; + } + if ($row->person_id == $personToDelete) + { + $sap_students_has_personToDelete = true; + $sap_students_update_obj = $row; + } + } + } + + // Wenn die zu löschende Person in SAP students eingetragen ist, dann mit der zu behaltenden Person überschreiben + if ($sap_students_has_personToDelete && !$sap_students_has_personToKeep) + { + $sap_students_query_upd = " + UPDATE sync.tbl_sap_students + SET person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " + WHERE sap_user_id = " . $db->db_add_param($sap_students_update_obj->sap_user_id, FHC_STRING) . " + AND person_id = " . $sap_students_update_obj->person_id . ";"; + } + // Wenn doppelte Personeneinträge in SAP students vorhanden sind (zu löschende UND zu behaltende Person), + // dann manuell lösen + elseif ($sap_students_has_personToDelete && $sap_students_has_personToKeep) + { + die('Es sind bereits beide Personen in SAP vorhanden. Bitte zuerst direkt in der tbl_sap_students lösen.'); + } + $personToDelete_obj = new person(); if ($personToDelete_obj->load($personToDelete)) { @@ -393,6 +440,7 @@ if (isset($personToDelete) && isset($personToKeep) && $personToDelete >= 0 && $p $sql_query_upd1 .= "UPDATE wawi.tbl_betriebsmittelperson SET person_id=" . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; $sql_query_upd1 .= "UPDATE wawi.tbl_konto SET person_id=" . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; $sql_query_upd1 .= $alma_query_upd; + $sql_query_upd1 .= $sap_students_query_upd; $sql_query_upd1 .= "DELETE FROM public.tbl_person WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; From 4cbbd662b6f34722845bed3c48453911419b6610 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 16 Nov 2020 17:48:24 +0100 Subject: [PATCH 03/95] Automatisch Personen in tbl_sap_mitarbeiter zusammenlegen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Wenn doppelt angelegte Personen zusammengeführt werden, wird nun ggf auch in der Tabelle tbl_sap_mitarbeiter die hinterlegte Person upgedatet. Ausnahme: wenn in der tbl_sap_mitarbeiter die Person auch schon doppelt angelegt ist. In diesem Fall gibt es ein exit mit der Aufforderung, dies direkt (manuell) in der tbl_sap_mitarbeiter zu ändern. Signed-off-by: cris-technikum --- vilesci/stammdaten/personen_wartung.php | 145 ++++++++++++++++++------ 1 file changed, 110 insertions(+), 35 deletions(-) diff --git a/vilesci/stammdaten/personen_wartung.php b/vilesci/stammdaten/personen_wartung.php index 9cc0bba15..fdf3c0531 100644 --- a/vilesci/stammdaten/personen_wartung.php +++ b/vilesci/stammdaten/personen_wartung.php @@ -182,51 +182,117 @@ if (isset($personToDelete) && isset($personToKeep) && $personToDelete >= 0 && $p } - // Wenn Person in SAP students vorkommt, ggf. die Person dort übernehmen - $sap_students_has_personToKeep = false; - $sap_students_has_personToDelete = false; - $sap_students_update_obj = new StdClass(); - $sap_students_query_upd = ''; + // Prüfen, ob Person Mitarbeiter oder Student ist + $uid_toDelete = new Benutzer(); + $uid_toDelete->getBenutzerFromPerson($personToDelete); + $uid_toDelete = $uid_toDelete->result[0]->uid; - $sap_students_query = " + $mitarbeiter = new Mitarbeiter(); + $is_Mitarbeiter = $mitarbeiter->load($uid_toDelete); + + // Wenn Person Mitarbeiter ist, gegebenenfalls die SAP Mitarbeiter Tabelle updaten + if($is_Mitarbeiter) + { + $uid_toKeep = new Benutzer(); + $uid_toKeep->getBenutzerFromPerson($personToKeep); + $uid_toKeep = $uid_toKeep->result[0]->uid; + + // Wenn Person in SAP students vorkommt, ggf. die Person dort übernehmen + $sap_mitarbeiter_has_uidToKeep = false; + $sap_mitarbeiter_has_uidToDelete = false; + $sap_mitarbeiter_update_obj = new StdClass(); + $sap_mitarbeiter_query_upd = ''; + + $sap_mitarbeiter_query = " + SELECT * + FROM sync.tbl_sap_mitarbeiter + WHERE ( + mitarbeiter_uid = " . $db->db_add_param($uid_toKeep) . " OR + mitarbeiter_uid = " . $db->db_add_param($uid_toDelete) . " + )"; + + if ($result = $db->db_query($sap_mitarbeiter_query)) + { + while ($row = $db->db_fetch_object($result)) + { + if ($row->mitarbeiter_uid == $uid_toKeep) + { + $sap_mitarbeiter_has_uidToKeep = true; + } + if ($row->mitarbeiter_uid == $uid_toDelete) + { + $sap_mitarbeiter_has_uidToDelete = true; + $sap_mitarbeiter_update_obj = $row; + } + } + } + + // Wenn die zu löschende Person in SAP students eingetragen ist, dann mit der zu behaltenden Person überschreiben + if ($sap_mitarbeiter_has_uidToDelete && !$sap_mitarbeiter_has_uidToKeep) + { + $sap_mitarbeiter_query_upd = " + UPDATE sync.tbl_sap_mitarbeiter + SET mitarbeiter_uid = " . $db->db_add_param($uid_toKeep) . " + WHERE sap_eeid = " . $db->db_add_param($sap_mitarbeiter_update_obj->sap_eeid) . " + AND mitarbeiter_uid = " . $db->db_add_param($sap_mitarbeiter_update_obj->mitarbeiter_uid) . ";"; + } + // Wenn doppelte Personeneinträge in SAP students vorhanden sind (zu löschende UND zu behaltende Person), + // dann manuell lösen + elseif ($sap_mitarbeiter_has_uidToDelete && $sap_mitarbeiter_has_uidToKeep) + { + die('Es sind bereits beide Personen in SAP vorhanden. Bitte zuerst direkt in der tbl_sap_mitarbeiter lösen.'); + } + + } + // Wenn Person Student ist, gegebenenfalls die SAP Studenten Tabelle updaten + else + { + $sap_students_has_personToKeep = false; + $sap_students_has_personToDelete = false; + $sap_students_update_obj = new StdClass(); + $sap_students_query_upd = ''; + + $sap_students_query = " SELECT * FROM sync.tbl_sap_students WHERE ( person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " OR person_id = " . $db->db_add_param($personToDelete, FHC_INTEGER) . " )"; - - if ($result = $db->db_query($sap_students_query)) - { - while ($row = $db->db_fetch_object($result)) - { - if ($row->person_id == $personToKeep) - { - $sap_students_has_personToKeep = true; - } - if ($row->person_id == $personToDelete) - { - $sap_students_has_personToDelete = true; - $sap_students_update_obj = $row; - } - } - } - - // Wenn die zu löschende Person in SAP students eingetragen ist, dann mit der zu behaltenden Person überschreiben - if ($sap_students_has_personToDelete && !$sap_students_has_personToKeep) - { - $sap_students_query_upd = " + + if ($result = $db->db_query($sap_students_query)) + { + while ($row = $db->db_fetch_object($result)) + { + if ($row->person_id == $personToKeep) + { + $sap_students_has_personToKeep = true; + } + if ($row->person_id == $personToDelete) + { + $sap_students_has_personToDelete = true; + $sap_students_update_obj = $row; + } + } + } + + // Wenn die zu löschende Person in SAP students eingetragen ist, dann mit der zu behaltenden Person überschreiben + if ($sap_students_has_personToDelete && !$sap_students_has_personToKeep) + { + $sap_students_query_upd = " UPDATE sync.tbl_sap_students SET person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE sap_user_id = " . $db->db_add_param($sap_students_update_obj->sap_user_id, FHC_STRING) . " AND person_id = " . $sap_students_update_obj->person_id . ";"; - } - // Wenn doppelte Personeneinträge in SAP students vorhanden sind (zu löschende UND zu behaltende Person), - // dann manuell lösen - elseif ($sap_students_has_personToDelete && $sap_students_has_personToKeep) - { - die('Es sind bereits beide Personen in SAP vorhanden. Bitte zuerst direkt in der tbl_sap_students lösen.'); - } + } + // Wenn doppelte Personeneinträge in SAP students vorhanden sind (zu löschende UND zu behaltende Person), + // dann manuell lösen + elseif ($sap_students_has_personToDelete && $sap_students_has_personToKeep) + { + die('Es sind bereits beide Personen in SAP vorhanden. Bitte zuerst direkt in der tbl_sap_students lösen.'); + } + } + $personToDelete_obj = new person(); if ($personToDelete_obj->load($personToDelete)) @@ -440,7 +506,16 @@ if (isset($personToDelete) && isset($personToKeep) && $personToDelete >= 0 && $p $sql_query_upd1 .= "UPDATE wawi.tbl_betriebsmittelperson SET person_id=" . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; $sql_query_upd1 .= "UPDATE wawi.tbl_konto SET person_id=" . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; $sql_query_upd1 .= $alma_query_upd; - $sql_query_upd1 .= $sap_students_query_upd; + // Wenn Person Mitarbeiter ist, ggf. SAP Mitarbeiter updaten + if ($is_Mitarbeiter) + { + $sql_query_upd1 .= $sap_mitarbeiter_query_upd; + } + // Wenn Person Student ist, ggf. SAP Studententabelle updaten + if (!$is_Mitarbeiter) + { + $sql_query_upd1 .= $sap_students_query_upd; + } $sql_query_upd1 .= "DELETE FROM public.tbl_person WHERE person_id=" . $db->db_add_param($personToDelete, FHC_INTEGER) . ";"; From 34e3756d744817dfbd7f4f2e909b88403989339e Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 18 Nov 2020 13:14:59 +0100 Subject: [PATCH 04/95] Mitarbeiter zusammenlegen entfernt / Extension-Tabellen auf Vorhandensein pruefen - Mitarbeiter zusammenlegen entfernt. - Bevor Personen auch in extenstions zusammengelegt werden: pruefen, ob die entsprechenden Tabellen existieren. (diese sind nur vorhanden, wenn extensions FHC-Core-ALMA, FHC-Core-SAP installiert sind) Signed-off-by: cris-technikum --- vilesci/stammdaten/personen_wartung.php | 146 ++++++++++++------------ 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/vilesci/stammdaten/personen_wartung.php b/vilesci/stammdaten/personen_wartung.php index 9cc0bba15..2c4c4f0fa 100644 --- a/vilesci/stammdaten/personen_wartung.php +++ b/vilesci/stammdaten/personen_wartung.php @@ -135,97 +135,97 @@ if (isset($personToDelete) && isset($personToKeep) && $personToDelete >= 0 && $p } else { - // Wenn Person in ALMA Bibliothek vorkommt, ggf. die Person dort übernehmen - $alma_has_personToKeep = false; - $alma_has_personToDelete = false; - $alma_update_obj = new StdClass(); - $alma_query_upd = ''; - - $alma_query = " - SELECT * - FROM sync.tbl_alma - WHERE ( - person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " OR - person_id = " . $db->db_add_param($personToDelete, FHC_INTEGER) . " - )"; - - - if ($result = $db->db_query($alma_query)) + // Prüfen, ob tbl_alma existiert (also ob ALMA extension installiert ist) + if($result = @$db->db_query("SELECT 1 FROM sync.tbl_alma LIMIT 1")) { - while ($row = $db->db_fetch_object($result)) + // Wenn Person in ALMA Bibliothek vorkommt, ggf. die Person dort übernehmen + $alma_has_personToKeep = false; + $alma_has_personToDelete = false; + $alma_update_obj = new StdClass(); + $alma_query_upd = ''; + + $alma_query = " + SELECT * + FROM sync.tbl_alma + WHERE ( + person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " OR + person_id = " . $db->db_add_param($personToDelete, FHC_INTEGER) . " + )"; + + if ($result = $db->db_query($alma_query)) { - if ($row->person_id == $personToKeep) + while ($row = $db->db_fetch_object($result)) { - $alma_has_personToKeep = true; - } - if ($row->person_id == $personToDelete) - { - $alma_has_personToDelete = true; - $alma_update_obj = $row; + if ($row->person_id == $personToKeep) + { + $alma_has_personToKeep = true; + } + if ($row->person_id == $personToDelete) + { + $alma_has_personToDelete = true; + $alma_update_obj = $row; + } } } - } - - // Falls nur die zu löschende Person in ALMA vorhanden ist, mit der zu behaltenden Person ersetzen - if ($alma_has_personToDelete && !$alma_has_personToKeep) + + // Falls nur die zu löschende Person in ALMA vorhanden ist, mit der zu behaltenden Person ersetzen + if ($alma_has_personToDelete && !$alma_has_personToKeep) + { + $alma_query_upd = " + UPDATE sync.tbl_alma + SET person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " + WHERE alma_match_id = " . $alma_update_obj->alma_match_id . " + AND person_id = " . $alma_update_obj->person_id . ";"; + } + // Falls bereits doppelte Einträge in ALMA vorhanden sind (zu löschende und zu behaltende), manuell lösen + elseif ($alma_has_personToDelete && $alma_has_personToKeep) + { + die('Es sind bereits beide Personen in ALMA vorhanden. Bitte zuerst direkt im ALMA Bibliotheksystem und in der tbl_alma lösen.'); + } + } + + // Prüfen, ob tbl_sap_students exisitiert + if($result = @$db->db_query("SELECT 1 FROM sync.tbl_sap_students LIMIT 1")) { - $alma_query_upd = " - UPDATE sync.tbl_alma - SET person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " - WHERE alma_match_id = " . $alma_update_obj->alma_match_id . " - AND person_id = " . $alma_update_obj->person_id . ";"; - } - // Falls bereits doppelte Einträge in ALMA vorhanden sind, manuell lösen - elseif ($alma_has_personToDelete && $alma_has_personToKeep) - { - die('Es sind bereits beide Personen in ALMA vorhanden. Bitte zuerst direkt im ALMA Bibliotheksystem und in der tbl_alma lösen.'); - } - - - // Wenn Person in SAP students vorkommt, ggf. die Person dort übernehmen - $sap_students_has_personToKeep = false; - $sap_students_has_personToDelete = false; - $sap_students_update_obj = new StdClass(); - $sap_students_query_upd = ''; - - $sap_students_query = " + // Wenn Person in SAP students vorkommt, ggf. die Person dort übernehmen + $sap_students_has_personToKeep = false; + $sap_students_has_personToDelete = false; + $sap_students_update_obj = new StdClass(); + $sap_students_query_upd = ''; + + $sap_students_query = " SELECT * FROM sync.tbl_sap_students WHERE ( person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " OR person_id = " . $db->db_add_param($personToDelete, FHC_INTEGER) . " )"; - - if ($result = $db->db_query($sap_students_query)) - { - while ($row = $db->db_fetch_object($result)) - { - if ($row->person_id == $personToKeep) - { - $sap_students_has_personToKeep = true; - } - if ($row->person_id == $personToDelete) - { - $sap_students_has_personToDelete = true; - $sap_students_update_obj = $row; + + if ($result = $db->db_query($sap_students_query)) { + while ($row = $db->db_fetch_object($result)) { + if ($row->person_id == $personToKeep) { + $sap_students_has_personToKeep = true; + } + if ($row->person_id == $personToDelete) { + $sap_students_has_personToDelete = true; + $sap_students_update_obj = $row; + } } } - } - - // Wenn die zu löschende Person in SAP students eingetragen ist, dann mit der zu behaltenden Person überschreiben - if ($sap_students_has_personToDelete && !$sap_students_has_personToKeep) - { - $sap_students_query_upd = " + + // Wenn die zu löschende Person in SAP students eingetragen ist, dann mit der zu behaltenden Person überschreiben + if ($sap_students_has_personToDelete && !$sap_students_has_personToKeep) { + $sap_students_query_upd = " UPDATE sync.tbl_sap_students SET person_id = " . $db->db_add_param($personToKeep, FHC_INTEGER) . " WHERE sap_user_id = " . $db->db_add_param($sap_students_update_obj->sap_user_id, FHC_STRING) . " AND person_id = " . $sap_students_update_obj->person_id . ";"; - } - // Wenn doppelte Personeneinträge in SAP students vorhanden sind (zu löschende UND zu behaltende Person), - // dann manuell lösen - elseif ($sap_students_has_personToDelete && $sap_students_has_personToKeep) - { - die('Es sind bereits beide Personen in SAP vorhanden. Bitte zuerst direkt in der tbl_sap_students lösen.'); + } + // Wenn doppelte Personeneinträge in SAP students vorhanden sind (zu löschende UND zu behaltende Person), + // dann manuell lösen + elseif ($sap_students_has_personToDelete && $sap_students_has_personToKeep) { + die('Es sind bereits beide Personen in SAP vorhanden. Bitte zuerst direkt in der tbl_sap_students lösen.'); + } } $personToDelete_obj = new person(); From c3ab40282b1035d7e97efd058c2020b4427f8915 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Wed, 16 Dec 2020 16:39:43 +0100 Subject: [PATCH 05/95] add azgrelevant column and alter zeitaufzeichnung column in bis.tbl_bisverwendung --- system/dbupdate_3.3.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 2336ebad4..dafec165d 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4465,6 +4465,21 @@ if($result = $db->db_query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE } } +// ADD COLUMN azgrelevant in bis.tbl_bisverwendung +if(!$result = @$db->db_query("SELECT incoming FROM bis.tbl_bisverwendung LIMIT 1")) +{ + $qry = " + ALTER TABLE bis.tbl_bisverwendung ADD COLUMN azgrelevant boolean; + UPDATE bis.tbl_bisverwendung SET azgrelevant = zeitaufzeichnungspflichtig; + UPDATE bis.tbl_bisverwendung SET zeitaufzeichnungspflichtig = true WHERE ba1code=103; + "; + + if(!$db->db_query($qry)) + echo 'bis.tbl_bisverwendung: '.$db->db_last_error().'
'; + else + echo '
bis.tbl_bisverwendung Spalte azgrelevant hinzugefügt.'; +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; From 30960adf8179e2131ce5df4e2b262e87c380ca88 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Mon, 21 Dec 2020 08:55:33 +0100 Subject: [PATCH 06/95] fix typo in query --- system/dbupdate_3.3.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index dafec165d..e01105db6 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4466,7 +4466,7 @@ if($result = $db->db_query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE } // ADD COLUMN azgrelevant in bis.tbl_bisverwendung -if(!$result = @$db->db_query("SELECT incoming FROM bis.tbl_bisverwendung LIMIT 1")) +if(!$result = @$db->db_query("SELECT azgrelevant FROM bis.tbl_bisverwendung LIMIT 1")) { $qry = " ALTER TABLE bis.tbl_bisverwendung ADD COLUMN azgrelevant boolean; From d62b1bead4692c7f9f97ea1bcf1aaa922a48e989 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Mon, 21 Dec 2020 09:27:23 +0100 Subject: [PATCH 07/95] change table --- include/bisverwendung.class.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index 9d92db489..798b2213b 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -47,6 +47,7 @@ class bisverwendung extends basis_db public $dv_art; public $inkludierte_lehre; public $zeitaufzeichnungspflichtig; + public $azgrelevant; public $ba1bez; public $ba2bez; @@ -122,6 +123,7 @@ class bisverwendung extends basis_db $this->dv_art = $row->dv_art; $this->inkludierte_lehre = $row->inkludierte_lehre; $this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $this->azgrelevant = $this->db_parse_bool($row->azgrelevant); return true; } else @@ -359,7 +361,7 @@ class bisverwendung extends basis_db $obj->dv_art = $row->dv_art; $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); - + $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); $this->result[] = $obj; } return true; @@ -416,6 +418,7 @@ class bisverwendung extends basis_db $obj->dv_art = $row->dv_art; $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); $this->result[] = $obj; } @@ -474,6 +477,7 @@ class bisverwendung extends basis_db $obj->dv_art = $row->dv_art; $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); $this->result[] = $obj; } @@ -525,6 +529,7 @@ class bisverwendung extends basis_db $this->dv_art = $row->dv_art; $this->inkludierte_lehre = $row->inkludierte_lehre; $this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $this->azgrelevant = $this->db_parse_bool($row->azgrelevant); } return true; } @@ -578,6 +583,7 @@ class bisverwendung extends basis_db $this->dv_art = $row->dv_art; $this->inkludierte_lehre = $row->inkludierte_lehre; $this->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $this->azgrelevant = $this->db_parse_bool($row->azgrelevant); } return true; } @@ -640,6 +646,7 @@ class bisverwendung extends basis_db $obj->dv_art = $row->dv_art; $obj->inkludierte_lehre = $row->inkludierte_lehre; $obj->zeitaufzeichnungspflichtig = $this->db_parse_bool($row->zeitaufzeichnungspflichtig); + $obj->azgrelevant = $this->db_parse_bool($row->azgrelevant); $this->result[] = $obj; } From 8441345d7a5e228300d611384bcd7ad574516736 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Tue, 19 Jan 2021 13:22:47 +0100 Subject: [PATCH 08/95] add azgrelevant to save method in bisverwendungclass --- include/bisverwendung.class.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index 798b2213b..774fe413f 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -220,13 +220,21 @@ class bisverwendung extends basis_db { $zeitaufzeichnungspflichtig = 'null'; } + if(is_bool($this->azgrelevant)) + { + $azgrelevant = $this->db_add_param($this->azgrelevant, FHC_BOOLEAN); + } + else + { + $azgrelevant = 'null'; + } if($new) { //Neuen Datensatz anlegen $qry = "BEGIN;INSERT INTO bis.tbl_bisverwendung (ba1code, ba2code, beschausmasscode, verwendung_code, mitarbeiter_uid, hauptberufcode, hauptberuflich, habilitation, beginn, ende, vertragsstunden, - updateamum, updatevon, insertamum, insertvon, dv_art, inkludierte_lehre, zeitaufzeichnungspflichtig) VALUES (". + updateamum, updatevon, insertamum, insertvon, dv_art, inkludierte_lehre, zeitaufzeichnungspflichtig, azgrelevant) VALUES (". $this->db_add_param($this->ba1code, FHC_INTEGER).', '. $this->db_add_param($this->ba2code, FHC_INTEGER).', '. $this->db_add_param($this->beschausmasscode, FHC_INTEGER).', '. @@ -244,7 +252,8 @@ class bisverwendung extends basis_db $this->db_add_param($this->insertvon).', '. $this->db_add_param($this->dv_art).','. $this->db_add_param($this->inkludierte_lehre).','. - $zeitaufzeichnungspflichtig. ');'; + $zeitaufzeichnungspflichtig.','. + $azgrelevant. ');'; } else @@ -268,7 +277,8 @@ class bisverwendung extends basis_db " insertvon=".$this->db_add_param($this->insertvon).",". " dv_art=".$this->db_add_param($this->dv_art).",". " inkludierte_lehre=".$this->db_add_param($this->inkludierte_lehre).",". - " zeitaufzeichnungspflichtig=". $zeitaufzeichnungspflichtig. + " zeitaufzeichnungspflichtig=". $zeitaufzeichnungspflichtig.",". + " azgrelevant =". $azgrelevant. " WHERE bisverwendung_id=".$this->db_add_param($this->bisverwendung_id, FHC_INTEGER); } From 943961127faaa084fc2947f41de8f79fcf6ac9a4 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Tue, 19 Jan 2021 16:15:03 +0100 Subject: [PATCH 09/95] implement checkbox --- content/mitarbeiter/mitarbeiterDBDML.php | 8 +++++++- content/mitarbeiter/mitarbeiteroverlay.js.php | 2 ++ .../mitarbeiter/mitarbeiterverwendungdialog.js.php | 14 +++++++++++++- .../mitarbeiterverwendungdialog.xul.php | 4 ++++ 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/content/mitarbeiter/mitarbeiterDBDML.php b/content/mitarbeiter/mitarbeiterDBDML.php index 6bb1513d0..eb7ba6650 100644 --- a/content/mitarbeiter/mitarbeiterDBDML.php +++ b/content/mitarbeiter/mitarbeiterDBDML.php @@ -174,7 +174,13 @@ if(!$error) elseif($_POST['zeitaufzeichnungspflichtig']=='false') $verwendung->zeitaufzeichnungspflichtig = false; else - $verwendung->zeitaufzeichnungspflichtig = ''; + $verwendung->azgrelevant = ''; + if($_POST['azgrelevant']=='true') + $verwendung->azgrelevant = true; + elseif($_POST['azgrelevant']=='false') + $verwendung->azgrelevant = false; + else + $verwendung->azgrelevant = ''; if($verwendung->save()) { diff --git a/content/mitarbeiter/mitarbeiteroverlay.js.php b/content/mitarbeiter/mitarbeiteroverlay.js.php index d0aa4f40d..adf7bdf90 100644 --- a/content/mitarbeiter/mitarbeiteroverlay.js.php +++ b/content/mitarbeiter/mitarbeiteroverlay.js.php @@ -1210,6 +1210,7 @@ function MitarbeiterVerwendungSpeichern(dialog, bisverwendung_id, mitarbeiter_ui dv_art = dialog.getElementById('mitarbeiter-verwendung-detail-textbox-dv_art').value; inkludierte_lehre = dialog.getElementById('mitarbeiter-verwendung-detail-textbox-inkludierte_lehre').value; zeitaufzeichnungspflichtig = dialog.getElementById('mitarbeiter-verwendung-detail-checkbox-zeitaufzeichnungspflichtig').checked; + azgrelevant = dialog.getElementById('mitarbeiter-verwendung-detail-checkbox-azgrelevant').checked; if(verwendung_code=='1') { @@ -1268,6 +1269,7 @@ function MitarbeiterVerwendungSpeichern(dialog, bisverwendung_id, mitarbeiter_ui req.add('dv_art', dv_art); req.add('inkludierte_lehre', inkludierte_lehre); req.add('zeitaufzeichnungspflichtig', zeitaufzeichnungspflichtig); + req.add('azgrelevant', azgrelevant); var response = req.executePOST(); diff --git a/content/mitarbeiter/mitarbeiterverwendungdialog.js.php b/content/mitarbeiter/mitarbeiterverwendungdialog.js.php index 841f167e9..123f471f8 100644 --- a/content/mitarbeiter/mitarbeiterverwendungdialog.js.php +++ b/content/mitarbeiter/mitarbeiterverwendungdialog.js.php @@ -70,6 +70,7 @@ function MitarbeiterVerwendungInit(mitarbeiter_uid, bisverwendung_id) dv_art = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#dv_art" )); inkludierte_lehre = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#inkludierte_lehre" )); zeitaufzeichnungspflichtig = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#zeitaufzeichnungspflichtig" )); + azgrelevant = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#azgrelevant" )); } else { @@ -112,6 +113,14 @@ function MitarbeiterVerwendungInit(mitarbeiter_uid, bisverwendung_id) { zeitaufzeichnungspflichtig='Nein'; } + if (azgrelevant=='Ja') + { + azgrelevant='Ja'; + } + else + { + azgrelevant='Nein'; + } } document.getElementById('mitarbeiter-verwendung-detail-menulist-beschart1').value=ba1code; @@ -138,7 +147,10 @@ function MitarbeiterVerwendungInit(mitarbeiter_uid, bisverwendung_id) document.getElementById('mitarbeiter-verwendung-detail-checkbox-zeitaufzeichnungspflichtig').checked=true; else document.getElementById('mitarbeiter-verwendung-detail-checkbox-zeitaufzeichnungspflichtig').checked=false; - + if(azgrelevant=='Ja') + document.getElementById('mitarbeiter-verwendung-detail-checkbox-azgrelevant').checked=true; + else + document.getElementById('mitarbeiter-verwendung-detail-checkbox-azgrelevant').checked=false; MitarbeiterVerwendungDetailToggleHauptberuf(); MitarbeiterVerwendungVerwendungChange(); } diff --git a/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php b/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php index bc87a097d..492b2f838 100644 --- a/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php +++ b/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php @@ -167,6 +167,10 @@ echo ' + + From 935b37016673dae276c0f0382a986502259aac8d Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 17 Feb 2021 15:07:09 +0100 Subject: [PATCH 10/95] added filter for bachelor and master --- application/config/infocenter.php | 5 ++ application/controllers/system/Variables.php | 16 +++- application/libraries/VariableLib.php | 12 +++ .../models/system/Variablenname_model.php | 3 +- .../system/infocenter/infocenterData.php | 10 +-- .../infocenter/infocenterFreigegebenData.php | 9 +- .../infocenterReihungstestAbsolviertData.php | 9 +- .../js/infocenter/infocenterPersonDataset.js | 90 +++++++++++++++++-- system/dbupdate_3.3.php | 1 + 9 files changed, 126 insertions(+), 29 deletions(-) create mode 100644 application/config/infocenter.php diff --git a/application/config/infocenter.php b/application/config/infocenter.php new file mode 100644 index 000000000..555c30996 --- /dev/null +++ b/application/config/infocenter.php @@ -0,0 +1,5 @@ + 'basis/variable:rw', 'getVar' => 'basis/variable:rw', - 'changeStudiensemesterVar' => 'basis/variable:rw' + 'changeStudiensemesterVar' => 'basis/variable:rw', + 'changeStudengangsTypVar' => 'basis/variable:rw' ) ); @@ -50,7 +51,9 @@ class Variables extends Auth_Controller public function getVar() { $name = $this->input->get('name'); - $this->outputJson($this->VariableModel->getVariables($this->_uid, array($name))); + $typ = $this->input->get('typ'); + + $this->outputJson($this->VariableModel->getVariables($this->_uid, array($name, $typ))); } /** @@ -66,6 +69,15 @@ class Variables extends Auth_Controller $this->outputJson($result); } + public function changeStudengangsTypVar() + { + $name = $this->input->post('name'); + $change = $this->input->post('change'); + + $result = $this->variablelib->changeStudengangsTypVar($this->_uid, $name, $change); + $this->outputJson($result); + } + /** * Retrieve the UID of the logged user and checks if it is valid */ diff --git a/application/libraries/VariableLib.php b/application/libraries/VariableLib.php index 2f038531b..a503eb999 100644 --- a/application/libraries/VariableLib.php +++ b/application/libraries/VariableLib.php @@ -100,6 +100,18 @@ class VariableLib return $result; } + public function changeStudengangsTypVar($uid, $name, $change) + { + $result = error('error when setting variable!'); + + if (isEmptyString($uid) || isEmptyString($name) || isEmptyString($change)) + return $result; + + $result = $this->_ci->VariableModel->setVariable($uid, $name, $change); + $this->_setVariable($uid, $name); + return $result; + } + /** * "Refreshes" variable value with given name by retrieving current value from db and saving it. * @param $uid diff --git a/application/models/system/Variablenname_model.php b/application/models/system/Variablenname_model.php index 7b2a2cf88..005834f67 100644 --- a/application/models/system/Variablenname_model.php +++ b/application/models/system/Variablenname_model.php @@ -11,7 +11,8 @@ class Variablenname_model extends DB_Model ORDER BY studienjahr_kurzbz, start ) sem WHERE start > now() - LIMIT 1;' + LIMIT 1;', + 'infocenter_studiensgangtyp' => 'SELECT infocenter_studiensgangtyp FROM public.tbl_variablename LIMIT 1' ); /** diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 0c7030059..d9f12eb56 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -1,16 +1,17 @@ config->load('infocenter'); $APP = '\'infocenter\''; $REJECTED_STATUS = '\'Abgewiesener\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\', \'Interessent rejected\''; $LOGDATA_NAME_PARKED = '\'Parked\''; $LOGDATA_NAME_ONHOLD = '\'Onhold\''; $LOGTYPE_KURZBZ = '\'Processstate\''; $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; - $ADDITIONAL_STG = '10021,10027'; + $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $AKTE_TYP = '\'identity\', \'zgv_bakk\''; $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; @@ -142,10 +143,7 @@ AND pss.bewerbung_abgeschicktamum IS NOT NULL -- AND pss.bestaetigtam IS NULL AND ps.person_id = p.person_id - AND (sg.typ IN ('.$STUDIENGANG_TYP.') - OR - sg.studiengang_kz in('.$ADDITIONAL_STG.') - ) + AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' AND NOT EXISTS ( SELECT 1 diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index aab69b651..3b7ff1dbe 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -1,12 +1,13 @@ config->load('infocenter'); $APP = '\'infocenter\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; $REJECTED_STATUS = '\'Abgewiesener\''; - $ADDITIONAL_STG = '10021,10027,10002'; + $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; @@ -109,10 +110,6 @@ WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND pss.bewerbung_abgeschicktamum IS NOT NULL AND ps.person_id = p.person_id - AND (sg.typ IN ('.$STUDIENGANG_TYP.') - OR - sg.studiengang_kz in('.$ADDITIONAL_STG.') - ) AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' LIMIT 1 ) AS "StgAbgeschickt", diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 22b122bb0..6b0918174 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -1,11 +1,12 @@ config->load('infocenter'); $APP = '\'infocenter\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\''.$this->variablelib->getVar('infocenter_studiensgangtyp').'\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; - $ADDITIONAL_STG = '10021,10027'; + $ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz'); $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $query = ' @@ -90,10 +91,6 @@ WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND pss.bewerbung_abgeschicktamum IS NOT NULL AND ps.person_id = p.person_id - AND (sg.typ IN ('.$STUDIENGANG_TYP.') - OR - sg.studiengang_kz in('.$ADDITIONAL_STG.') - ) AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' LIMIT 1 ) AS "StgAbgeschickt", diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 87a40c0f1..03d1d13a1 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -20,22 +20,30 @@ if (FHC_JS_DATA_STORAGE_OBJECT.called_method == 'index') */ var InfocenterPersonDataset = { infocenter_studiensemester_variablename: 'infocenter_studiensemester', + infocenter_studienganstyp_variablename: 'infocenter_studiensgangtyp', /** * adds person table additional actions html (above and beneath it) */ - appendTableActionsHtml: function(infocenter_studiensemester) + appendTableActionsHtml: function(infocenter_studiensemester, infocenter_studiengangstyp) { var url = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + "/system/messages/Messages/writeTemplate"; var formHtml = '
'; $("#datasetActionsTop").before(formHtml); - var studienSemesterHtml = ' ' + infocenter_studiensemester + - ' '; @@ -56,9 +64,19 @@ var InfocenterPersonDataset = { // userdefined Semestervariable shown independently of personcount, // it is possible to change the semester $("#datasetActionsTop, #datasetActionsBottom").append( - "
"+ - "
"+studienSemesterHtml+"
"+ - "

"); + "
" + + "
" + auswahlStudienart + "
" + + "
" + studienSemesterHtml + "
" + + "
" + + "

" + ); + + InfocenterPersonDataset.selectStudiengangTyp(infocenter_studiengangstyp) + + $('.auswahlStudienArt').change(function() + { + InfocenterPersonDataset.changeStudengangsTyp($(this).find('option:selected').attr('data-id')); + }); $("button.incStudiensemester").click(function() { InfocenterPersonDataset.changeStudiensemesterUservar(1); @@ -115,6 +133,22 @@ var InfocenterPersonDataset = { ); }, + selectStudiengangTyp: function(typ) + { + switch (typ) + { + case 'b, m' : + $('.auswahlStudienArt [data-id="all"]').attr('selected', 'selected'); + break; + case 'b' : + $('.auswahlStudienArt [data-id="bachelor"]').attr('selected', 'selected'); + break; + case 'm' : + $('.auswahlStudienArt [data-id="master"]').attr('selected', 'selected'); + break; + } + }, + /** * sets functionality for the actions above and beneath the person table */ @@ -173,6 +207,45 @@ var InfocenterPersonDataset = { }); }, + changeStudengangsTyp: function($typ) + { + switch ($typ) + { + case 'all' : + var change = 'b\', \'m'; + break; + case 'bachelor' : + var change = 'b'; + break; + case 'master' : + var change = 'm'; + break; + } + + FHC_AjaxClient.showVeil(); + + FHC_AjaxClient.ajaxCallPost( + 'system/Variables/changeStudengangsTypVar', + { + 'name': InfocenterPersonDataset.infocenter_studienganstyp_variablename, + 'change': change, + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + // refresh filterwidget with page reload + FHC_FilterWidget.reloadDataset(); + } + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + FHC_AjaxClient.hideVeil(); + alert(textStatus); + } + } + ); + }, + /** * initializes change of the uservariable infocenter_studiensemesster, either * to next semester (change > 0) or previous semester (change < 0) @@ -211,7 +284,8 @@ var InfocenterPersonDataset = { FHC_AjaxClient.ajaxCallGet( 'system/Variables/getVar', { - 'name': InfocenterPersonDataset.infocenter_studiensemester_variablename + 'name' : InfocenterPersonDataset.infocenter_studiensemester_variablename, + 'typ' : InfocenterPersonDataset.infocenter_studienganstyp_variablename }, { successCallback: function(data, textStatus, jqXHR) { @@ -220,7 +294,7 @@ var InfocenterPersonDataset = { if (typeof callback === "function") { var infocenter_studiensemester = FHC_AjaxClient.getData(data); - callback(infocenter_studiensemester[InfocenterPersonDataset.infocenter_studiensemester_variablename]); + callback(infocenter_studiensemester[InfocenterPersonDataset.infocenter_studiensemester_variablename], infocenter_studiensemester[InfocenterPersonDataset.infocenter_studienganstyp_variablename]); } } }, diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 2336ebad4..4ed52c321 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -3232,6 +3232,7 @@ if(!@$db->db_query("SELECT 0 FROM public.tbl_variablenname WHERE 0 = 1")) INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'kontofilterstg\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'kollision_student\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'infocenter_studiensemester\', null); + INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'infocenter_studiensgangtyp\', \'b\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_zeitsperre\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_reservierung\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_kollision\', \'false\'); From d9cbea680e4c30660842bda00064b45ac5d188bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 25 Feb 2021 15:25:41 +0100 Subject: [PATCH 11/95] Fixed Loading of AZG Relevant Checkbox in FAS Fixed missing Column Warning in DB Update --- .../mitarbeiter/mitarbeiterverwendungdialog.xul.php | 2 +- rdf/bisverwendung.rdf.php | 10 ++++++++-- system/dbupdate_3.3.php | 4 ++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php b/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php index 492b2f838..197df7d27 100644 --- a/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php +++ b/content/mitarbeiter/mitarbeiterverwendungdialog.xul.php @@ -168,7 +168,7 @@ echo '
- diff --git a/rdf/bisverwendung.rdf.php b/rdf/bisverwendung.rdf.php index 81eb1f444..16e6daba5 100644 --- a/rdf/bisverwendung.rdf.php +++ b/rdf/bisverwendung.rdf.php @@ -84,12 +84,17 @@ function draw_row($row) $hauptberuflich = $row->hauptberuflich?'Ja':'Nein'; else $hauptberuflich = ''; - + if(is_bool($row->zeitaufzeichnungspflichtig)) $zeitaufzeichnungspflichtig = $row->zeitaufzeichnungspflichtig?'Ja':'Nein'; else $zeitaufzeichnungspflichtig = ''; - + + if(is_bool($row->azgrelevant)) + $azgrelevant = $row->azgrelevant?'Ja':'Nein'; + else + $azgrelevant = ''; + echo ' @@ -119,6 +124,7 @@ function draw_row($row) dv_art.']]> inkludierte_lehre.']]> + '; diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 3e6b82111..97bae6eab 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4471,8 +4471,8 @@ if(!$result = @$db->db_query("SELECT azgrelevant FROM bis.tbl_bisverwendung LIMI $qry = " ALTER TABLE bis.tbl_bisverwendung ADD COLUMN azgrelevant boolean; UPDATE bis.tbl_bisverwendung SET azgrelevant = zeitaufzeichnungspflichtig; - UPDATE bis.tbl_bisverwendung SET zeitaufzeichnungspflichtig = true WHERE ba1code=103; - "; + UPDATE bis.tbl_bisverwendung SET zeitaufzeichnungspflichtig = true WHERE ba1code=103 AND beschausmasscode!=5; + "; if(!$db->db_query($qry)) echo 'bis.tbl_bisverwendung: '.$db->db_last_error().'
'; From 95c2e4bf9cbaecae638bae66206939844f0fc568 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Fri, 26 Feb 2021 00:25:59 +0100 Subject: [PATCH 12/95] fix true false --- .../mitarbeiter/mitarbeiterverwendungdialog.js.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/content/mitarbeiter/mitarbeiterverwendungdialog.js.php b/content/mitarbeiter/mitarbeiterverwendungdialog.js.php index 123f471f8..1119c468d 100644 --- a/content/mitarbeiter/mitarbeiterverwendungdialog.js.php +++ b/content/mitarbeiter/mitarbeiterverwendungdialog.js.php @@ -88,7 +88,7 @@ function MitarbeiterVerwendungInit(mitarbeiter_uid, bisverwendung_id) var predicateNS = "http://www.technikum-wien.at/mitarbeiter/rdf"; fixangestellt = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#fixangestellt" )); - + azgrelevant = getTargetHelper(dsource,subject,rdfService.GetResource( predicateNS + "#azgrelevant" )); //neuer Datensatz wird angelegt MitarbeiterVerwendungDetailNeu='true'; @@ -113,13 +113,13 @@ function MitarbeiterVerwendungInit(mitarbeiter_uid, bisverwendung_id) { zeitaufzeichnungspflichtig='Nein'; } - if (azgrelevant=='Ja') + if (!azgrelevant) { - azgrelevant='Ja'; + azgrelevant='Nein'; } else { - azgrelevant='Nein'; + azgrelevant='Ja'; } } @@ -147,10 +147,10 @@ function MitarbeiterVerwendungInit(mitarbeiter_uid, bisverwendung_id) document.getElementById('mitarbeiter-verwendung-detail-checkbox-zeitaufzeichnungspflichtig').checked=true; else document.getElementById('mitarbeiter-verwendung-detail-checkbox-zeitaufzeichnungspflichtig').checked=false; - if(azgrelevant=='Ja') - document.getElementById('mitarbeiter-verwendung-detail-checkbox-azgrelevant').checked=true; - else + if(azgrelevant=='Nein') document.getElementById('mitarbeiter-verwendung-detail-checkbox-azgrelevant').checked=false; + else + document.getElementById('mitarbeiter-verwendung-detail-checkbox-azgrelevant').checked=true; MitarbeiterVerwendungDetailToggleHauptberuf(); MitarbeiterVerwendungVerwendungChange(); } From fb7835de57adb18f4e89a03b365e795744330d4f Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 8 Mar 2021 12:53:59 +0100 Subject: [PATCH 13/95] added new zeitwuensche permission --- system/checkroles.php | 2 +- system/checksystem.php | 1 + vilesci/personen/lektor_uebersicht.php | 3 ++- vilesci/personen/zeitwunsch.php | 15 ++++++++++++--- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/system/checkroles.php b/system/checkroles.php index 54839437e..1f57857a1 100644 --- a/system/checkroles.php +++ b/system/checkroles.php @@ -54,7 +54,7 @@ $data = array 'rolle_kurzbz' => 'admin', 'berechtigung' => array ( - 'admin', 'assistenz', 'basis/addon', 'basis/ampel', 'basis/ampeluebersicht', 'basis/benutzer', 'basis/berechtigung', 'basis/betriebsmittel', 'basis/cms', 'basis/cms_review', 'basis/cms_sperrfreigabe', 'basis/cronjob', 'basis/dms', 'basis/fas', 'basis/ferien', 'basis/fhausweis','basis/firma', 'basis/infoscreen', 'basis/moodle', 'basis/moodle','basis/news', 'basis/notiz', 'basis/organisationseinheit', 'basis/ort', 'basis/orgform', 'basis/person', 'basis/planner', 'basis/service', 'basis/statistik', 'basis/studiengang', 'basis/tempus', 'basis/testtool', 'basis/variable', 'basis/vilesci', 'buchung/typen', 'buchung/mitarbeiter', 'inout/incoming', 'inout/outgoing', 'inout/uebersicht', 'lehre', 'lehre/abgabetool', 'lehre/freifach', 'lehre/lehrfach', 'lehre/lehrveranstaltung', 'lehre/lvplan', 'lehre/lvinfo', 'lehre/pruefungsanmeldungAdmin', 'lehre/pruefungsbeurteilung', 'lehre/pruefungsbeurteilungAdmin', 'lehre/pruefungsterminAdmin', 'lehre/pruefungsfenster', 'lehre/reihungstest', 'lehre/reservierung', 'lehre/studienordnung', 'lehre/studienordnungInaktiv', 'lehre/studienplan', 'lehre/vorrueckung', 'lv-plan', 'lv-plan/gruppenentfernen', 'lv-plan/lektorentfernen', 'mitarbeiter', 'mitarbeiter/bankdaten', 'mitarbeiter/personalnummer', 'mitarbeiter/stammdaten', 'mitarbeiter/urlaube', 'mitarbeiter/zeitsperre', 'news', 'planner', 'preinteressent', 'raumres', 'reihungstest', 'sdTools', 'soap/lv', 'soap/lvplan', 'soap/mitarbeiter', 'soap/ort', 'soap/pruefungsfenster', 'soap/student', 'soap/studienordnung', 'soap/benutzer', 'soap/buchungen', 'student/bankdaten', 'student/anrechnung', 'student/anwesenheit', 'student/dokumente', 'student/noten', 'system/phrase', 'system/vorlage', 'system/vorlagestudiengang', 'student/stammdaten', 'student/vorrueckung', 'system/developer', 'system/loginasuser', 'user', 'veranstaltung', 'vertrag/mitarbeiter', 'vertrag/typen', 'wawi/berichte', 'wawi/bestellung', 'wawi/bestellung_advanced', 'wawi/budget', 'wawi/delete_advanced', 'wawi/firma', 'wawi/freigabe', 'wawi/freigabe_advanced', 'wawi/inventar', 'wawi/konto', 'wawi/kostenstelle', 'wawi/rechnung', 'wawi/rechnung_freigeben', 'wawi/rechnung_transfer', 'wawi/storno' + 'admin', 'assistenz', 'basis/addon', 'basis/ampel', 'basis/ampeluebersicht', 'basis/benutzer', 'basis/berechtigung', 'basis/betriebsmittel', 'basis/cms', 'basis/cms_review', 'basis/cms_sperrfreigabe', 'basis/cronjob', 'basis/dms', 'basis/fas', 'basis/ferien', 'basis/fhausweis','basis/firma', 'basis/infoscreen', 'basis/moodle', 'basis/moodle','basis/news', 'basis/notiz', 'basis/organisationseinheit', 'basis/ort', 'basis/orgform', 'basis/person', 'basis/planner', 'basis/service', 'basis/statistik', 'basis/studiengang', 'basis/tempus', 'basis/testtool', 'basis/variable', 'basis/vilesci', 'buchung/typen', 'buchung/mitarbeiter', 'inout/incoming', 'inout/outgoing', 'inout/uebersicht', 'lehre', 'lehre/abgabetool', 'lehre/freifach', 'lehre/lehrfach', 'lehre/lehrveranstaltung', 'lehre/lvplan', 'lehre/lvinfo', 'lehre/pruefungsanmeldungAdmin', 'lehre/pruefungsbeurteilung', 'lehre/pruefungsbeurteilungAdmin', 'lehre/pruefungsterminAdmin', 'lehre/pruefungsfenster', 'lehre/reihungstest', 'lehre/reservierung', 'lehre/studienordnung', 'lehre/studienordnungInaktiv', 'lehre/studienplan', 'lehre/vorrueckung', 'lv-plan', 'lv-plan/gruppenentfernen', 'lv-plan/lektorentfernen', 'mitarbeiter', 'mitarbeiter/bankdaten', 'mitarbeiter/personalnummer', 'mitarbeiter/stammdaten', 'mitarbeiter/urlaube', 'mitarbeiter/zeitsperre', 'mitarbeiter/zeitwuensche', 'news', 'planner', 'preinteressent', 'raumres', 'reihungstest', 'sdTools', 'soap/lv', 'soap/lvplan', 'soap/mitarbeiter', 'soap/ort', 'soap/pruefungsfenster', 'soap/student', 'soap/studienordnung', 'soap/benutzer', 'soap/buchungen', 'student/bankdaten', 'student/anrechnung', 'student/anwesenheit', 'student/dokumente', 'student/noten', 'system/phrase', 'system/vorlage', 'system/vorlagestudiengang', 'student/stammdaten', 'student/vorrueckung', 'system/developer', 'system/loginasuser', 'user', 'veranstaltung', 'vertrag/mitarbeiter', 'vertrag/typen', 'wawi/berichte', 'wawi/bestellung', 'wawi/bestellung_advanced', 'wawi/budget', 'wawi/delete_advanced', 'wawi/firma', 'wawi/freigabe', 'wawi/freigabe_advanced', 'wawi/inventar', 'wawi/konto', 'wawi/kostenstelle', 'wawi/rechnung', 'wawi/rechnung_freigeben', 'wawi/rechnung_transfer', 'wawi/storno' ) ) ); diff --git a/system/checksystem.php b/system/checksystem.php index 3253dd5d4..5f03a55ef 100644 --- a/system/checksystem.php +++ b/system/checksystem.php @@ -171,6 +171,7 @@ $berechtigungen = array( array('mitarbeiter/stammdaten','Stammdaten der Mitarbeiter'), array('mitarbeiter/urlaube','Mit diesem Recht werden im CIS die Urlaube von allen Mitarbeiter sichtbar'), array('mitarbeiter/zeitsperre','Zeitsperren- und Urlaubsverwaltung'), + array('mitarbeiter/zeitwuensche','Berechtigung um Zeitwünsche zu editieren'), array('news','News eintragen'), array('planner','Planner Verwaltung'), array('preinteressent','Verwaltung der Preinteressenten'), diff --git a/vilesci/personen/lektor_uebersicht.php b/vilesci/personen/lektor_uebersicht.php index 0a1f9b1cc..f96bbac27 100644 --- a/vilesci/personen/lektor_uebersicht.php +++ b/vilesci/personen/lektor_uebersicht.php @@ -106,7 +106,8 @@ if(!isset($_GET['searchstr'])) $email=$row->uid.'@'.DOMAIN; echo "$email"; - echo "Edit"; + if($rechte->isBerechtigt('student/stammdaten', null, 's') || $rechte->isBerechtigt('mitarbeiter/stammdaten', null, 's')) + echo "Edit"; echo ""; if ($row->lektor) { diff --git a/vilesci/personen/zeitwunsch.php b/vilesci/personen/zeitwunsch.php index 36f1c5e87..b5f88f97f 100644 --- a/vilesci/personen/zeitwunsch.php +++ b/vilesci/personen/zeitwunsch.php @@ -157,7 +157,13 @@ $updatevon = 0; ?> isBerechtigt('mitarbeiter/zeitwuensche', null, 'suid')) + $readonly = ''; + + for ($j=1; $j<7; $j++) { echo ''.$tagbez[1][$j].''; for ($i=0;$i<$num_rows_stunde;$i++) @@ -166,7 +172,7 @@ $updatevon = 0; if ($index=="") $index=1; $bgcolor=$cfgStdBgcolor[$index+3]; - echo ''; + echo ''; } echo ''; } @@ -189,7 +195,10 @@ $updatevon = 0;

- + isBerechtigt('mitarbeiter/zeitwuensche', null, 'suid')) + echo '' + ?>

From 287cddf926b4eb6d7442ff06a6ac0b12be3c7fdf Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 23 Mar 2021 09:25:24 +0100 Subject: [PATCH 14/95] added zgv ueberpruefung --- application/config/navigation.php | 9 + .../system/infocenter/InfoCenter.php | 254 +++++++++++++++++- .../system/infocenter/ZGVUeberpruefung.php | 33 +++ .../models/crm/ZGVPruefungStatus_model.php | 17 ++ application/models/crm/ZGVPruefung_model.php | 17 ++ .../views/system/infocenter/dokpruefung.php | 23 +- .../infocenter/infocenterZgvDetails.php | 203 ++++++++++++++ .../infocenter/infocenterZgvUeberpruefung.php | 49 ++++ .../infocenterZgvUeberpruefungData.php | 63 +++++ .../views/system/infocenter/zgvpruefungen.php | 26 +- public/js/infocenter/infocenterDetails.js | 99 +++++++ system/checkroles.php | 2 +- system/checksystem.php | 1 + system/dbupdate_3.3.php | 99 +++++++ system/filtersupdate.php | 8 + system/phrasesupdate.php | 120 +++++++++ 16 files changed, 1010 insertions(+), 13 deletions(-) create mode 100644 application/controllers/system/infocenter/ZGVUeberpruefung.php create mode 100644 application/models/crm/ZGVPruefungStatus_model.php create mode 100644 application/models/crm/ZGVPruefung_model.php create mode 100644 application/views/system/infocenter/infocenterZgvDetails.php create mode 100644 application/views/system/infocenter/infocenterZgvUeberpruefung.php create mode 100644 application/views/system/infocenter/infocenterZgvUeberpruefungData.php diff --git a/application/config/navigation.php b/application/config/navigation.php index 84004b58e..c2d221a80 100644 --- a/application/config/navigation.php +++ b/application/config/navigation.php @@ -62,6 +62,15 @@ $config['navigation_header'] = array( 'lehre/lehrauftrag_bestellen:r', 'lehre/lehrauftrag_erteilen:r' ) + ), + 'zgvueberpruefung' => array( + 'link' => site_url('system/infocenter/ZGVUeberpruefung'), + 'description' => 'ZGV Überprüfung', + 'expand' => true, + 'sort' => 50, + 'requiredPermissions' => array( + 'lehre/zgvpruefung:r' + ) ) ) ), diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 43de8bb60..46fe09c10 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -12,6 +12,7 @@ class InfoCenter extends Auth_Controller const APP = 'infocenter'; const TAETIGKEIT = 'bewerbung'; const FREIGABE_MAIL_VORLAGE = 'InfocenterMailFreigabeAssistenz'; + const ZGVPRUEFUNG_MAIL_VORLAGE = 'InfocenterMailZgvUeberpruefung'; const INFOCENTER_URI = 'system/infocenter/InfoCenter'; // URL prefix for this controller const INDEX_PAGE = 'index'; @@ -85,6 +86,7 @@ class InfoCenter extends Auth_Controller 'freigegeben' => 'infocenter:r', 'reihungstestAbsolviert' => 'infocenter:r', 'showDetails' => 'infocenter:r', + 'showZGVDetails' => 'infocenter:r', 'unlockPerson' => 'infocenter:rw', 'saveFormalGeprueft' => 'infocenter:rw', 'getPrestudentData' => 'infocenter:r', @@ -92,6 +94,8 @@ class InfoCenter extends Auth_Controller 'getZgvInfoForPrestudent' => 'infocenter:r', 'saveBewPriorisierung' => 'infocenter:rw', 'saveZgvPruefung' => 'infocenter:rw', + 'zgvRueckfragen' => 'infocenter:rw', + 'zgvStatusUpdate' => 'infocenter:rw', 'saveAbsage' => 'infocenter:rw', 'saveFreigabe' => 'infocenter:rw', 'getNotiz' => 'infocenter:r', @@ -117,6 +121,8 @@ class InfoCenter extends Auth_Controller $this->load->model('crm/Prestudent_model', 'PrestudentModel'); $this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel'); $this->load->model('crm/Statusgrund_model', 'StatusgrundModel'); + $this->load->model('crm/ZGVPruefung_model', 'ZGVPruefungModel'); + $this->load->model('crm/ZGVPruefungStatus_model', 'ZGVPruefungStatusModel'); $this->load->model('person/Notiz_model', 'NotizModel'); $this->load->model('person/Person_model', 'PersonModel'); $this->load->model('system/Message_model', 'MessageModel'); @@ -178,6 +184,63 @@ class InfoCenter extends Auth_Controller $this->load->view('system/infocenter/infocenterReihungstestAbsolviert.php'); } + /** + * Prestudenten/ZGV übersicht + * Holt sich die Informationen zu den ZGV vom Prestudenten und zeigt die dann an + */ + public function showZGVDetails() + { + $prestudent_id = $this->input->get('prestudent_id'); + + if (!is_numeric($prestudent_id)) + show_error('prestudent id is not numeric!'); + + $prestudentexists = $this->PrestudentModel->load($prestudent_id); + + if (isError($prestudentexists)) + show_error(getError($prestudentexists)); + + if (!hasData($prestudentexists)) + show_error('Prestudent does not exist!'); + + $zgvExist = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + + if (isError($zgvExist)) + show_error(getError($zgvExist)); + + if (!hasData($zgvExist)) + show_error('ZGV does not exist!'); + + $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); + $this->ZGVPruefungStatusModel->addLimit(1); + + $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgvExist->retval[0]->zgvpruefung_id)); + + if (isError($statusZGV)) + show_error(getError($statusZGV)); + + if (!hasData($statusZGV)) + show_error('ZGV has no status.'); + + $statusZGV = array('status' => $statusZGV->retval[0]->status); + $origin_page = $this->input->get(self::ORIGIN_PAGE); + + + $persondata = $this->_loadPersonData($prestudentexists->retval[0]->person_id); + + $prestudent_id = array('prestudent_id' => $prestudent_id); + $data = array_merge( + $persondata, + $prestudent_id, + $statusZGV + ); + + $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); + $data[self::ORIGIN_PAGE] = $origin_page; + $data[self::PREV_FILTER_ID] = $this->input->get(self::PREV_FILTER_ID); + + $this->load->view('system/infocenter/infocenterZgvDetails.php', $data); + } /** * Personal details page of the InfoCenter tool * Initialization function, gets person and prestudent data and loads the view with the data @@ -429,6 +492,180 @@ class InfoCenter extends Auth_Controller $this->outputJson($json); } + /** + * Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang + */ + private function sendZgvMail($mail){ + $data = array( + 'DataTest' => 'getestet.' + ); + $this->load->helper('hlp_sancho'); + sendSanchoMail( + self::ZGVPRUEFUNG_MAIL_VORLAGE, + $data, + $mail, + 'ZGV Ueberpruefung', + 'sancho_header_min_bw.jpg', + 'sancho_footer_min_bw.jpg' + ); + + return true; + } + + /** + * Der Status von den ZGV wird geupdated + */ + public function zgvStatusUpdate() + { + $prestudent_id = $this->input->post('prestudent_id'); + $person_id = $this->input->post('person_id'); + $status = $this->input->post('status'); + + if (isEmptyString($prestudent_id) && isEmptyString($person_id) && isEmptyString($status)) + return $this->outputJsonError('Some data is missing'); + + $zgv = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + + if (!hasData($zgv)) + return $this->outputJsonError('ZGV nicht gefunden'); + + $zgv = getData($zgv); + + $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); + $this->ZGVPruefungStatusModel->addLimit(1); + $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgv[0]->zgvpruefung_id)); + + if (!hasData($statusZGV)) + return $this->outputJsonError('ZGV-Status nicht gefunden'); + + $statusZGV = getData($statusZGV); + + if ($statusZGV[0]->status === 'rejected' && $status === 'rejected') + return $this->outputJsonError('Bereits abgelehnt worden'); + elseif ($statusZGV[0]->status === 'accepted' && $status === 'accepted') + return $this->outputJsonError('Bereits akzeptiert worden'); + + + $insert = $this->ZGVPruefungStatusModel->insert( + array( + 'zgvpruefung_id' => $zgv[0]->zgvpruefung_id, + 'status' => $status + ) + ); + + $update = $this->ZGVPruefungModel->update( + $zgv[0]->zgvpruefung_id, + array( + 'updateamum' => date('Y-m-d H:i:s'), + 'updatevon' => $this->_uid + ) + ); + + if (isError($insert) && isError($update)) + return $this->outputJsonError('Fehler beim Speichern'); + + $personInfos = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + + $this->outputJsonSuccess( + array + ( + 'msg' => 'Erfolgreich gespeichert', + 'person_id' => $personInfos['person_id'] + ) + ); + + } + + /** + * Fügt einen neuen ZGV Status hinzu oder updated einen bestehenden + * Falls es erfolgreich war, sendet er die Mail raus + */ + public function zgvRueckfragen() + { + $prestudent_id = $this->input->post('prestudent_id'); + $person_id = $this->input->post('person_id'); + + if (isEmptyString($prestudent_id) && isEmptyString($person_id)) + return $this->outputJsonError('Prestudentid OR/AND Personid missing'); + + $zgv = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + $sg = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + $mail = $sg['studiengang_mail']; + + if (hasData($zgv)) + { + $zgv = getData($zgv); + + $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); + $this->ZGVPruefungStatusModel->addLimit(1); + $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgv[0]->zgvpruefung_id)); + + if (!hasData($statusZGV)) + return $this->outputJsonError('ZGV-Status nicht gefunden'); + + $statusZGV = getData($statusZGV); + + if ($statusZGV[0]->status === 'pruefung_stg') + return $this->outputJsonError('Bereits in Prüfung'); + + $insert = $this->ZGVPruefungStatusModel->insert( + array( + 'zgvpruefung_id' => $zgv[0]->zgvpruefung_id, + 'status' => 'pruefung_stg' + ) + ); + + $update = $this->ZGVPruefungModel->update( + $zgv[0]->zgvpruefung_id, + array( + 'updateamum' => date('Y-m-d H:i:s'), + 'updatevon' => $this->_uid + ) + ); + + if (isSuccess($insert) && isSuccess($update)) + $mailStatus = $this->sendZgvMail($mail); + elseif (isError($insert) && isError($update)) + return $this->outputJsonError('Fehler beim Speichern'); + + }else + { + $insert = $this->ZGVPruefungModel->insert( + array( + 'prestudent_id' => $prestudent_id, + 'insertamum' => date('Y-m-d H:i:s'), + 'insertvon' => $this->_uid + ) + ); + + if (isSuccess($insert)) + { + $zgvpruefung_id = $this->ZGVPruefungModel->db->insert_id(); + $result = $this->ZGVPruefungStatusModel->insert( + array( + 'zgvpruefung_id' => $zgvpruefung_id, + 'status' => 'pruefung_stg' + ) + ); + + if (isSuccess($result)) + $mailStatus = $this->sendZgvMail($mail); + elseif (isError($result)) + return $this->outputJsonError('Fehler beim Speichern'); + } + } + if ($mailStatus) + { + $this->outputJsonSuccess( + array + ( + 'msg' => 'Erfolgreich gespeichert', + 'person_id' => $sg['person_id'] + ) + ); + } + } + /** * Saves Absage for Prestudent including the reason for the Absage (statusgrund). * inserts Studiensemester and Ausbildungssemester for the new Absage of (chronologically) last status. @@ -1421,8 +1658,20 @@ class InfoCenter extends Auth_Controller $zgvpruefung->changedown = $this->PrestudentModel->checkPrioChange($zgvpruefung->prestudent_id, $studiensemester, 1); } } + $zgvExist = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $zgvpruefung->prestudent_id)); - $zgvpruefungen[] = $zgvpruefung; + if (isSuccess($zgvExist) && hasData($zgvExist)) + { + $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); + $this->ZGVPruefungStatusModel->addLimit(1); + + $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgvExist->retval[0]->zgvpruefung_id)); + + if (isSuccess($statusZGV) && hasData($statusZGV)) + $zgvpruefung->statusZGV = $statusZGV->retval[0]->status; + } + + $zgvpruefungen[] = $zgvpruefung; } $this->_sortPrestudents($zgvpruefungen); @@ -1545,8 +1794,9 @@ class InfoCenter extends Auth_Controller $person_id = $prestudentdata->person_id; $studiengang_kurzbz = $prestudentdata->studiengang; $studiengang_bezeichnung = $prestudentdata->studiengangbezeichnung; + $studiengang_mail = $prestudentdata->studiengangmail; - return array('person_id' => $person_id, 'studiengang_kurzbz' => $studiengang_kurzbz, 'studiengang_bezeichnung' => $studiengang_bezeichnung); + return array('person_id' => $person_id, 'studiengang_kurzbz' => $studiengang_kurzbz, 'studiengang_bezeichnung' => $studiengang_bezeichnung, 'studiengang_mail' => $studiengang_mail); } /** diff --git a/application/controllers/system/infocenter/ZGVUeberpruefung.php b/application/controllers/system/infocenter/ZGVUeberpruefung.php new file mode 100644 index 000000000..21728ea99 --- /dev/null +++ b/application/controllers/system/infocenter/ZGVUeberpruefung.php @@ -0,0 +1,33 @@ + 'lehre/zgvpruefung:r', + ) + ); + + $this->load->library('WidgetLib'); + $this->setControllerId(); // sets the controller id + } + + public function index() + { + + try{ + $this->load->view('system/infocenter/infocenterZgvUeberpruefung.php'); + }catch(Exception $e) + { + var_dump($e); + } + } +} \ No newline at end of file diff --git a/application/models/crm/ZGVPruefungStatus_model.php b/application/models/crm/ZGVPruefungStatus_model.php new file mode 100644 index 000000000..75e57cb05 --- /dev/null +++ b/application/models/crm/ZGVPruefungStatus_model.php @@ -0,0 +1,17 @@ +dbTable = 'public.tbl_zgvpruefungstatus_status'; + $this->pk = 'zgv_pruefung_status_id'; + $this->hasSequence = true; + } + +} \ No newline at end of file diff --git a/application/models/crm/ZGVPruefung_model.php b/application/models/crm/ZGVPruefung_model.php new file mode 100644 index 000000000..f8fd0a9ad --- /dev/null +++ b/application/models/crm/ZGVPruefung_model.php @@ -0,0 +1,17 @@ +dbTable = 'public.tbl_zgvpruefung'; + $this->pk = 'zgvpruefung_id'; + $this->hasSequence = true; + } + +} \ No newline at end of file diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index 7c431fc46..aa76bbd52 100644 --- a/application/views/system/infocenter/dokpruefung.php +++ b/application/views/system/infocenter/dokpruefung.php @@ -6,7 +6,10 @@ p->t('global','typ')) ?> p->t('global','uploaddatum')) ?> p->t('infocenter','ausstellungsnation')) ?> - p->t('infocenter','formalGeprueft')) ?> + " . ucfirst($this->p->t('infocenter','formalGeprueft')) . "" + ?> @@ -21,13 +24,17 @@ dokument_bezeichnung ?> erstelltam), 'd.m.Y') ?> langtext ?> - - > - - formal_geprueft_amum) ? date_format(date_create($dokument->formal_geprueft_amum), 'd.m.Y') : ''; ?> - - + + + > + + formal_geprueft_amum) ? date_format(date_create($dokument->formal_geprueft_amum), 'd.m.Y') : ''; ?> + + + diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php new file mode 100644 index 000000000..c6af4c436 --- /dev/null +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -0,0 +1,203 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'InfocenterZgvDetails', + 'jquery' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'jqueryui' => true, + 'dialoglib' => true, + 'ajaxlib' => true, + 'tablesorter' => true, + 'tinymce' => true, + 'sbadmintemplate' => true, + 'addons' => true, + 'navigationwidget' => true, + 'udfs' => true, + 'widgets' => true, + 'customCSSs' => array( + 'public/css/sbadmin2/admintemplate.css', + 'public/css/sbadmin2/tablesort_bootstrap.css', + 'public/css/infocenter/infocenterDetails.css' + ), + 'customJSs' => array( + 'public/js/bootstrapper.js', + 'public/js/tablesort/tablesort.js', + 'public/js/infocenter/messageList.js', + 'public/js/infocenter/infocenterDetails.js' + ), + 'phrases' => array( + 'infocenter' => array( + 'notizHinzufuegen', + 'notizAendern', + 'nichtsZumEntfernen', + 'fehlerBeimEntfernen', + 'zgvInPruefung', + 'zgvAkzeptiert', + 'zgvAbgelehnt' + ), + 'ui' => array( + 'gespeichert', + 'fehlerBeimSpeichern' + ), + 'global' => array( + 'bis', + 'zeilen' + ) + ) + ) + ); +?> + +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+ +
+
+ +
+
+
+ p->t('global', 'wirdBearbeitetVon').': '; + echo $lockedby; + if ($origin_page == 'index'): + $unlockpath = 'unlockPerson/'.$stammdaten->person_id; + $unlockpath .= '?fhc_controller_id='.$fhc_controller_id; + $unlockpath .= '&filter_id='.$prev_filter_id; + ?> +    + +  p->t('ui', 'freigeben')) ?> + + + +   + +
+
+
+
+
+
+
+
+
+

p->t('global', 'stammdaten')) ?>

+
+
+ load->view('system/infocenter/stammdaten.php'); ?> + load->view('system/infocenter/anmerkungenZurBewerbung.php'); ?> +
+
+
+
+
+
+
+
+
+ +
+

+ p->t('infocenter', 'dokumentenpruefung')) ?> +

+
+
+ load->view('system/infocenter/dokpruefung.php', array('formalReadonly' => true)); ?> +
+ +
+ + + + p->t('infocenter', 'zgvInPruefung'); + break; + case 'accepted' : + echo $this->p->t('infocenter', 'zgvAkzeptiert'); + break; + case 'rejected' : + echo $this->p->t('infocenter', 'zgvAbgelehnt'); + break; + } + ?> + + +
+
+
+
+
+ +
+
+
+
+
+ +

+ p->t('global', 'nachrichten')) ?> +

+
+
+
+ load->view('system/infocenter/messageList.php', $messages); + ?> +
+
+
+
+
+
+
+
+
+
+
+ +

+ p->t('global', 'notizen'))?> +

+
+
+
+
+
+ load->view('system/infocenter/addNotiz.php'); ?> +
+
+ load->view('system/infocenter/notizen.php'); ?> +
+
+ +
+
+
+
+
+
+
+
+
+ + + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/system/infocenter/infocenterZgvUeberpruefung.php b/application/views/system/infocenter/infocenterZgvUeberpruefung.php new file mode 100644 index 000000000..e0b8f9eae --- /dev/null +++ b/application/views/system/infocenter/infocenterZgvUeberpruefung.php @@ -0,0 +1,49 @@ +load->view( + 'templates/FHC-Header', + array( + 'title' => 'Info Center', + 'jquery' => true, + 'jqueryui' => true, + 'jquerycheckboxes' => true, + 'bootstrap' => true, + 'fontawesome' => true, + 'sbadmintemplate' => true, + 'tablesorter' => true, + 'ajaxlib' => true, + 'filterwidget' => true, + 'navigationwidget' => true, + 'phrases' => array( + 'person' => array('vorname', 'nachname'), + 'global' => array('mailAnXversandt'), + 'ui' => array('bitteEintragWaehlen') + ), + 'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterZgv.css'), + 'customJSs' => array('public/js/bootstrapper.js') + ) +); +?> + + +
+ + widgetlib->widget('NavigationWidget'); ?> + +
+
+
+
+ +
+
+
+ load->view('system/infocenter/infocenterZgvUeberpruefungData.php'); ?> +
+
+
+
+ + +load->view('templates/FHC-Footer'); ?> diff --git a/application/views/system/infocenter/infocenterZgvUeberpruefungData.php b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php new file mode 100644 index 000000000..ff1b85d9e --- /dev/null +++ b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php @@ -0,0 +1,63 @@ +getBerechtigungen($uid); +$oeKurz = $rechte->getOEkurzbz('lehre/zgvpruefung'); +$oeKurz = '\''. implode('\',\'', $oeKurz) . '\''; + +$query = ' + SELECT + ps.prestudent_id AS "PreStudentID", + p.vorname AS "Vorname", + p.nachname AS "Nachname", + sg.kurzbzlang AS "Studiengang" + FROM public.tbl_zgvpruefungstatus_status zgvstatus + JOIN public.tbl_zgvpruefung zgv USING (zgvpruefung_id) + JOIN public.tbl_prestudent ps USING (prestudent_id) + JOIN public.tbl_person p USING(person_id) + JOIN public.tbl_studiengang sg USING(studiengang_kz) + WHERE zgvstatus.status = ' . $STATUS . ' + AND oe_kurzbz IN ('. $oeKurz .') + AND zgvstatus.datum IN ( + SELECT MAX(zgvstatus.datum) + FROM public.tbl_zgvpruefungstatus_status zgvstatus GROUP BY zgvstatus.zgvpruefung_id) + ORDER BY ps.prestudent_id + '; + +$filterWidgetArray = array( + 'query' => $query, + 'app' => 'infocenter', + 'datasetName' => 'zgvUeberpruefung', + 'filter_id' => $this->input->get('filter_id'), + 'requiredPermissions' => 'infocenter', + 'datasetRepresentation' => 'tablesorter', + 'additionalColumns' => array('Details'), + 'hideOptions' => true, + 'columnsAliases' => array( + + ), + 'formatRow' => function($datasetRaw) { + + /* NOTE: Dont use $this here for PHP Version compatibility */ + $datasetRaw->{'Details'} = sprintf( + 'Details', + site_url('system/infocenter/InfoCenter/showZGVDetails'), + $datasetRaw->{'PreStudentID'}, + 'zgvUeberpruefung', + (isset($_GET['fhc_controller_id']) ? $_GET['fhc_controller_id'] : ''), + (isset($_GET['filter_id']) ? $_GET['filter_id'] : '') + ); + + return $datasetRaw; + }, +); + +echo $this->widgetlib->widget('FilterWidget', $filterWidgetArray); +?> diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 41b549616..eccbbd4ee 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -311,12 +311,34 @@
-
+
+ + + statusZGV)) + { + switch ($zgvpruefung->statusZGV) + { + case 'pruefung_stg' : + echo $this->p->t('infocenter', 'zgvInPruefung'); + break; + case 'accepted' : + echo $this->p->t('infocenter', 'zgvAkzeptiert'); + break; + case 'rejected' : + echo $this->p->t('infocenter', 'zgvAbgelehnt'); + break; + } + } + ?> +
-
+
diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 7023af277..d0668bbbc 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -221,6 +221,71 @@ var InfocenterDetails = { } ); }, + zgvRueckfragen: function(data) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/zgvRueckfragen', + data, + { + successCallback: function(data, textStatus, jqXHR) + { + if (FHC_AjaxClient.hasData(data)) + { + var response = FHC_AjaxClient.getData(data); + + var date = new Date(); + date.setDate(date.getDate() + 14); + + var dd = date.getDate(); + var mm = date.getMonth() + 1; + var y = date.getFullYear(); + + var formatedDate = mm + '/'+ dd + '/'+ y; + InfocenterDetails.setPersonOnHold(response.person_id, formatedDate); + + $('#zgvStatusText').text(FHC_PhrasesLib.t('infocenter', 'zgvInPruefung')); + InfocenterDetails._refreshZgv(); + FHC_DialogLib.alertSuccess(response.msg); + } else if(FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError((jqXHR.responseText)); + } + } + ); + }, + zgvStatusUpdate: function(data) + { + var status = data.status; + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/zgvStatusUpdate', + data, + { + successCallback: function(data, textStatus, jqXHR) + { + if (FHC_AjaxClient.hasData(data)) + { + var response = FHC_AjaxClient.getData(data) + FHC_DialogLib.alertSuccess(response.msg); + InfocenterDetails.removePersonOnHold(response.person_id); + if (status === 'rejected') + var p = 'zgvAbgelehnt' + else if (status === 'accepted') + var p = 'zgvAkzeptiert'; + $('#zgvStatusText').text(FHC_PhrasesLib.t('infocenter', p)); + } else if (FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError((jqXHR.responseText)); + } + } + ); + }, + saveZgv: function(data) { var zgvError = function(){ @@ -746,6 +811,40 @@ var InfocenterDetails = { InfocenterDetails.zgvUebernehmen(personid, prestudentid, btn); }); + $('.zgvRueckfragen').click(function () + { + //var btn = $(this); + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + //$('#zgvUebernehmenNotice').remove(); + var data = { + 'person_id' : personid, + 'prestudent_id' : prestudentid + } + InfocenterDetails.zgvRueckfragen(data); + }); + + $('.zgvAkzeptieren').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + + var data = { + 'person_id' : personid, + 'prestudent_id' : prestudentid, + 'status' : 'accepted' + } + InfocenterDetails.zgvStatusUpdate(data); + }); + + $('.zgvAblehnen').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + + var data = { + 'person_id' : personid, + 'prestudent_id' : prestudentid, + 'status' : 'rejected' + } + InfocenterDetails.zgvStatusUpdate(data); + }); + //zgv speichern $(".saveZgv").click(function () { diff --git a/system/checkroles.php b/system/checkroles.php index 54839437e..9fae66ad3 100644 --- a/system/checkroles.php +++ b/system/checkroles.php @@ -54,7 +54,7 @@ $data = array 'rolle_kurzbz' => 'admin', 'berechtigung' => array ( - 'admin', 'assistenz', 'basis/addon', 'basis/ampel', 'basis/ampeluebersicht', 'basis/benutzer', 'basis/berechtigung', 'basis/betriebsmittel', 'basis/cms', 'basis/cms_review', 'basis/cms_sperrfreigabe', 'basis/cronjob', 'basis/dms', 'basis/fas', 'basis/ferien', 'basis/fhausweis','basis/firma', 'basis/infoscreen', 'basis/moodle', 'basis/moodle','basis/news', 'basis/notiz', 'basis/organisationseinheit', 'basis/ort', 'basis/orgform', 'basis/person', 'basis/planner', 'basis/service', 'basis/statistik', 'basis/studiengang', 'basis/tempus', 'basis/testtool', 'basis/variable', 'basis/vilesci', 'buchung/typen', 'buchung/mitarbeiter', 'inout/incoming', 'inout/outgoing', 'inout/uebersicht', 'lehre', 'lehre/abgabetool', 'lehre/freifach', 'lehre/lehrfach', 'lehre/lehrveranstaltung', 'lehre/lvplan', 'lehre/lvinfo', 'lehre/pruefungsanmeldungAdmin', 'lehre/pruefungsbeurteilung', 'lehre/pruefungsbeurteilungAdmin', 'lehre/pruefungsterminAdmin', 'lehre/pruefungsfenster', 'lehre/reihungstest', 'lehre/reservierung', 'lehre/studienordnung', 'lehre/studienordnungInaktiv', 'lehre/studienplan', 'lehre/vorrueckung', 'lv-plan', 'lv-plan/gruppenentfernen', 'lv-plan/lektorentfernen', 'mitarbeiter', 'mitarbeiter/bankdaten', 'mitarbeiter/personalnummer', 'mitarbeiter/stammdaten', 'mitarbeiter/urlaube', 'mitarbeiter/zeitsperre', 'news', 'planner', 'preinteressent', 'raumres', 'reihungstest', 'sdTools', 'soap/lv', 'soap/lvplan', 'soap/mitarbeiter', 'soap/ort', 'soap/pruefungsfenster', 'soap/student', 'soap/studienordnung', 'soap/benutzer', 'soap/buchungen', 'student/bankdaten', 'student/anrechnung', 'student/anwesenheit', 'student/dokumente', 'student/noten', 'system/phrase', 'system/vorlage', 'system/vorlagestudiengang', 'student/stammdaten', 'student/vorrueckung', 'system/developer', 'system/loginasuser', 'user', 'veranstaltung', 'vertrag/mitarbeiter', 'vertrag/typen', 'wawi/berichte', 'wawi/bestellung', 'wawi/bestellung_advanced', 'wawi/budget', 'wawi/delete_advanced', 'wawi/firma', 'wawi/freigabe', 'wawi/freigabe_advanced', 'wawi/inventar', 'wawi/konto', 'wawi/kostenstelle', 'wawi/rechnung', 'wawi/rechnung_freigeben', 'wawi/rechnung_transfer', 'wawi/storno' + 'admin', 'assistenz', 'basis/addon', 'basis/ampel', 'basis/ampeluebersicht', 'basis/benutzer', 'basis/berechtigung', 'basis/betriebsmittel', 'basis/cms', 'basis/cms_review', 'basis/cms_sperrfreigabe', 'basis/cronjob', 'basis/dms', 'basis/fas', 'basis/ferien', 'basis/fhausweis','basis/firma', 'basis/infoscreen', 'basis/moodle', 'basis/moodle','basis/news', 'basis/notiz', 'basis/organisationseinheit', 'basis/ort', 'basis/orgform', 'basis/person', 'basis/planner', 'basis/service', 'basis/statistik', 'basis/studiengang', 'basis/tempus', 'basis/testtool', 'basis/variable', 'basis/vilesci', 'buchung/typen', 'buchung/mitarbeiter', 'inout/incoming', 'inout/outgoing', 'inout/uebersicht', 'lehre', 'lehre/abgabetool', 'lehre/freifach', 'lehre/lehrfach', 'lehre/lehrveranstaltung', 'lehre/lvplan', 'lehre/lvinfo', 'lehre/pruefungsanmeldungAdmin', 'lehre/pruefungsbeurteilung', 'lehre/pruefungsbeurteilungAdmin', 'lehre/pruefungsterminAdmin', 'lehre/pruefungsfenster', 'lehre/reihungstest', 'lehre/reservierung', 'lehre/studienordnung', 'lehre/studienordnungInaktiv', 'lehre/studienplan', 'lehre/vorrueckung', 'lehre/zgvpruefung', 'lv-plan', 'lv-plan/gruppenentfernen', 'lv-plan/lektorentfernen', 'mitarbeiter', 'mitarbeiter/bankdaten', 'mitarbeiter/personalnummer', 'mitarbeiter/stammdaten', 'mitarbeiter/urlaube', 'mitarbeiter/zeitsperre', 'news', 'planner', 'preinteressent', 'raumres', 'reihungstest', 'sdTools', 'soap/lv', 'soap/lvplan', 'soap/mitarbeiter', 'soap/ort', 'soap/pruefungsfenster', 'soap/student', 'soap/studienordnung', 'soap/benutzer', 'soap/buchungen', 'student/bankdaten', 'student/anrechnung', 'student/anwesenheit', 'student/dokumente', 'student/noten', 'system/phrase', 'system/vorlage', 'system/vorlagestudiengang', 'student/stammdaten', 'student/vorrueckung', 'system/developer', 'system/loginasuser', 'user', 'veranstaltung', 'vertrag/mitarbeiter', 'vertrag/typen', 'wawi/berichte', 'wawi/bestellung', 'wawi/bestellung_advanced', 'wawi/budget', 'wawi/delete_advanced', 'wawi/firma', 'wawi/freigabe', 'wawi/freigabe_advanced', 'wawi/inventar', 'wawi/konto', 'wawi/kostenstelle', 'wawi/rechnung', 'wawi/rechnung_freigeben', 'wawi/rechnung_transfer', 'wawi/storno' ) ) ); diff --git a/system/checksystem.php b/system/checksystem.php index 3253dd5d4..164762f3a 100644 --- a/system/checksystem.php +++ b/system/checksystem.php @@ -162,6 +162,7 @@ $berechtigungen = array( array('lehre/studienordnungInaktiv','Studienordnung Inaktiv'), array('lehre/studienplan','Studienplan'), array('lehre/vorrueckung','Lehreinheitenvorrückung'), + array('lehre/zgvpruefung','Berechtigung um ZGV Überprüfungen vorzunehmen'), array('lv-plan','Stundenplan'), array('lv-plan/gruppenentfernen','Erlaut das Entfernen von Gruppen aus LVPlan vom FAS aus'), array('lv-plan/lektorentfernen','Erlaut das Entfernen von Lektoren aus LVPlan vom FAS aus'), diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 62beadbce..a20892fb4 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4700,6 +4700,102 @@ if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berecht } } + +// Add table zgvpruefungstatus +if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefungstatus LIMIT 1;")) +{ + $qry = " + CREATE TABLE public.tbl_zgvpruefungstatus + ( + status_kurzbz character varying(32), + bezeichnung character varying(256) + ); + + ALTER TABLE public.tbl_zgvpruefungstatus ADD CONSTRAINT status_kurzbz PRIMARY KEY (status_kurzbz); + INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('pruefung_stg', 'Wird vom Studiengang geprüft'); + INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('rejected', 'Vom Studiengang abgelehnt'); + INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('accepted', 'Vom Studiengang akzeptiert'); + + GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_zgvpruefungstatus TO vilesci; + GRANT SELECT ON public.tbl_zgvpruefungstatus TO web; + "; + + if(!$db->db_query($qry)) + echo 'public.tbl_zgvpruefungstatus: '.$db->db_last_error().'
'; + else + echo ' public.tbl_zgvpruefungstatus: Tabelle hinzugefuegt
'; +} + +// Add table zgvpruefung +if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefung LIMIT 1;")) +{ + $qry = " + CREATE TABLE public.tbl_zgvpruefung + ( + zgvpruefung_id integer NOT NULL, + prestudent_id integer NOT NULL, + insertamum timestamp without time zone, + insertvon character varying(32), + updateamum timestamp without time zone, + updatevon character varying(32) + ); + + CREATE SEQUENCE public.tbl_zgvpruefung_id_seq + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + ALTER TABLE public.tbl_zgvpruefung ADD CONSTRAINT pk_tbl_zgvpruefung PRIMARY KEY (zgvpruefung_id); + ALTER TABLE public.tbl_zgvpruefung ALTER COLUMN zgvpruefung_id SET DEFAULT nextval('public.tbl_zgvpruefung_id_seq'); + ALTER TABLE public.tbl_zgvpruefung ADD CONSTRAINT fk_tbl_zgvpruefung_student FOREIGN KEY (prestudent_id) REFERENCES public.tbl_prestudent (prestudent_id) ON DELETE RESTRICT ON UPDATE CASCADE; + + GRANT SELECT, UPDATE ON public.tbl_zgvpruefung_id_seq TO vilesci; + GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_zgvpruefung TO vilesci; + GRANT SELECT ON public.tbl_zgvpruefung TO web; + + "; + + if(!$db->db_query($qry)) + echo 'public.tbl_zgvpruefung: '.$db->db_last_error().'
'; + else + echo ' public.tbl_zgvpruefung: Tabelle hinzugefuegt
'; +} + +// Add table zgvpruefungstatus_status +if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefungstatus_status LIMIT 1;")) +{ + $qry = " + CREATE TABLE public.tbl_zgvpruefungstatus_status + ( + zgv_pruefung_status_id integer NOT NULL, + zgvpruefung_id integer NOT NULL, + status character varying(32), + datum timestamp without time zone DEFAULT now() + ); + + CREATE SEQUENCE public.tbl_zgvpruefungstatus_status_id_seq + INCREMENT BY 1 + NO MAXVALUE + NO MINVALUE + CACHE 1; + + ALTER TABLE public.tbl_zgvpruefungstatus_status ADD CONSTRAINT pk_tbl_zgvpruefungstatus_status PRIMARY KEY (zgv_pruefung_status_id); + ALTER TABLE public.tbl_zgvpruefungstatus_status ALTER COLUMN zgv_pruefung_status_id SET DEFAULT nextval('tbl_zgvpruefungstatus_status_id_seq'); + ALTER TABLE public.tbl_zgvpruefungstatus_status ADD CONSTRAINT fk_tbl_zgvpruefung_zgvpruefung FOREIGN KEY (zgvpruefung_id) REFERENCES public.tbl_zgvpruefung (zgvpruefung_id) ON DELETE RESTRICT ON UPDATE CASCADE; + ALTER TABLE public.tbl_zgvpruefungstatus_status ADD CONSTRAINT fk_tbl_zgvpruefung_status FOREIGN KEY (status) REFERENCES public.tbl_zgvpruefungstatus (status_kurzbz) ON DELETE RESTRICT ON UPDATE CASCADE; + + GRANT SELECT, UPDATE ON public.tbl_zgvpruefungstatus_status_id_seq TO vilesci; + GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_zgvpruefungstatus_status TO vilesci; + GRANT SELECT ON public.tbl_zgvpruefungstatus_status TO web; + "; + + if(!$db->db_query($qry)) + echo 'public.tbl_zgvpruefungstatus_status: '.$db->db_last_error().'
'; + else + echo ' public.tbl_zgvpruefungstatus_status: Tabelle hinzugefuegt
'; +} + + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; @@ -4940,6 +5036,9 @@ $tabellen=array( "public.tbl_vorlage" => array("vorlage_kurzbz","bezeichnung","anmerkung","mimetype","attribute","archivierbar","signierbar","stud_selfservice","dokument_kurzbz","insertamum","insertvon","updateamum","updatevon"), "public.tbl_vorlagedokument" => array("vorlagedokument_id","sort","vorlagestudiengang_id","dokument_kurzbz"), "public.tbl_vorlagestudiengang" => array("vorlagestudiengang_id","vorlage_kurzbz","studiengang_kz","version","text","oe_kurzbz","style","berechtigung","anmerkung_vorlagestudiengang","aktiv","sprache","subject","orgform_kurzbz","insertamum","insertvon","updateamum","updatevon"), + "public.tbl_zgvpruefungstatus" => array("status_kurzbz","bezeichnung"), + "public.tbl_zgvpruefung" => array("zgvpruefung_id","prestudent_id","insertamum","insertvon","updateamum","updatevon"), + "public.tbl_zgvpruefungstatus_status" => array("zgv_pruefung_status_id","zgvpruefung_id","status","datum"), "testtool.tbl_ablauf" => array("ablauf_id","gebiet_id","studiengang_kz","reihung","gewicht","semester", "insertamum","insertvon","updateamum", "updatevon","ablauf_vorgaben_id","studienplan_id"), "testtool.tbl_ablauf_vorgaben" => array("ablauf_vorgaben_id","studiengang_kz","sprache","sprachwahl","content_id","insertamum","insertvon","updateamum", "updatevon"), "testtool.tbl_antwort" => array("antwort_id","pruefling_id","vorschlag_id"), diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 2d8daed4d..180e43cc4 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -401,6 +401,14 @@ $filters = array( ', 'oe_kurzbz' => null, ), + array( + 'app' => 'infocenter', + 'dataset_name' => 'zgvUeberpruefung', + 'filter_kurzbz' => 'zgvUeberpruefung', + 'description' => '{ZGV Übersicht}', + 'sort' => 4, + ), + array( 'app' => 'budget', 'dataset_name' => 'budgetoverview', diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index cbfbdcdc9..a151a723b 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -3006,6 +3006,126 @@ $phrases = array( ) ) ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvRueckfragen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV Prüfung beantragen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'apply for a ZGV examination', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvAkzeptieren', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Dokumente akzeptieren', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'accept documents', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvAblehnen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Dokumente ablehnen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'reject documents', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvInPruefung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV noch in Prüfung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ZGV still in review', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvAkzeptiert', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Dokumente akzeptiert', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'accepted documents', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvAbgelehnt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Dokumente abgelehnt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'rejected documents', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'infocenter', 'category' => 'infocenter', From 23e502f02e0cad6f46ae43dce3a59589d713de54 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 25 Mar 2021 10:44:11 +0100 Subject: [PATCH 15/95] mail vorlage hinzugefuegt --- .../system/infocenter/InfoCenter.php | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 46fe09c10..41be8c6e0 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -496,10 +496,10 @@ class InfoCenter extends Auth_Controller * Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang */ private function sendZgvMail($mail){ - $data = array( - 'DataTest' => 'getestet.' - ); + $data = array(); + $this->load->helper('hlp_sancho'); + sendSanchoMail( self::ZGVPRUEFUNG_MAIL_VORLAGE, $data, @@ -508,8 +508,6 @@ class InfoCenter extends Auth_Controller 'sancho_header_min_bw.jpg', 'sancho_footer_min_bw.jpg' ); - - return true; } /** @@ -624,7 +622,7 @@ class InfoCenter extends Auth_Controller ); if (isSuccess($insert) && isSuccess($update)) - $mailStatus = $this->sendZgvMail($mail); + $this->sendZgvMail($mail); elseif (isError($insert) && isError($update)) return $this->outputJsonError('Fehler beim Speichern'); @@ -649,21 +647,19 @@ class InfoCenter extends Auth_Controller ); if (isSuccess($result)) - $mailStatus = $this->sendZgvMail($mail); + $this->sendZgvMail($mail); elseif (isError($result)) return $this->outputJsonError('Fehler beim Speichern'); } } - if ($mailStatus) - { - $this->outputJsonSuccess( - array - ( - 'msg' => 'Erfolgreich gespeichert', - 'person_id' => $sg['person_id'] - ) - ); - } + + $this->outputJsonSuccess( + array + ( + 'msg' => 'Erfolgreich gespeichert', + 'person_id' => $sg['person_id'] + ) + ); } /** From e791e3267f5c3c2bbf2323ab75641bcee28ae855 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 25 Mar 2021 15:52:14 +0100 Subject: [PATCH 16/95] link zur mail vorlage hinzugefuegt --- application/controllers/system/infocenter/InfoCenter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 41be8c6e0..a441a43d9 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -496,7 +496,9 @@ class InfoCenter extends Auth_Controller * Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang */ private function sendZgvMail($mail){ - $data = array(); + $data = array( + 'link' => site_url('system/infocenter/ZGVUeberpruefung') + ); $this->load->helper('hlp_sancho'); From 0c429984b9b3e5b342c97cc29b123971027ce63a Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Fri, 26 Mar 2021 18:43:05 +0100 Subject: [PATCH 17/95] add new function to bisverwendung --- include/bisverwendung.class.php | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index 774fe413f..94126f5c5 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -785,5 +785,29 @@ class bisverwendung extends basis_db return false; } } + + public function inZeitaufzeichnungspflichtigPeriod($date) + { + $dateToCheck = date('Y-m-d', strtotime($date)); + $beginn = date('Y-m-d', strtotime($this->beginn)); + $end = date('Y-m-d', strtotime($this->ende)); + $zp = $this->zeitaufzeichnungspflichtig; + + if ($zp) + { + if (($dateToCheck >= $beginn) && (($dateToCheck <= $end) OR is_null($this->ende))) + { + return true; + } + else + { + return false; + } + } + else + { + return false; + } + } } ?> From 9b57248007f3c77dba1e20c1f189bbf1a2426ee0 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 31 Mar 2021 13:12:20 +0200 Subject: [PATCH 18/95] zgv auch bei master uebernehmen --- .../views/system/infocenter/zgvpruefungen.php | 14 ++++++++------ public/js/infocenter/infocenterDetails.js | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 41b549616..1e2f1cca4 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -259,7 +259,7 @@ echo $this->widgetlib->widget( 'Zgvmaster_widget', array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgvmas_code), - array('name' => 'zgvmas', 'id' => 'zgvmas') + array('name' => 'zgvmas', 'id' => 'zgvmas_'.$zgvpruefung->prestudent_id) ); ?>
@@ -272,7 +272,8 @@ ?> + name="zgvmaort" + id="zgvmaort_prestudent_id ?>">
@@ -288,7 +289,8 @@ + name="zgvmadatum" + id="zgvmadatum_prestudent_id ?>"> @@ -301,7 +303,7 @@ echo $this->widgetlib->widget( 'Nation_widget', array(DropdownWidget::SELECTED_ELEMENT => $zgvpruefung->zgvmanation_code), - array('name' => 'zgvmanation', 'id' => 'zgvmanation') + array('name' => 'zgvmanation', 'id' => 'zgvmanation_'.$zgvpruefung->prestudent_id) ); ?> @@ -413,7 +415,7 @@ $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); } - if ($studiengangtyp !== 'b') + /*if ($studiengangtyp !== 'b') { $disabled = 'disabled'; $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); @@ -424,7 +426,7 @@ $disabledStg = 'disabled'; $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); } - } + }*/ ?>
diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 7023af277..91531c02a 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -207,6 +207,22 @@ var InfocenterDetails = { $("#zgvort_" + prestudentid).val(zgvort); $("#zgvdatum_" + prestudentid).val(gerzgvdatum); $("#zgvnation_" + prestudentid).val(zgvnation); + + var zgvmas_code = prestudent.zgvmas_code !== null ? prestudent.zgvmas_code : "null"; + var zgvmaort = prestudent.zgvmaort !== null ? prestudent.zgvmaort : ""; + var zgvmadatum = prestudent.zgvmadatum; + var gerzgvmadatum = ""; + if (zgvmadatum !== null) + { + zgvmadatum = $.datepicker.parseDate("yy-mm-dd", prestudent.zgvmadatum); + gerzgvmadatum = $.datepicker.formatDate("dd.mm.yy", zgvmadatum); + } + var zgvmanation = prestudent.zgvmanation !== null ? prestudent.zgvmanation : "null"; + + $("#zgvmas_" + prestudentid).val(zgvmas_code); + $("#zgvmaort_" + prestudentid).val(zgvmaort); + $("#zgvmadatum_" + prestudentid).val(gerzgvmadatum); + $("#zgvmanation_" + prestudentid).val(zgvmanation); } else { From 7f713670b583620373b04b0e088272ba2a16fc75 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 31 Mar 2021 17:57:35 +0200 Subject: [PATCH 19/95] fixed recht --- vilesci/personen/zeitwunsch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vilesci/personen/zeitwunsch.php b/vilesci/personen/zeitwunsch.php index b5f88f97f..416c6387d 100644 --- a/vilesci/personen/zeitwunsch.php +++ b/vilesci/personen/zeitwunsch.php @@ -66,7 +66,7 @@ $updatevon = 0; // Zeitwuensche speichern if (isset($_POST['save'])) { - if(!$rechte->isBerechtigt('mitarbeiter', null, 'suid')) + if(!$rechte->isBerechtigt('mitarbeiter/zeitwuensche', null, 'suid')) die($rechte->errormsg); for ($t=1;$t<7;$t++) From a6989fff110596580233a0e5a6c527c437c0aa0a Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Thu, 1 Apr 2021 14:44:28 +0200 Subject: [PATCH 20/95] Revert "impiment different text" This reverts commit 9bf8d58a --- rdf/studienblatt.xml.php | 29 ++++------------------------- 1 file changed, 4 insertions(+), 25 deletions(-) diff --git a/rdf/studienblatt.xml.php b/rdf/studienblatt.xml.php index e00fc9aed..7756901f5 100644 --- a/rdf/studienblatt.xml.php +++ b/rdf/studienblatt.xml.php @@ -156,26 +156,12 @@ foreach($uid_arr as $uid) echo "\t\tregelstudiendauer!=0?$studienordnung->ects/$studienplan->regelstudiendauer:0)."]]>"; echo "\t\t"; - $status_aktuell = ($prestudent->getLastStatus($student->prestudent_id,null,null))?$prestudent->status_kurzbz:''; - if ($status_aktuell == 'Abbrecher') - { - $ausbildungssemester_titel = "Abgemeldet im Ausbildungssemester"; - $studiensemester_titel = "Abgemeldet im Studiensemester"; - } - else - { - $ausbildungssemester_titel = "Aktuelles Ausbildungssemester"; - $studiensemester_titel = "Abgemeldet im Studiensemester"; - } - - echo "\t\t"; echo "\t\tausbildungssemester."]]>"; $studiensemester_aktuell = new studiensemester(); $studiensemester_aktuell->load($studiensemester); - echo "\t\t"; echo "\t\tbezeichnung."]]>"; // check ob Oeh-Beitrag bezahlt wurde @@ -198,14 +184,15 @@ foreach($uid_arr as $uid) $abschluss = $studiensemester_abschluss->jump($prestudent->studiensemester_kurzbz, $studienplan->regelstudiendauer-$prestudent->ausbildungssemester); $studiensemester_abschluss->load($abschluss); echo "\t\tbezeichnung."]]>"; + echo "\t\tende))."]]>"; $studiensemester_endedatum = new studiensemester(); $studiensemester_endedatum->load($studiensemester_endedatum->getaktorNext(1)); + echo "\t\tende))."]]>"; + $status_aktuell = ($prestudent->getLastStatus($student->prestudent_id,null,null))?$prestudent->status_kurzbz:''; - $enddatum = date('d.m.Y',strtotime($studiensemester_abschluss->ende)); - $letztesStudiensemester_datum_titel = 'Voraussichtliches Abschlussdatum'; switch($status_aktuell) { case 'Student': @@ -222,20 +209,12 @@ foreach($uid_arr as $uid) break; case 'Abbrecher': $studierendenstatus_aktuell = 'AbbrecherIn'; - $letztesStudiensemester_datum_titel = 'Abgemeldet am:'; - $enddatum = date('d.m.Y',strtotime($prestudent->bestaetigtam)); break; default: $studierendenstatus_aktuell =''; } - echo "\t\tende))."]]>"; - - echo "\t\t"; - - echo "\t\t"; - - echo "\t\t\n"; + echo "\t\t\n"; echo "\t\tzgvdatum."]]>\n"; $zgv = new zgv($prestudent->zgv_code); echo "\t\tzgv_kurzbz."]]>\n"; From 3e7f75b43fff6978cba072ab5e612692c08f29b0 Mon Sep 17 00:00:00 2001 From: OliiverHacker Date: Thu, 1 Apr 2021 14:48:56 +0200 Subject: [PATCH 21/95] fix merge conflic at dbupdate_3.3 --- system/dbupdate_3.3.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 4fc966c9c..b878431df 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4465,21 +4465,21 @@ if($result = $db->db_query("SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE } } -<<<<<<<<< Temporary merge branch 1 // ADD COLUMN azgrelevant in bis.tbl_bisverwendung if(!$result = @$db->db_query("SELECT azgrelevant FROM bis.tbl_bisverwendung LIMIT 1")) { $qry = " ALTER TABLE bis.tbl_bisverwendung ADD COLUMN azgrelevant boolean; UPDATE bis.tbl_bisverwendung SET azgrelevant = zeitaufzeichnungspflichtig; - UPDATE bis.tbl_bisverwendung SET zeitaufzeichnungspflichtig = true WHERE ba1code=103; - "; + UPDATE bis.tbl_bisverwendung SET zeitaufzeichnungspflichtig = true WHERE ba1code=103 AND beschausmasscode!=5; + "; if(!$db->db_query($qry)) echo 'bis.tbl_bisverwendung: '.$db->db_last_error().'
'; else echo '
bis.tbl_bisverwendung Spalte azgrelevant hinzugefügt.'; -========= +} + // Add column dms_id, studiensemester_kurzbz, anmerkung_student und empfehlung_anrechnung // Change genehmigt_von and begruendung_id to be NULLABLE if(!$result = @$db->db_query("SELECT dms_id FROM lehre.tbl_anrechnung")) From acdfdc028bd60e470fd7ccc3eb478db9756b946f Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 6 Apr 2021 12:31:46 +0200 Subject: [PATCH 22/95] zgv beim master nur updaten wenn es sich um einen master handelt --- .../system/infocenter/InfoCenter.php | 48 ++++++++++++------- 1 file changed, 32 insertions(+), 16 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 43de8bb60..508b65e15 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -374,12 +374,18 @@ class InfoCenter extends Auth_Controller $zgvdatum = isEmptyString($zgvdatum) ? null : date_format(date_create($zgvdatum), 'Y-m-d'); $zgvnation_code = $this->input->post('zgvnation') === 'null' ? null : $this->input->post('zgvnation'); - // zgvmasterdata - $zgvmas_code = $this->input->post('zgvmas') === 'null' ? null : $this->input->post('zgvmas'); - $zgvmaort = $this->input->post('zgvmaort'); - $zgvmadatum = $this->input->post('zgvmadatum'); - $zgvmadatum = isEmptyString($zgvmadatum) ? null : date_format(date_create($zgvmadatum), 'Y-m-d'); - $zgvmanation_code = $this->input->post('zgvmanation') === 'null' ? null : $this->input->post('zgvmanation'); + $prestudent = $this->PrestudentModel->getPrestudentWithZgv($prestudent_id); + $prestudentdata = getData($prestudent); + + if ($prestudentdata->studiengangtyp === 'm') + { + // zgvmasterdata + $zgvmas_code = $this->input->post('zgvmas') === 'null' ? null : $this->input->post('zgvmas'); + $zgvmaort = $this->input->post('zgvmaort'); + $zgvmadatum = $this->input->post('zgvmadatum'); + $zgvmadatum = isEmptyString($zgvmadatum) ? null : date_format(date_create($zgvmadatum), 'Y-m-d'); + $zgvmanation_code = $this->input->post('zgvmanation') === 'null' ? null : $this->input->post('zgvmanation'); + } $lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id, '', self::INTERESSENTSTATUS); @@ -395,19 +401,29 @@ class InfoCenter extends Auth_Controller ); } - $prestresult = $this->PrestudentModel->update( - $prestudent_id, - array( - 'zgv_code' => $zgv_code, - 'zgvort' => $zgvort, - 'zgvdatum' => $zgvdatum, - 'zgvnation' => $zgvnation_code, + $updateArray = array( + 'zgv_code' => $zgv_code, + 'zgvort' => $zgvort, + 'zgvdatum' => $zgvdatum, + 'zgvnation' => $zgvnation_code, + 'updateamum' => date('Y-m-d H:i:s') + ); + + if ($prestudentdata->studiengangtyp === 'm') + { + $updateMasterArray = array( 'zgvmas_code' => $zgvmas_code, 'zgvmaort' => $zgvmaort, 'zgvmadatum' => $zgvmadatum, - 'zgvmanation' => $zgvmanation_code, - 'updateamum' => date('Y-m-d H:i:s') - ) + 'zgvmanation' => $zgvmanation_code + ); + + $updateArray = array_merge($updateArray, $updateMasterArray); + } + + $prestresult = $this->PrestudentModel->update( + $prestudent_id, + $updateArray ); if (isError($prestresult)) From 42d2f455613c1501364fa3457bf43f70ff2ac3eb Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 6 Apr 2021 13:51:27 +0200 Subject: [PATCH 23/95] bei den anmerkungen studiengang hinzugefuegt --- application/models/person/Notiz_model.php | 6 ++++-- .../views/system/infocenter/anmerkungenZurBewerbung.php | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/application/models/person/Notiz_model.php b/application/models/person/Notiz_model.php index 2e09875d8..fd08cc384 100644 --- a/application/models/person/Notiz_model.php +++ b/application/models/person/Notiz_model.php @@ -154,9 +154,11 @@ class Notiz_model extends DB_Model { // Join with the table public.tbl_notizzuordnung using notiz_id $this->addJoin('public.tbl_notizzuordnung', 'notiz_id'); - $this->addOrder('insertamum', 'DESC'); + $this->addJoin('public.tbl_prestudent', 'prestudent_id', 'LEFT'); + $this->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT'); + $this->addOrder('public.tbl_notiz.insertamum', 'DESC'); - return $this->loadWhere(array('person_id' => $person_id, 'titel LIKE' => $titel)); + return $this->loadWhere(array('public.tbl_notizzuordnung.person_id' => $person_id, 'titel LIKE' => $titel)); } /** diff --git a/application/views/system/infocenter/anmerkungenZurBewerbung.php b/application/views/system/infocenter/anmerkungenZurBewerbung.php index 85682d2a4..508f041de 100644 --- a/application/views/system/infocenter/anmerkungenZurBewerbung.php +++ b/application/views/system/infocenter/anmerkungenZurBewerbung.php @@ -15,6 +15,7 @@ insertamum), 'd.m.Y H:i:s') ?> + kurzbzlang)) ?: print_r('(' . nl2br($notiz->kurzbzlang) . ') - ') ?> text) ?> From bc7e3c5cc5a93aaeb764cfd2d4c53c5c9db69056 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 20 Apr 2021 13:51:41 +0200 Subject: [PATCH 24/95] zgv ueberpruefung hinzugefuegt --- .../system/infocenter/InfoCenter.php | 154 +++++++------- .../system/infocenter/ZGVUeberpruefung.php | 40 +++- .../models/crm/ZGVPruefungStatus_model.php | 33 +++ .../system/infocenter/infocenterData.php | 31 ++- .../system/infocenter/infocenterDetails.php | 9 +- .../infocenter/infocenterZgvDetails.php | 78 +++++-- .../infocenterZgvUeberpruefungData.php | 22 +- .../views/system/infocenter/zgvpruefungen.php | 23 +- public/js/infocenter/infocenterDetails.js | 103 +-------- public/js/infocenter/zgvUeberpruefung.js | 189 +++++++++++++++++ system/dbupdate_3.3.php | 1 + system/filtersupdate.php | 55 ++++- system/phrasesupdate.php | 196 +++++++++--------- 13 files changed, 602 insertions(+), 332 deletions(-) create mode 100644 public/js/infocenter/zgvUeberpruefung.js diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index a441a43d9..f0183c981 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -15,10 +15,13 @@ class InfoCenter extends Auth_Controller const ZGVPRUEFUNG_MAIL_VORLAGE = 'InfocenterMailZgvUeberpruefung'; const INFOCENTER_URI = 'system/infocenter/InfoCenter'; // URL prefix for this controller + const ZGV_UEBERPRUEFUNG_URI = 'system/infocenter/ZGVUeberpruefung'; const INDEX_PAGE = 'index'; const FREIGEGEBEN_PAGE = 'freigegeben'; const REIHUNGSTESTABSOLVIERT_PAGE = 'reihungstestAbsolviert'; const SHOW_DETAILS_PAGE = 'showDetails'; + const SHOW_ZGV_DETAILS_PAGE = 'showZGVDetails'; + const ZGV_UBERPRUEFUNG_PAGE = 'ZGVUeberpruefung'; const NAVIGATION_PAGE = 'navigation_page'; const ORIGIN_PAGE = 'origin_page'; @@ -64,6 +67,18 @@ class InfoCenter extends Auth_Controller 'name' => 'Note updated', 'message' => 'Note with title %s was updated', 'success' => null + ), + 'updatezgv' => array( + 'logtype' => 'Action', + 'name' => 'ZGV pruefung updated', + 'message' => 'ZGV with the ID %s was updated to %s', + 'success' => null + ), + 'newzgv' => array( + 'logtype' => 'Action', + 'name' => 'ZGV pruefung added', + 'message' => 'ZGV with the ID %s was added', + 'success' => null ) ); @@ -86,7 +101,7 @@ class InfoCenter extends Auth_Controller 'freigegeben' => 'infocenter:r', 'reihungstestAbsolviert' => 'infocenter:r', 'showDetails' => 'infocenter:r', - 'showZGVDetails' => 'infocenter:r', + 'showZGVDetails' => 'lehre/zgvpruefung:r', 'unlockPerson' => 'infocenter:rw', 'saveFormalGeprueft' => 'infocenter:rw', 'getPrestudentData' => 'infocenter:r', @@ -95,7 +110,7 @@ class InfoCenter extends Auth_Controller 'saveBewPriorisierung' => 'infocenter:rw', 'saveZgvPruefung' => 'infocenter:rw', 'zgvRueckfragen' => 'infocenter:rw', - 'zgvStatusUpdate' => 'infocenter:rw', + 'zgvStatusUpdate' => 'lehre/zgvpruefung:rw', 'saveAbsage' => 'infocenter:rw', 'saveFreigabe' => 'infocenter:rw', 'getNotiz' => 'infocenter:r', @@ -190,6 +205,8 @@ class InfoCenter extends Auth_Controller */ public function showZGVDetails() { + $this->_setNavigationMenuShowDetails(self::SHOW_ZGV_DETAILS_PAGE); + $prestudent_id = $this->input->get('prestudent_id'); if (!is_numeric($prestudent_id)) @@ -203,38 +220,26 @@ class InfoCenter extends Auth_Controller if (!hasData($prestudentexists)) show_error('Prestudent does not exist!'); - $zgvExist = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + $zgv = $this->ZGVPruefungStatusModel->getZgvStatusByPrestudent($prestudent_id); - if (isError($zgvExist)) - show_error(getError($zgvExist)); + if (isError($zgv)) + show_error(getError($zgv)); - if (!hasData($zgvExist)) - show_error('ZGV does not exist!'); - - $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); - $this->ZGVPruefungStatusModel->addLimit(1); - - $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgvExist->retval[0]->zgvpruefung_id)); - - if (isError($statusZGV)) - show_error(getError($statusZGV)); - - if (!hasData($statusZGV)) + if (!hasData($zgv)) show_error('ZGV has no status.'); - $statusZGV = array('status' => $statusZGV->retval[0]->status); - $origin_page = $this->input->get(self::ORIGIN_PAGE); - - - $persondata = $this->_loadPersonData($prestudentexists->retval[0]->person_id); - + $persondata = $this->_loadPersonData(getData($prestudentexists)[0]->person_id); $prestudent_id = array('prestudent_id' => $prestudent_id); + $status = array('status' => getData($zgv)[0]->status); + $data = array_merge( $persondata, $prestudent_id, - $statusZGV + $status ); + $origin_page = $this->input->get(self::ORIGIN_PAGE); + $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); $data[self::ORIGIN_PAGE] = $origin_page; $data[self::PREV_FILTER_ID] = $this->input->get(self::PREV_FILTER_ID); @@ -521,30 +526,27 @@ class InfoCenter extends Auth_Controller $person_id = $this->input->post('person_id'); $status = $this->input->post('status'); - if (isEmptyString($prestudent_id) && isEmptyString($person_id) && isEmptyString($status)) - return $this->outputJsonError('Some data is missing'); + if (isEmptyString($prestudent_id) || isEmptyString($person_id) || isEmptyString($status)) + $this->terminateWithJsonError('Some data is missing'); - $zgv = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + $personInfos = $this->PrestudentModel->getPrestudentWithZgv($prestudent_id); + + if (!hasData($personInfos)) + $this->terminateWithJsonError('Person id nicht gefunden'); + + $personInfos = getData($personInfos); + + $zgv = $this->ZGVPruefungStatusModel->getZgvStatusByPrestudent($prestudent_id); if (!hasData($zgv)) - return $this->outputJsonError('ZGV nicht gefunden'); + $this->terminateWithJsonError('ZGV-Status nicht gefunden'); $zgv = getData($zgv); - $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); - $this->ZGVPruefungStatusModel->addLimit(1); - $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgv[0]->zgvpruefung_id)); - - if (!hasData($statusZGV)) - return $this->outputJsonError('ZGV-Status nicht gefunden'); - - $statusZGV = getData($statusZGV); - - if ($statusZGV[0]->status === 'rejected' && $status === 'rejected') - return $this->outputJsonError('Bereits abgelehnt worden'); - elseif ($statusZGV[0]->status === 'accepted' && $status === 'accepted') - return $this->outputJsonError('Bereits akzeptiert worden'); - + if ($zgv[0]->status === 'rejected' && $status === 'rejected') + $this->terminateWithJsonError('Bereits abgelehnt worden'); + elseif ($zgv[0]->status === 'accepted' && $status === 'accepted') + $this->terminateWithJsonError('Bereits akzeptiert worden'); $insert = $this->ZGVPruefungStatusModel->insert( array( @@ -561,16 +563,23 @@ class InfoCenter extends Auth_Controller ) ); - if (isError($insert) && isError($update)) - return $this->outputJsonError('Fehler beim Speichern'); + if (isError($insert) || isError($update)) + $this->terminateWithJsonError('Fehler beim Speichern'); - $personInfos = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + $allZgvs = $this->ZGVPruefungStatusModel->getOpenZgvByPerson($personInfos->person_id, array('pruefung_stg')); + $openZgv = false; + + if (hasData($allZgvs)) + $openZgv = true; + + $this->_log($person_id, 'updatezgv', array($zgv[0]->zgvpruefung_id, $status)); $this->outputJsonSuccess( array ( 'msg' => 'Erfolgreich gespeichert', - 'person_id' => $personInfos['person_id'] + 'person_id' => $personInfos->person_id, + 'openZgv' => $openZgv ) ); @@ -585,28 +594,19 @@ class InfoCenter extends Auth_Controller $prestudent_id = $this->input->post('prestudent_id'); $person_id = $this->input->post('person_id'); - if (isEmptyString($prestudent_id) && isEmptyString($person_id)) - return $this->outputJsonError('Prestudentid OR/AND Personid missing'); + if (isEmptyString($prestudent_id) || isEmptyString($person_id)) + $this->terminateWithJsonError('Prestudentid OR/AND Personid missing'); - $zgv = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); - $sg = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); - $mail = $sg['studiengang_mail']; + $zgv = $this->ZGVPruefungStatusModel->getZgvStatusByPrestudent($prestudent_id); + $data = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + $mail = $data['studiengang_mail']; if (hasData($zgv)) { $zgv = getData($zgv); - $this->ZGVPruefungStatusModel->addOrder('datum', 'DESC'); - $this->ZGVPruefungStatusModel->addLimit(1); - $statusZGV = $this->ZGVPruefungStatusModel->loadWhere(array('zgvpruefung_id' => $zgv[0]->zgvpruefung_id)); - - if (!hasData($statusZGV)) - return $this->outputJsonError('ZGV-Status nicht gefunden'); - - $statusZGV = getData($statusZGV); - - if ($statusZGV[0]->status === 'pruefung_stg') - return $this->outputJsonError('Bereits in Prüfung'); + if ($zgv[0]->status === 'pruefung_stg') + $this->terminateWithJsonError('Bereits in Prüfung'); $insert = $this->ZGVPruefungStatusModel->insert( array( @@ -615,7 +615,7 @@ class InfoCenter extends Auth_Controller ) ); - $update = $this->ZGVPruefungModel->update( + $this->ZGVPruefungModel->update( $zgv[0]->zgvpruefung_id, array( 'updateamum' => date('Y-m-d H:i:s'), @@ -623,11 +623,12 @@ class InfoCenter extends Auth_Controller ) ); - if (isSuccess($insert) && isSuccess($update)) - $this->sendZgvMail($mail); - elseif (isError($insert) && isError($update)) - return $this->outputJsonError('Fehler beim Speichern'); + $this->_log($person_id, 'updatezgv', array($zgv[0]->zgvpruefung_id, 'pruefung_stg')); + if (isSuccess($insert)) + $this->sendZgvMail($mail); + elseif (isError($insert)) + $this->terminateWithJsonError('Fehler beim Speichern'); }else { $insert = $this->ZGVPruefungModel->insert( @@ -648,18 +649,25 @@ class InfoCenter extends Auth_Controller ) ); + $this->_log($person_id, 'newzgv', array($zgvpruefung_id)); + if (isSuccess($result)) $this->sendZgvMail($mail); elseif (isError($result)) - return $this->outputJsonError('Fehler beim Speichern'); + $this->terminateWithJsonError('Fehler beim Speichern'); } } + $hold = false; + if ($this->personloglib->getOnHoldDate($person_id) !== null) + $hold = true; + $this->outputJsonSuccess( array ( 'msg' => 'Erfolgreich gespeichert', - 'person_id' => $sg['person_id'] + 'person_id' => $data['person_id'], + 'hold' => $hold ) ); } @@ -1293,9 +1301,9 @@ class InfoCenter extends Auth_Controller /** * Define the navigation menu for the showDetails page */ - private function _setNavigationMenuShowDetails() + private function _setNavigationMenuShowDetails($page = self::SHOW_DETAILS_PAGE) { - $this->load->library('NavigationLib', array(self::NAVIGATION_PAGE => self::INFOCENTER_URI.'/'.self::SHOW_DETAILS_PAGE)); + $this->load->library('NavigationLib', array(self::NAVIGATION_PAGE => self::INFOCENTER_URI.'/'.$page)); $origin_page = $this->input->get(self::ORIGIN_PAGE); @@ -1308,6 +1316,8 @@ class InfoCenter extends Auth_Controller { $link = site_url(self::INFOCENTER_URI.'/'.self::REIHUNGSTESTABSOLVIERT_PAGE); } + if ($origin_page === self::ZGV_UBERPRUEFUNG_PAGE) + $link = site_url(self::ZGV_UEBERPRUEFUNG_URI); $prevFilterId = $this->input->get(self::PREV_FILTER_ID); if (isset($prevFilterId)) @@ -1457,7 +1467,7 @@ class InfoCenter extends Auth_Controller * @param $person_id * @return array */ - private function _loadPersonData($person_id) + public function _loadPersonData($person_id) { $locked = $this->PersonLockModel->checkIfLocked($person_id, self::APP); diff --git a/application/controllers/system/infocenter/ZGVUeberpruefung.php b/application/controllers/system/infocenter/ZGVUeberpruefung.php index 21728ea99..bb0c36b66 100644 --- a/application/controllers/system/infocenter/ZGVUeberpruefung.php +++ b/application/controllers/system/infocenter/ZGVUeberpruefung.php @@ -1,9 +1,9 @@ 'lehre/zgvpruefung:r', + 'getZgvStatusByPrestudent' => 'lehre/zgvpruefung:r' ) ); + $this->load->model('crm/ZGVPruefungStatus_model', 'ZGVPruefungStatusModel'); + $this->load->model('crm/ZGVPruefung_model', 'ZGVPruefungModel'); $this->load->library('WidgetLib'); - $this->setControllerId(); // sets the controller id + + $this->setControllerId(); + $this->loadPhrases( + array( + 'infocenter' + ) + ); } public function index() { + $this->load->view('system/infocenter/infocenterZgvUeberpruefung.php'); + } - try{ - $this->load->view('system/infocenter/infocenterZgvUeberpruefung.php'); - }catch(Exception $e) - { - var_dump($e); - } + public function getZgvStatusByPrestudent() + { + $prestudent_id = $this->input->get('prestudent_id'); + + $zgvExist = $this->ZGVPruefungModel->loadWhere(array('prestudent_id' => $prestudent_id)); + + if (!hasData($zgvExist)) + $this->terminateWithJsonError('no ZGV exist'); + + $status = $this->ZGVPruefungStatusModel->getZgvStatus(getData($zgvExist)[0]->zgvpruefung_id); + + if (!hasData($status)) + $this->terminateWithJsonError('No status'); + + $status = getData($status)[0]->status; + + $this->outputJsonSuccess($status); } } \ No newline at end of file diff --git a/application/models/crm/ZGVPruefungStatus_model.php b/application/models/crm/ZGVPruefungStatus_model.php index 75e57cb05..5c51e45d8 100644 --- a/application/models/crm/ZGVPruefungStatus_model.php +++ b/application/models/crm/ZGVPruefungStatus_model.php @@ -14,4 +14,37 @@ class ZGVPruefungStatus_model extends DB_Model $this->hasSequence = true; } + public function getZgvStatus($zgvpruefung_id) + { + $this->addOrder('datum', 'DESC'); + $this->addLimit(1); + + return $this->loadWhere(array('zgvpruefung_id' => $zgvpruefung_id)); + } + + public function getZgvStatusByPrestudent($prestudent_id) + { + $this->addJoin('public.tbl_zgvpruefung', 'zgvpruefung_id'); + $this->addOrder($this->dbTable . '.datum', 'DESC'); + $this->addLimit(1); + return $this->loadWhere(array('prestudent_id' => $prestudent_id)); + } + + public function getOpenZgvByPerson($person_id, $status) + { + $query = 'SELECT status.zgvpruefung_id, status.datum, status.status + FROM public.tbl_zgvpruefungstatus_status status + INNER JOIN + ( + SELECT zgvpruefung_id, max(datum) as MaxDate + FROM public.tbl_zgvpruefungstatus_status + GROUP BY zgvpruefung_id + ) sub ON status.zgvpruefung_id = sub.zgvpruefung_id AND status.datum = sub.MaxDate + JOIN public.tbl_zgvpruefung ON status.zgvpruefung_id = public.tbl_zgvpruefung.zgvpruefung_id + JOIN public.tbl_prestudent USING (prestudent_id) + WHERE person_id = ? + AND status.status IN ?'; + + return $this->execQuery($query, array($person_id, $status)); + } } \ No newline at end of file diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 0c7030059..8c8f23b15 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -213,7 +213,24 @@ WHERE ps.person_id = p.person_id ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 - ) AS "ZGVNation" + ) AS "ZGVNation", + ( + SELECT tbl_organisationseinheit.bezeichnung + FROM public.tbl_benutzerfunktion + JOIN public.tbl_organisationseinheit USING(oe_kurzbz) + WHERE (tbl_benutzerfunktion.datum_von IS NULL OR tbl_benutzerfunktion.datum_von <= now()) + AND (tbl_benutzerfunktion.datum_bis IS NULL OR tbl_benutzerfunktion.datum_bis >= now()) + AND tbl_benutzerfunktion.uid = ( + SELECT l.insertvon + FROM system.tbl_log l + WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') + AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') + AND l.person_id = p.person_id + ORDER BY l.zeitpunkt DESC + LIMIT 1 + ) + LIMIT 1 + ) AS "InfoCenterMitarbeiter" FROM public.tbl_person p LEFT JOIN ( SELECT tpl.person_id, @@ -298,7 +315,8 @@ ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'gesendet').')', ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'nichtGesendet').')', ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'aktiv').')', - 'ZGV Nation' + 'ZGV Nation', + 'InfoCenter Mitarbeiter' ), 'formatRow' => function($datasetRaw) { @@ -380,6 +398,15 @@ $datasetRaw->{'ZGVNation'} = '-'; } + if ($datasetRaw->{'InfoCenterMitarbeiter'} === 'InfoCenter') + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; + } + else + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; + } + return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index d8e7c21d2..a448e95ce 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -25,7 +25,8 @@ 'public/js/bootstrapper.js', 'public/js/tablesort/tablesort.js', 'public/js/infocenter/messageList.js', - 'public/js/infocenter/infocenterDetails.js' + 'public/js/infocenter/infocenterDetails.js', + 'public/js/infocenter/zgvUeberpruefung.js' ), 'phrases' => array( 'infocenter' => array( @@ -43,7 +44,11 @@ 'nichtsZumEntfernen', 'fehlerBeimEntfernen', 'rueckstelldatumUeberschritten', - 'parkenZurueckstellenInfo' + 'parkenZurueckstellenInfo', + 'zgvInPruefung', + 'zgvErfuellt', + 'zgvNichtErfuellt', + 'zgvErfuelltPruefung' ), 'ui' => array( 'gespeichert', diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index c6af4c436..20c573e34 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -25,7 +25,8 @@ 'public/js/bootstrapper.js', 'public/js/tablesort/tablesort.js', 'public/js/infocenter/messageList.js', - 'public/js/infocenter/infocenterDetails.js' + 'public/js/infocenter/infocenterDetails.js', + 'public/js/infocenter/zgvUeberpruefung.js' ), 'phrases' => array( 'infocenter' => array( @@ -34,8 +35,9 @@ 'nichtsZumEntfernen', 'fehlerBeimEntfernen', 'zgvInPruefung', - 'zgvAkzeptiert', - 'zgvAbgelehnt' + 'zgvErfuellt', + 'zgvNichtErfuellt', + 'zgvErfuelltPruefung' ), 'ui' => array( 'gespeichert', @@ -116,36 +118,66 @@ load->view('system/infocenter/dokpruefung.php', array('formalReadonly' => true)); ?>
-
+
- - p->t('infocenter', 'zgvInPruefung'); - break; - case 'accepted' : - echo $this->p->t('infocenter', 'zgvAkzeptiert'); - break; - case 'rejected' : - echo $this->p->t('infocenter', 'zgvAbgelehnt'); - break; - } - ?> + + -
- +
+ +
diff --git a/application/views/system/infocenter/infocenterZgvUeberpruefungData.php b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php index ff1b85d9e..d2bf62dab 100644 --- a/application/views/system/infocenter/infocenterZgvUeberpruefungData.php +++ b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php @@ -4,7 +4,6 @@ $APP = '\'infocenter\''; $INTERESSENT_STATUS = '\'Interessent\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; -$STATUS = '\'pruefung_stg\''; $uid = get_uid(); $rechte = new benutzerberechtigung(); @@ -17,14 +16,14 @@ $query = ' ps.prestudent_id AS "PreStudentID", p.vorname AS "Vorname", p.nachname AS "Nachname", - sg.kurzbzlang AS "Studiengang" + sg.kurzbzlang AS "Studiengang", + zgvstatus.status as "Status" FROM public.tbl_zgvpruefungstatus_status zgvstatus JOIN public.tbl_zgvpruefung zgv USING (zgvpruefung_id) JOIN public.tbl_prestudent ps USING (prestudent_id) JOIN public.tbl_person p USING(person_id) JOIN public.tbl_studiengang sg USING(studiengang_kz) - WHERE zgvstatus.status = ' . $STATUS . ' - AND oe_kurzbz IN ('. $oeKurz .') + WHERE oe_kurzbz IN ('. $oeKurz .') AND zgvstatus.datum IN ( SELECT MAX(zgvstatus.datum) FROM public.tbl_zgvpruefungstatus_status zgvstatus GROUP BY zgvstatus.zgvpruefung_id) @@ -50,11 +49,24 @@ $filterWidgetArray = array( 'Details', site_url('system/infocenter/InfoCenter/showZGVDetails'), $datasetRaw->{'PreStudentID'}, - 'zgvUeberpruefung', + 'ZGVUeberpruefung', (isset($_GET['fhc_controller_id']) ? $_GET['fhc_controller_id'] : ''), (isset($_GET['filter_id']) ? $_GET['filter_id'] : '') ); + switch ($datasetRaw->{'Status'}) + { + case 'accepted' : + $datasetRaw->{'Status'} = $this->p->t('infocenter', 'zgvErfuellt'); + break; + case 'rejected' : + $datasetRaw->{'Status'} = $this->p->t('infocenter', 'zgvNichtErfuellt'); + break; + case 'accepted_pruefung' : + $datasetRaw->{'Status'} = $this->p->t('infocenter', 'zgvErfuelltPruefung'); + break; + } + return $datasetRaw; }, ); diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index eccbbd4ee..6cc9f2f7a 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -311,31 +311,14 @@
-
+
- - - statusZGV)) - { - switch ($zgvpruefung->statusZGV) - { - case 'pruefung_stg' : - echo $this->p->t('infocenter', 'zgvInPruefung'); - break; - case 'accepted' : - echo $this->p->t('infocenter', 'zgvAkzeptiert'); - break; - case 'rejected' : - echo $this->p->t('infocenter', 'zgvAbgelehnt'); - break; - } - } - ?> +
diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index d0668bbbc..6c094f23f 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -221,70 +221,6 @@ var InfocenterDetails = { } ); }, - zgvRueckfragen: function(data) - { - FHC_AjaxClient.ajaxCallPost( - CALLED_PATH + '/zgvRueckfragen', - data, - { - successCallback: function(data, textStatus, jqXHR) - { - if (FHC_AjaxClient.hasData(data)) - { - var response = FHC_AjaxClient.getData(data); - - var date = new Date(); - date.setDate(date.getDate() + 14); - - var dd = date.getDate(); - var mm = date.getMonth() + 1; - var y = date.getFullYear(); - - var formatedDate = mm + '/'+ dd + '/'+ y; - InfocenterDetails.setPersonOnHold(response.person_id, formatedDate); - - $('#zgvStatusText').text(FHC_PhrasesLib.t('infocenter', 'zgvInPruefung')); - InfocenterDetails._refreshZgv(); - FHC_DialogLib.alertSuccess(response.msg); - } else if(FHC_AjaxClient.isError(data)) - FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); - }, - errorCallback: function(jqXHR, textStatus, errorThrown) - { - FHC_DialogLib.alertError((jqXHR.responseText)); - } - } - ); - }, - zgvStatusUpdate: function(data) - { - var status = data.status; - FHC_AjaxClient.ajaxCallPost( - CALLED_PATH + '/zgvStatusUpdate', - data, - { - successCallback: function(data, textStatus, jqXHR) - { - if (FHC_AjaxClient.hasData(data)) - { - var response = FHC_AjaxClient.getData(data) - FHC_DialogLib.alertSuccess(response.msg); - InfocenterDetails.removePersonOnHold(response.person_id); - if (status === 'rejected') - var p = 'zgvAbgelehnt' - else if (status === 'accepted') - var p = 'zgvAkzeptiert'; - $('#zgvStatusText').text(FHC_PhrasesLib.t('infocenter', p)); - } else if (FHC_AjaxClient.isError(data)) - FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); - }, - errorCallback: function(jqXHR, textStatus, errorThrown) - { - FHC_DialogLib.alertError((jqXHR.responseText)); - } - } - ); - }, saveZgv: function(data) { @@ -405,8 +341,9 @@ var InfocenterDetails = { } ); }, - saveNotiz: function(personid, data) + saveNotiz: function(personid, data, callback) { + var callbackValue = data; FHC_AjaxClient.ajaxCallPost( CALLED_PATH + '/saveNotiz/' + encodeURIComponent(personid), data, @@ -416,6 +353,8 @@ var InfocenterDetails = { { InfocenterDetails._refreshNotizen(); InfocenterDetails._refreshLog(); + if ($.isFunction(callback)) + callback(callbackValue); } else { @@ -811,38 +750,8 @@ var InfocenterDetails = { InfocenterDetails.zgvUebernehmen(personid, prestudentid, btn); }); - $('.zgvRueckfragen').click(function () - { - //var btn = $(this); - var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); - //$('#zgvUebernehmenNotice').remove(); - var data = { - 'person_id' : personid, - 'prestudent_id' : prestudentid - } - InfocenterDetails.zgvRueckfragen(data); - }); - - $('.zgvAkzeptieren').click(function (){ - var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); - - var data = { - 'person_id' : personid, - 'prestudent_id' : prestudentid, - 'status' : 'accepted' - } - InfocenterDetails.zgvStatusUpdate(data); - }); - - $('.zgvAblehnen').click(function (){ - var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); - - var data = { - 'person_id' : personid, - 'prestudent_id' : prestudentid, - 'status' : 'rejected' - } - InfocenterDetails.zgvStatusUpdate(data); + $('.notizModal').on('hidden.bs.modal', function () { + $(':input', this).val(''); }); //zgv speichern diff --git a/public/js/infocenter/zgvUeberpruefung.js b/public/js/infocenter/zgvUeberpruefung.js new file mode 100644 index 000000000..e76dcee2e --- /dev/null +++ b/public/js/infocenter/zgvUeberpruefung.js @@ -0,0 +1,189 @@ +$(document).ready(function () +{ + var personid = $("#hiddenpersonid").val(); + + if ($('#zgvpruefungen').length) + { + $('#zgvpruefungen .zgvRueckfragen').each(function() { + if($(this).is(':disabled')) { + zgvUeberpruefung.checkStatus(InfocenterDetails._getPrestudentIdFromElementId($(this).attr('id'))); + } + }); + } else + { + zgvUeberpruefung.checkStatus(); + } + + $('.zgvRueckfragen').click(function () + { + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + + var data = { + 'person_id' : personid, + 'prestudent_id' : prestudentid + } + zgvUeberpruefung.zgvRueckfragen(data); + }); + + $('.zgvAkzeptieren').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + + var data = { + 'person_id' : personid, + 'prestudent_id' : prestudentid, + 'status' : 'accepted' + } + zgvUeberpruefung.zgvStatusUpdate(data); + }); + + $('.zgvAblehnen').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + $('#inputStatus_' + prestudentid).val('rejected'); + $('#notizModal_' + prestudentid).modal('show'); + }); + + $('.zgvAkzeptierenPruefung').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + $('#inputStatus_' + prestudentid).val('accepted_pruefung'); + $('#notizModal_' + prestudentid).modal('show'); + }); + + $('.saveZgvNotiz').click(function (){ + var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + + if ($('#inputNotizTitelModal').val() === '' || $('#inputNotizTextModal').val() === '') + return FHC_DialogLib.alertWarning('Please fill out all fields'); + + var data = { + 'person_id' : personid, + 'notiztitel' : $('#inputNotizTitelModal').val(), + 'notiz' : $('#inputNotizTextModal').val(), + 'prestudent_id' : prestudentid, + 'status' : $('#inputStatus_' + prestudentid).val() + } + + InfocenterDetails.saveNotiz(personid, data, zgvUeberpruefung.zgvStatusUpdate); + + $('#notizModal_' + prestudentid).modal('hide'); + }); +}); + +var zgvUeberpruefung = { + checkStatus: function(prestudent_id) + { + if (prestudent_id === undefined) + prestudent_id = zgvUeberpruefung.getPrestudentId(); + + FHC_AjaxClient.ajaxCallGet( + "system/infocenter/ZGVUeberpruefung/getZgvStatusByPrestudent", + { + prestudent_id : prestudent_id + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + $('#zgvBearbeitungButtons_' + prestudent_id +' button').each(function() { + $(this).attr('disabled', false); + }); + var status = FHC_AjaxClient.getData(data); + + switch (status) + { + case 'rejected' : + $('#zgvAblehnen_' + prestudent_id).attr('disabled', true); + $('#zgvStatusText_' + prestudent_id).text(FHC_PhrasesLib.t('infocenter', 'zgvNichtErfuellt')); + break; + case 'accepted' : + $('#zgvAkzeptieren_' + prestudent_id).attr('disabled', true); + $('#zgvStatusText_' + prestudent_id).text(FHC_PhrasesLib.t('infocenter', 'zgvErfuellt')); + break; + case 'accepted_pruefung' : + $('#zgvAkzeptierenPruefung_' + prestudent_id).attr('disabled', true); + $('#zgvStatusText_' + prestudent_id).text(FHC_PhrasesLib.t('infocenter', 'zgvErfuelltPruefung')); + break; + case 'pruefung_stg' : + $('#zgvRueckfragen_' + prestudent_id).attr('disabled', true); + $('#zgvStatusText_' + prestudent_id).text(FHC_PhrasesLib.t('infocenter', 'zgvInPruefung')); + break; + } + } + }, + errorCallback: function(data, textStatus, errorThrown) + { + FHC_DialogLib.alertError(data); + }, + veilTimeout: 0 + } + ); + }, + + zgvRueckfragen: function(data) + { + var prestudent_id = data.prestudent_id; + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/zgvRueckfragen', + data, + { + successCallback: function(data, textStatus, jqXHR) + { + if (FHC_AjaxClient.hasData(data)) + { + zgvUeberpruefung.checkStatus(prestudent_id); + + var response = FHC_AjaxClient.getData(data); + + if (response.hold === false) + { + var datum = new Date(); + datum.setDate(datum.getDate() + 14); + var formatedDate = $.datepicker.formatDate("mm/dd/yy", datum); + InfocenterDetails.setPersonOnHold(response.person_id, formatedDate); + } + + FHC_DialogLib.alertSuccess(response.msg); + } else if(FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError((jqXHR.responseText)); + } + } + ); + }, + + zgvStatusUpdate: function(data) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/zgvStatusUpdate', + data, + { + successCallback: function(data, textStatus, jqXHR) + { + if (FHC_AjaxClient.hasData(data)) + { + zgvUeberpruefung.checkStatus(); + var response = FHC_AjaxClient.getData(data) + + if (response.openZgv === false) + InfocenterDetails.removePersonOnHold(response.person_id); + + FHC_DialogLib.alertSuccess(response.msg); + } else if (FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + }, + errorCallback: function(jqXHR, textStatus, errorThrown) + { + FHC_DialogLib.alertError((jqXHR.responseText)); + } + } + ); + }, + + getPrestudentId: function() + { + var id = $('.zgvBearbeitungButtons .zgvAkzeptierenPruefung').attr('id'); + return InfocenterDetails._getPrestudentIdFromElementId(id); + } +} \ No newline at end of file diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index a20892fb4..6ccf5de37 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4715,6 +4715,7 @@ if(!$result = @$db->db_query("SELECT 1 FROM public.tbl_zgvpruefungstatus LIMIT 1 INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('pruefung_stg', 'Wird vom Studiengang geprüft'); INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('rejected', 'Vom Studiengang abgelehnt'); INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('accepted', 'Vom Studiengang akzeptiert'); + INSERT INTO public.tbl_zgvpruefungstatus(status_kurzbz, bezeichnung) VALUES('accepted_pruefung', 'Vom Studiengang akzeptiert mit Prüfung'); GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_zgvpruefungstatus TO vilesci; GRANT SELECT ON public.tbl_zgvpruefungstatus TO web; diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 180e43cc4..5a5b983a2 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -404,11 +404,58 @@ $filters = array( array( 'app' => 'infocenter', 'dataset_name' => 'zgvUeberpruefung', - 'filter_kurzbz' => 'zgvUeberpruefung', - 'description' => '{ZGV Übersicht}', - 'sort' => 4, + 'filter_kurzbz' => 'zgvOffen', + 'description' => '{ZGV Überprüfung}', + 'sort' => 1, + 'default_filter' => true, + 'filter' => ' + { + "name": "Zgv Überprüfung", + "columns": [ + {"name": "PreStudentID"}, + {"name": "Vorname"}, + {"name": "Nachname"}, + {"name": "Studiengang"} + ], + "filters": [ + { + "name": "Status", + "condition": "stg", + "operation": "contains" + } + ] + } + ', + 'oe_kurzbz' => null, + ), + array( + 'app' => 'infocenter', + 'dataset_name' => 'zgvUeberpruefung', + 'filter_kurzbz' => 'zgvRest', + 'description' => '{ZGV abgeschlossen}', + 'sort' => 2, + 'default_filter' => true, + 'filter' => ' + { + "name": "Zgv abgeschlossen", + "columns": [ + {"name": "PreStudentID"}, + {"name": "Vorname"}, + {"name": "Nachname"}, + {"name": "Studiengang"}, + {"name": "Status"} + ], + "filters": [ + { + "name": "Status", + "condition": "stg", + "operation": "ncontains" + } + ] + } + ', + 'oe_kurzbz' => null, ), - array( 'app' => 'budget', 'dataset_name' => 'budgetoverview', diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index a151a723b..9f9c541d6 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -88,6 +88,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'text', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Text', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'text', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global', @@ -3006,66 +3026,86 @@ $phrases = array( ) ) ), - array( - 'app' => 'infocenter', - 'category' => 'infocenter', - 'phrase' => 'zgvRueckfragen', - 'insertvon' => 'system', - 'phrases' => array( - array( - 'sprache' => 'German', - 'text' => 'ZGV Prüfung beantragen', - 'description' => '', - 'insertvon' => 'system' - ), - array( - 'sprache' => 'English', - 'text' => 'apply for a ZGV examination', - 'description' => '', - 'insertvon' => 'system' - ) - ) - ), array( - 'app' => 'infocenter', - 'category' => 'infocenter', - 'phrase' => 'zgvAkzeptieren', - 'insertvon' => 'system', - 'phrases' => array( - array( - 'sprache' => 'German', - 'text' => 'Dokumente akzeptieren', - 'description' => '', - 'insertvon' => 'system' - ), - array( - 'sprache' => 'English', - 'text' => 'accept documents', - 'description' => '', - 'insertvon' => 'system' - ) - ) - ), + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvRueckfragen', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV Prüfung beantragen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'apply for a ZGV examination', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( - 'app' => 'infocenter', - 'category' => 'infocenter', - 'phrase' => 'zgvAblehnen', - 'insertvon' => 'system', - 'phrases' => array( - array( - 'sprache' => 'German', - 'text' => 'Dokumente ablehnen', - 'description' => '', - 'insertvon' => 'system' - ), - array( - 'sprache' => 'English', - 'text' => 'reject documents', - 'description' => '', - 'insertvon' => 'system' - ) - ) - ), + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvErfuellt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV erfüllt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ZGV fulfilled', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvNichtErfuellt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV nicht erfüllt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ZGV unfulfilled', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'zgvErfuelltPruefung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'ZGV erfüllt mit Prüfung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ZGV fulfilled with exam', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'infocenter', 'category' => 'infocenter', @@ -3086,46 +3126,6 @@ $phrases = array( ) ) ), - array( - 'app' => 'infocenter', - 'category' => 'infocenter', - 'phrase' => 'zgvAkzeptiert', - 'insertvon' => 'system', - 'phrases' => array( - array( - 'sprache' => 'German', - 'text' => 'Dokumente akzeptiert', - 'description' => '', - 'insertvon' => 'system' - ), - array( - 'sprache' => 'English', - 'text' => 'accepted documents', - 'description' => '', - 'insertvon' => 'system' - ) - ) - ), - array( - 'app' => 'infocenter', - 'category' => 'infocenter', - 'phrase' => 'zgvAbgelehnt', - 'insertvon' => 'system', - 'phrases' => array( - array( - 'sprache' => 'German', - 'text' => 'Dokumente abgelehnt', - 'description' => '', - 'insertvon' => 'system' - ), - array( - 'sprache' => 'English', - 'text' => 'rejected documents', - 'description' => '', - 'insertvon' => 'system' - ) - ) - ), array( 'app' => 'infocenter', 'category' => 'infocenter', From c9bd10c3d033b14136f27150bfa0dacf7c8fbf2a Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 28 Apr 2021 16:53:43 +0200 Subject: [PATCH 25/95] zgv ueberpruefung bug fixes --- .../infocenter/infocenterZgvDetails.php | 2 +- .../infocenterZgvUeberpruefungData.php | 2 +- .../views/system/infocenter/zgvpruefungen.php | 8 ++++-- public/js/infocenter/infocenterDetails.js | 2 ++ public/js/infocenter/zgvUeberpruefung.js | 26 ++++++++----------- 5 files changed, 21 insertions(+), 19 deletions(-) diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index 20c573e34..a1362d2fa 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -128,7 +128,7 @@ - +
diff --git a/application/views/system/infocenter/infocenterZgvUeberpruefungData.php b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php index d2bf62dab..6614e6b2a 100644 --- a/application/views/system/infocenter/infocenterZgvUeberpruefungData.php +++ b/application/views/system/infocenter/infocenterZgvUeberpruefungData.php @@ -35,7 +35,7 @@ $filterWidgetArray = array( 'app' => 'infocenter', 'datasetName' => 'zgvUeberpruefung', 'filter_id' => $this->input->get('filter_id'), - 'requiredPermissions' => 'infocenter', + 'requiredPermissions' => 'lehre/zgvpruefung', 'datasetRepresentation' => 'tablesorter', 'additionalColumns' => array('Details'), 'hideOptions' => true, diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 6cc9f2f7a..258353aaa 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -308,6 +308,10 @@
+ + statusZGV))) ?: print_r('data-info="need"')?>> + +
@@ -315,10 +319,10 @@ - - + statusZGV))) ?: print_r('data-info="need"')?>>
diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 6c094f23f..60e45584c 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -893,6 +893,8 @@ var InfocenterDetails = { } } ); + + zgvUeberpruefung.checkAfterReload(); }, _refreshMessages: function() { diff --git a/public/js/infocenter/zgvUeberpruefung.js b/public/js/infocenter/zgvUeberpruefung.js index e76dcee2e..a5b3dfd19 100644 --- a/public/js/infocenter/zgvUeberpruefung.js +++ b/public/js/infocenter/zgvUeberpruefung.js @@ -2,17 +2,7 @@ $(document).ready(function () { var personid = $("#hiddenpersonid").val(); - if ($('#zgvpruefungen').length) - { - $('#zgvpruefungen .zgvRueckfragen').each(function() { - if($(this).is(':disabled')) { - zgvUeberpruefung.checkStatus(InfocenterDetails._getPrestudentIdFromElementId($(this).attr('id'))); - } - }); - } else - { - zgvUeberpruefung.checkStatus(); - } + zgvUeberpruefung.checkAfterReload(); $('.zgvRueckfragen').click(function () { @@ -86,6 +76,7 @@ var zgvUeberpruefung = { $('#zgvBearbeitungButtons_' + prestudent_id +' button').each(function() { $(this).attr('disabled', false); }); + var status = FHC_AjaxClient.getData(data); switch (status) @@ -141,6 +132,7 @@ var zgvUeberpruefung = { InfocenterDetails.setPersonOnHold(response.person_id, formatedDate); } + InfocenterDetails._refreshLog(); FHC_DialogLib.alertSuccess(response.msg); } else if(FHC_AjaxClient.isError(data)) FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); @@ -155,6 +147,7 @@ var zgvUeberpruefung = { zgvStatusUpdate: function(data) { + var prestudent_id = data.prestudent_id; FHC_AjaxClient.ajaxCallPost( CALLED_PATH + '/zgvStatusUpdate', data, @@ -163,7 +156,7 @@ var zgvUeberpruefung = { { if (FHC_AjaxClient.hasData(data)) { - zgvUeberpruefung.checkStatus(); + zgvUeberpruefung.checkStatus(prestudent_id); var response = FHC_AjaxClient.getData(data) if (response.openZgv === false) @@ -181,9 +174,12 @@ var zgvUeberpruefung = { ); }, - getPrestudentId: function() + checkAfterReload: function() { - var id = $('.zgvBearbeitungButtons .zgvAkzeptierenPruefung').attr('id'); - return InfocenterDetails._getPrestudentIdFromElementId(id); + $('.zgvStatusText').each(function() { + if($(this).data('info')) { + zgvUeberpruefung.checkStatus(InfocenterDetails._getPrestudentIdFromElementId($(this).attr('id'))); + } + }); } } \ No newline at end of file From 5c339ce448cecd5480ed583f61867214c07881e2 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 28 Apr 2021 16:56:50 +0200 Subject: [PATCH 26/95] zgv ueberpruefung bug fixes --- public/js/infocenter/zgvUeberpruefung.js | 3 --- 1 file changed, 3 deletions(-) diff --git a/public/js/infocenter/zgvUeberpruefung.js b/public/js/infocenter/zgvUeberpruefung.js index a5b3dfd19..d7de09ca6 100644 --- a/public/js/infocenter/zgvUeberpruefung.js +++ b/public/js/infocenter/zgvUeberpruefung.js @@ -61,9 +61,6 @@ $(document).ready(function () var zgvUeberpruefung = { checkStatus: function(prestudent_id) { - if (prestudent_id === undefined) - prestudent_id = zgvUeberpruefung.getPrestudentId(); - FHC_AjaxClient.ajaxCallGet( "system/infocenter/ZGVUeberpruefung/getZgvStatusByPrestudent", { From d490eb4323c46dd3e6e102a4e7fc9d23426f3e79 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 29 Apr 2021 11:12:48 +0200 Subject: [PATCH 27/95] freigabe nur fuer den bachelor --- application/views/system/infocenter/zgvpruefungen.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 1e2f1cca4..c80a4e15c 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -415,7 +415,7 @@ $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); } - /*if ($studiengangtyp !== 'b') + if ($studiengangtyp !== 'b') { $disabled = 'disabled'; $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); @@ -426,7 +426,7 @@ $disabledStg = 'disabled'; $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); } - }*/ + } ?>
From 062ff74b03bfac9e73bb17305172d1d94896def4 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 4 May 2021 22:09:47 +0200 Subject: [PATCH 28/95] Mails bei freigabe zum RT und Freigabe an Studiengang fuer Master hinzugefuegt --- .../views/system/infocenter/zgvpruefungen.php | 6 +++--- public/js/infocenter/infocenterDetails.js | 20 ++++++++++++++++--- system/phrasesupdate.php | 6 +++--- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 41b549616..140b6696b 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -413,16 +413,16 @@ $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); } - if ($studiengangtyp !== 'b') + if ($studiengangtyp !== 'b' && $studiengangtyp !== 'm') { $disabled = 'disabled'; - $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); + $disabledTxt = $this->p->t('infocenter', 'nurBachelorMasterFreigeben'); // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter if (!in_array($studiengang_kz, $fit_programme_studiengaenge)) { $disabledStg = 'disabled'; - $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); + $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorMasterFreigeben'); } } ?> diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 7023af277..09f4ed6f7 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -3,9 +3,11 @@ const BASE_URL = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJEC const CALLED_PATH = FHC_JS_DATA_STORAGE_OBJECT.called_path; const CONTROLLER_URL = BASE_URL + "/"+CALLED_PATH; const RTFREIGABE_MESSAGE_VORLAGE = "InfocenterRTfreigegeben"; +const RTFREIGABE_MESSAGE_VORLAGE_MASTER = "InfocenterRTfreigegebenM"; const RTFREIGABE_MESSAGE_VORLAGE_QUER = "InfocenterRTfreigegQuer"; const RTFREIGABE_MESSAGE_VORLAGE_QUER_KURZ = "InfocenterRTfreigegQuerKurz"; const STGFREIGABE_MESSAGE_VORLAGE = "InfocenterSTGfreigegeben"; +const STGFREIGABE_MESSAGE_VORLAGE_MASTER = "InfocenterSTGfreigegebenM"; //Statusgründe for which no Studiengang Freigabe Message should be sent const FIT_PROGRAMM_STUDIENGAENGE = [10021, 10027]; @@ -596,7 +598,7 @@ var InfocenterDetails = { var fitstg = $.inArray(parseInt(prestudent.studiengang_kz), FIT_PROGRAMM_STUDIENGAENGE) >= 0; if (receiverPrestudentstatus.studiensemester_kurzbz === prestudentstatus.studiensemester_kurzbz - && (prestudent.studiengangtyp === "b" || fitstg)) + && (prestudent.studiengangtyp === "b" || prestudent.studiengangtyp === "m" || fitstg)) { if (prestudent.isRtFreigegeben) { @@ -660,7 +662,13 @@ var InfocenterDetails = { else { //send normal RTfreigabe message - vorlage = RTFREIGABE_MESSAGE_VORLAGE + if (receiverPrestudent.studiengangtyp === 'm') + { + vorlage = RTFREIGABE_MESSAGE_VORLAGE_MASTER + }else + { + vorlage = RTFREIGABE_MESSAGE_VORLAGE + } } InfocenterDetails.sendFreigabeMessage(prestudent_id, vorlage, msgvars); @@ -671,7 +679,13 @@ var InfocenterDetails = { //if Freigabe to Studiengang, send StgFreigabe Message if not already sent and allowed to send if (!stgFreigegeben && receiverPrestudent.sendStgFreigabeMsg === true) { - InfocenterDetails.sendFreigabeMessage(prestudent_id, STGFREIGABE_MESSAGE_VORLAGE, msgvars); + if (receiverPrestudent.studiengangtyp === 'm' && (freigabedata.statusgrundbezeichnung === 'Ergänzungsprüfungen' || freigabedata.statusgrundbezeichnung === 'Supplementary exams')) + { + InfocenterDetails.sendFreigabeMessage(prestudent_id, STGFREIGABE_MESSAGE_VORLAGE_MASTER, msgvars); + }else + { + InfocenterDetails.sendFreigabeMessage(prestudent_id, STGFREIGABE_MESSAGE_VORLAGE, msgvars); + } } } }; diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index cbfbdcdc9..12b28d10a 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -3549,18 +3549,18 @@ $phrases = array( array( 'app' => 'infocenter', 'category' => 'infocenter', - 'phrase' => 'nurBachelorFreigeben', + 'phrase' => 'nurBachelorMasterFreigeben', 'insertvon' => 'system', 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'Nur Bachelorstudiengänge können freigegeben werden.', + 'text' => 'Nur Bachelorstudiengänge/Masterstudiengänge können freigegeben werden.', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => 'Only bachelor programmes can be approved.', + 'text' => 'Only bachelor/master programmes can be approved.', 'description' => '', 'insertvon' => 'system' ) From 6f885fb924656bee76636e0bbec22a8d82766d00 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Fri, 7 May 2021 22:23:48 +0200 Subject: [PATCH 29/95] fixed typo and put the insert on a other position --- application/models/system/Variablenname_model.php | 2 +- system/dbupdate_3.3.php | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/application/models/system/Variablenname_model.php b/application/models/system/Variablenname_model.php index 005834f67..869a03275 100644 --- a/application/models/system/Variablenname_model.php +++ b/application/models/system/Variablenname_model.php @@ -12,7 +12,7 @@ class Variablenname_model extends DB_Model ) sem WHERE start > now() LIMIT 1;', - 'infocenter_studiensgangtyp' => 'SELECT infocenter_studiensgangtyp FROM public.tbl_variablename LIMIT 1' + 'infocenter_studiensgangtyp' => 'SELECT infocenter_studiensgangtyp FROM public.tbl_variablenname LIMIT 1' ); /** diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index f8d569cd7..8c105f470 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -3232,7 +3232,6 @@ if(!@$db->db_query("SELECT 0 FROM public.tbl_variablenname WHERE 0 = 1")) INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'kontofilterstg\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'kollision_student\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'infocenter_studiensemester\', null); - INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'infocenter_studiensgangtyp\', \'b\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_zeitsperre\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_reservierung\', \'false\'); INSERT INTO public.tbl_variablenname (name, defaultwert) VALUES (\'ignore_kollision\', \'false\'); @@ -3266,6 +3265,20 @@ if(!@$db->db_query("SELECT 0 FROM public.tbl_variablenname WHERE 0 = 1")) echo '
Granted privileges to vilesci on public.tbl_variablenname'; } +// Add new name type in public.tbl_variablenname +if ($result = @$db->db_query("SELECT 1 FROM public.tbl_variablenname WHERE name = 'infocenter_studiensgangtyp';")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO public.tbl_variablenname(name, defaultwert) VALUES('infocenter_studiensgangtyp', 'b');"; + + if (!$db->db_query($qry)) + echo 'public.tbl_variablenname '.$db->db_last_error().'
'; + else + echo 'public.tbl_variablenname: Added name "infocenter_studiensgangtyp"
'; + } +} + // Add column projektphase_id to tbl_zeitaufzeichnung if(!$result = @$db->db_query("SELECT projektphase_id FROM campus.tbl_zeitaufzeichnung LIMIT 1")) { From 2c6d8937f64eb322af4feaac831412b7f7f398d8 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 12 May 2021 12:48:29 +0200 Subject: [PATCH 30/95] funktion hinzugefuegt um mehrere bewerber abzuweisen und status wird nur angezeigt wenn aktiv --- .../system/infocenter/InfoCenter.php | 56 ++++++++- application/models/crm/Prestudent_model.php | 13 +++ application/models/crm/Statusgrund_model.php | 13 +++ .../models/organisation/Studiengang_model.php | 13 +++ .../views/system/infocenter/infocenter.php | 1 + .../js/infocenter/infocenterPersonDataset.js | 107 ++++++++++++++++++ 6 files changed, 197 insertions(+), 6 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 43de8bb60..fd3f98320 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -108,7 +108,9 @@ class InfoCenter extends Auth_Controller 'setOnHold' => 'infocenter:rw', 'removeOnHold' => 'infocenter:rw', 'getStudienjahrEnd' => 'infocenter:r', - 'setNavigationMenuArrayJson' => 'infocenter:r' + 'setNavigationMenuArrayJson' => 'infocenter:r', + 'getAbsageData' => 'infocenter:r', + 'saveAbsageForAll' => 'infocenter:rw' ) ); @@ -433,11 +435,14 @@ class InfoCenter extends Auth_Controller * Saves Absage for Prestudent including the reason for the Absage (statusgrund). * inserts Studiensemester and Ausbildungssemester for the new Absage of (chronologically) last status. */ - public function saveAbsage() + public function saveAbsage($prestudent_id = null, $statusgrund = null) { $json = null; - $prestudent_id = $this->input->post('prestudent_id'); - $statusgrund = $this->input->post('statusgrund'); + if (is_null($prestudent_id)) + $prestudent_id = $this->input->post('prestudent_id'); + + if (is_null($statusgrund)) + $statusgrund = $this->input->post('statusgrund'); $lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id); @@ -1427,8 +1432,8 @@ class InfoCenter extends Auth_Controller $this->_sortPrestudents($zgvpruefungen); - $abwstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::ABGEWIESENERSTATUS))->retval; - $intstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::INTERESSENTSTATUS))->retval; + $abwstatusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; + $intstatusgruende = $this->StatusgrundModel->getStatus(self::INTERESSENTSTATUS)->retval; $data = array ( 'zgvpruefungen' => $zgvpruefungen, @@ -1687,4 +1692,43 @@ class InfoCenter extends Auth_Controller $this->loglib->logError('Studiengang has no mail for sending Freigabe mail'); } } + + public function getAbsageData() + { + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + + $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; + $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm']); + + $data = array ( + 'statusgruende' => $statusgruende, + 'studiengaenge' => $studiengaenge->retval + ); + + $this->outputJsonSuccess($data); + } + + public function saveAbsageForAll() + { + $statusgrund = $this->input->post('statusgrund'); + $studiengang = $this->input->post('studiengang'); + $personen = $this->input->post('personen'); + + if ($statusgrund === 'null' || $studiengang === 'null' || empty($personen)) + $this->terminateWithJsonError("Bitte Statusgrund, Studiengang und Personen auswählen."); + + foreach($personen as $person) + { + $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person); + + if(!hasData($prestudent)) + continue; + + $prestudentData = getData($prestudent); + + $this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund); + } + + $this->outputJsonSuccess("Success"); + } } diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 2e014800c..41639d0ac 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -581,4 +581,17 @@ class Prestudent_model extends DB_Model return $this->execQuery($query, array($person_id)); } + + public function getPrestudentByStudiengangAndPerson($studiengang, $person) + { + $query = "SELECT ps.prestudent_id + FROM public.tbl_prestudentstatus pss + JOIN public.tbl_prestudent ps USING(prestudent_id) + JOIN public.tbl_studiengang sg USING(studiengang_kz) + JOIN lehre.tbl_studienplan sp USING(studienplan_id) + WHERE ps.person_id = ? + AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ?"; + + return $this->execQuery($query, array($person, $studiengang)); + } } diff --git a/application/models/crm/Statusgrund_model.php b/application/models/crm/Statusgrund_model.php index 4717a7571..f9b156b76 100644 --- a/application/models/crm/Statusgrund_model.php +++ b/application/models/crm/Statusgrund_model.php @@ -11,4 +11,17 @@ class Statusgrund_model extends DB_Model $this->dbTable = "public.tbl_status_grund"; $this->pk = "statusgrund_id"; } + + public function getStatus($status_kurzbz = null, $aktiv = null) + { + $where = array(); + if (!is_null($status_kurzbz)) + $where['status_kurzbz'] = $status_kurzbz; + if (!is_null($aktiv)) + $where['aktiv'] = $aktiv; + + $status = $this->loadWhere($where); + + return success($status->retval); + } } diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 8b8be0366..999fcbbd0 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -481,4 +481,17 @@ class Studiengang_model extends DB_Model return $this->loadWhere($condition); } + + public function getStudiengaengeWithOrgForm($typ) + { + $query = "SELECT DISTINCT (UPPER(sg.typ || sg.kurzbz || ':' || sp.orgform_kurzbz)) AS Studiengang + FROM public.tbl_prestudentstatus pss + JOIN public.tbl_prestudent ps USING(prestudent_id) + JOIN public.tbl_studiengang sg USING(studiengang_kz) + JOIN lehre.tbl_studienplan sp USING(studienplan_id) + WHERE sg.typ IN ? + ORDER BY Studiengang;"; + + return $this->execQuery($query, array($typ)); + } } diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php index 4005518a1..43e326bb5 100644 --- a/application/views/system/infocenter/infocenter.php +++ b/application/views/system/infocenter/infocenter.php @@ -13,6 +13,7 @@ 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, + 'dialoglib' => true, 'phrases' => array( 'person' => array('vorname', 'nachname'), 'global' => array('mailAnXversandt'), diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index 87a40c0f1..7ea048b71 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -31,6 +31,20 @@ var InfocenterPersonDataset = { var formHtml = '
'; $("#datasetActionsTop").before(formHtml); + var auswahlAbsageToggle = + 'Erweiterte Einstellungen'; + + var auswahlAbsage = + '' + + '' + + ''; + + InfocenterPersonDataset.getAbsageData(); + var studienSemesterHtml = ' ' + @@ -60,6 +74,14 @@ var InfocenterPersonDataset = { "
"+studienSemesterHtml+"
"+ "

"); + $("#datasetActionsBottom").append( + "
"+ + "
"+auswahlAbsageToggle+"
"+ + ""+ + "
" + + "
" + + "
" + ) $("button.incStudiensemester").click(function() { InfocenterPersonDataset.changeStudiensemesterUservar(1); }); @@ -68,6 +90,16 @@ var InfocenterPersonDataset = { InfocenterPersonDataset.changeStudiensemesterUservar(-1); }); + $('button.auswahlAbsageBtn').click(function() + { + InfocenterPersonDataset.saveAbsageForAll(); + }); + + $('a.absageToggle').click(function() + { + $('#absagePunkte').toggle(); + }) + var personcount = 0; FHC_AjaxClient.ajaxCallGet( @@ -203,6 +235,81 @@ var InfocenterPersonDataset = { ); }, + saveAbsageForAll: function() + { + var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]"); + + if(idsel.length <= 0) + return FHC_DialogLib.alertInfo("Bitte wählen Sie die Personen aus."); + + var statusgrund = $('.absgstatusgrund').val(); + var studiengang = $('.auswahlAbsageStg').val(); + + if(statusgrund === 'null' || studiengang === 'null') + return FHC_DialogLib.alertInfo("Bitte den Absagegrund und Studiengang auswählen."); + + var personen = []; + + for (var i = 0; i < idsel.length; i++) + { + personen.push($(idsel[i]).val()); + } + + FHC_AjaxClient.ajaxCallPost( + 'system/infocenter/InfoCenter/saveAbsageForAll', + { + 'statusgrund': statusgrund, + 'studiengang': studiengang, + 'personen' : personen + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isError(data)) + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); + + if (FHC_AjaxClient.hasData(data)) + FHC_FilterWidget.reloadDataset(); + + }, + errorCallback: function(jqXHR, textStatus, errorThrown) { + FHC_DialogLib.alertError(textStatus); + } + } + ); + }, + + getAbsageData: function() + { + FHC_AjaxClient.ajaxCallGet( + 'system/infocenter/InfoCenter/getAbsageData', + {}, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + data = FHC_AjaxClient.getData(data); + $.each(data.statusgruende, function(key, value){ + $('.absgstatusgrund').append($("
load->view('system/infocenter/infocenterData.php'); ?> + load->view('system/infocenter/absageModal.php'); ?>
diff --git a/public/js/infocenter/infocenterPersonDataset.js b/public/js/infocenter/infocenterPersonDataset.js index e5f91a7ee..efdd7dc99 100644 --- a/public/js/infocenter/infocenterPersonDataset.js +++ b/public/js/infocenter/infocenterPersonDataset.js @@ -91,6 +91,19 @@ var InfocenterPersonDataset = { }); $('button.auswahlAbsageBtn').click(function() + { + var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]"); + + if(idsel.length <= 0) + return FHC_DialogLib.alertInfo("Bitte wählen Sie die Personen aus."); + + if($('.absgstatusgrund').val() === 'null' || $('.auswahlAbsageStg').val() === 'null') + return FHC_DialogLib.alertInfo("Bitte den Absagegrund und Studiengang auswählen."); + + $(".absageModalForAll").modal("show"); + }); + + $('#saveAbsageForAll').click(function() { InfocenterPersonDataset.saveAbsageForAll(); }); @@ -239,15 +252,9 @@ var InfocenterPersonDataset = { { var idsel = $("#filterTableDataset input:checked[name=PersonId\\[\\]]"); - if(idsel.length <= 0) - return FHC_DialogLib.alertInfo("Bitte wählen Sie die Personen aus."); - var statusgrund = $('.absgstatusgrund').val(); var studiengang = $('.auswahlAbsageStg').val(); - if(statusgrund === 'null' || studiengang === 'null') - return FHC_DialogLib.alertInfo("Bitte den Absagegrund und Studiengang auswählen."); - var personen = []; for (var i = 0; i < idsel.length; i++) @@ -268,8 +275,9 @@ var InfocenterPersonDataset = { FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); if (FHC_AjaxClient.hasData(data)) - FHC_FilterWidget.reloadDataset(); + FHC_DialogLib.alertSuccess("Erfolgreich gespeichert.") + $(".absageModalForAll").modal("hide"); }, errorCallback: function(jqXHR, textStatus, errorThrown) { FHC_DialogLib.alertError(textStatus); From 39668890f2a976784a7946cfa95dd32687d659c0 Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 27 May 2021 16:22:47 +0200 Subject: [PATCH 35/95] neue Funktion ZGVMasterNation setzen --- include/dokument.class.php | 294 +++++++++++++++++------------------ include/prestudent.class.php | 145 +++++++++++++---- 2 files changed, 252 insertions(+), 187 deletions(-) diff --git a/include/dokument.class.php b/include/dokument.class.php index b2b59b6dd..8e1f16346 100644 --- a/include/dokument.class.php +++ b/include/dokument.class.php @@ -339,11 +339,11 @@ class dokument extends basis_db } $qry = "SELECT tbl_dokumentprestudent.* , tbl_dokument.* - FROM public.tbl_dokumentprestudent + FROM public.tbl_dokumentprestudent JOIN public.tbl_dokument USING(dokument_kurzbz) LEFT JOIN public.tbl_vorlage ON (tbl_dokumentprestudent.dokument_kurzbz = tbl_vorlage.vorlage_kurzbz) WHERE prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); - + if(!$archivdokumente) { $qry.=" AND (tbl_vorlage.archivierbar = FALSE OR tbl_vorlage.archivierbar IS NULL)"; @@ -401,7 +401,7 @@ class dokument extends basis_db } $qry = "SELECT tbl_dokument.* , tbl_dokumentstudiengang.* - FROM public.tbl_dokument + FROM public.tbl_dokument JOIN public.tbl_dokumentstudiengang USING(dokument_kurzbz) LEFT JOIN public.tbl_vorlage ON (tbl_dokument.dokument_kurzbz = tbl_vorlage.vorlage_kurzbz) WHERE studiengang_kz=".$this->db_add_param($studiengang_kz, FHC_INTEGER); @@ -836,11 +836,11 @@ class dokument extends basis_db return false; } } - + /** * Liefert die Studiengänge bei denen das übergebene Dokument benötigt wird * @param string $dokument_kurzbz Kurzbz des Dokuments - * @param integer $person_id Optional. Die Dokumente werden zusätzlich auf die Studiengänge eingeschränkt für die sich eine Person beworben hat. + * @param integer $person_id Optional. Die Dokumente werden zusätzlich auf die Studiengänge eingeschränkt für die sich eine Person beworben hat. * @return object Objekt mit den Studiengängen oder false. */ public function getStudiengaengeDokument($dokument_kurzbz, $person_id = null) @@ -854,7 +854,7 @@ class dokument extends basis_db AND person_id =".$this->db_add_param($person_id, FHC_INTEGER)." AND tbl_prestudentstatus.status_kurzbz = 'Interessent' AND get_rolle_prestudent (prestudent_id, NULL) NOT IN ('Abgewiesener','Abbrecher') - + ORDER BY kuerzel"; if($result = $this->db_query($qry)) @@ -869,12 +869,12 @@ class dokument extends basis_db $stg_obj->studiengang_kz = $row->studiengang_kz; $stg_obj->english = $row->english; $stg_obj->stufe = $row->stufe; - + $this->result[] = $stg_obj; } return $stg_obj; } - else + else return false; } else @@ -882,181 +882,167 @@ class dokument extends basis_db $this->errormsg="Fehler bei der Abfrage aufgetreten"; return false; } - } /** - * Akzeptiert ein bestimmtes Dokument - * Optional kann auch eine studiengang_kz uebergeben werden, ob speziell dort das Dokument akzeptiert wurde - * @param $dokument_kurzbz - * @param $person_id - * @param $studiengang_kz integer oder array aus mehreren studiengang_kz - * @return boolean true wenn akzeptiert, false wenn noch nicht akzeptiert - */ -function akzeptiereDokument($dokument_kurzbz, $person_id) -{ - $db = new basis_db(); - $arrayDoksZuAkzeptieren = array(); - - //get Prestudent_ids - $qry = "SELECT - prestudent_id - FROM - tbl_prestudent ps, tbl_studiengang sg - WHERE - ps.studiengang_kz = sg.studiengang_kz - AND sg.typ = 'm' - AND person_id = ".$this->db_add_param($person_id)." - AND not exists( - SELECT * - from tbl_dokumentprestudent dok - where dok.prestudent_id = ps.prestudent_id - and dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz).")"; - - - //echo var_dump($qry); - //for all prestudents - - - //gibt ein Array von zu akzeptierenden Dokumenten zurück - if($db->db_query($qry)) + * Akzeptiert ein bestimmtes Dokument + * @param char $dokument_kurzbz Bezeichner Dokument. + * @param int $person_id Personenkennzeichen. + * @return boolean true wenn akzeptiert, false wenn noch nicht akzeptiert + */ + protected function akzeptiereDokument($dokument_kurzbz, $person_id) { - $num_rows = $db->db_num_rows(); - // Wenn kein ergebnis return 0 sonst ID - if ($num_rows>0) + $db = new basis_db(); + $arrayDoksZuAkzeptieren = array(); + + //get Prestudent_ids + $qry = "SELECT + prestudent_id + FROM + tbl_prestudent ps, tbl_studiengang sg + WHERE + ps.studiengang_kz = sg.studiengang_kz + AND sg.typ = 'm' + AND person_id = ".$this->db_add_param($person_id)." + AND not exists( + SELECT * + from tbl_dokumentprestudent dok + where dok.prestudent_id = ps.prestudent_id + and dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz).")"; + + + //echo var_dump($qry); + //for all prestudents + + + //gibt ein Array von zu akzeptierenden Dokumenten zurück + if ($db->db_query($qry)) { - while($row = $db->db_fetch_object()) + $num_rows = $db->db_num_rows(); + // Wenn kein ergebnis return 0 sonst ID + if ($num_rows > 0) { - //echo var_dump($row->prestudent_id); - $arrayDoksZuAkzeptieren[] = $row->prestudent_id; - } - //print_r($arrayDoksZuAkzeptieren); - - //und jetzt für alle prestudent_ids das Dokument akzeptieren - - $qry = "INSERT INTO public.tbl_dokumentprestudent(dokument_kurzbz, prestudent_id) VALUES"; - //echo $qry; - - foreach ($arrayDoksZuAkzeptieren AS $prestudent_id){ - $qry.= "(".$this->db_add_param($dokument_kurzbz). ",". $prestudent_id . ")"; - - if (next($arrayDoksZuAkzeptieren)==true){ - $qry.= ","; + while ($row = $db->db_fetch_object()) + { + //echo var_dump($row->prestudent_id); + $arrayDoksZuAkzeptieren[] = $row->prestudent_id; } - } - $qry.= ";"; + //print_r($arrayDoksZuAkzeptieren); - echo $qry; + //und jetzt für alle prestudent_ids das Dokument akzeptieren - if($this->db_query($qry)) - { - echo " Jawoll: query ausgeführt"; - return true; + $qry = "INSERT INTO public.tbl_dokumentprestudent(dokument_kurzbz, prestudent_id) VALUES"; + //echo $qry; + + foreach ($arrayDoksZuAkzeptieren as $prestudent_id) + { + $qry .= "(".$this->db_add_param($dokument_kurzbz). ",". $prestudent_id. ")"; + + if (next($arrayDoksZuAkzeptieren) == true) + { + $qry .= ","; + } + } + $qry .= ";"; + + echo $qry; + + if ($this->db_query($qry)) + { + echo " Jawoll: query ausgeführt"; + return true; + } + else + { + $this->errormsg = 'Fehler beim Akzeptieren'; + return false; + } } else { - $this->errormsg = 'Fehler beim Akzeptieren'; - return false; + echo " Keine zu akzeptierenden Doks vorhanden"; } - - + return true; } + else - { - echo "keine zu akzeptierenden Doks vorhanden"; - } - - return true; + return false; } - else - return false; -} - /** - * entakzeptiert ein bestimmtes Dokument - * Optional kann auch eine studiengang_kz uebergeben werden, ob speziell dort das Dokument entakzeptiert wurde - * @param $dokument_kurzbz - * @param $person_id - * @param $studiengang_kz integer oder array aus mehreren studiengang_kz - * @return boolean true wenn entakzeptiert, false wenn noch nicht entakzeptiert - */ -function entakzeptiereDokument($dokument_kurzbz, $person_id) -{ - $db = new basis_db(); - $arrayDoksZuEntakzeptieren = array(); - - //get Prestudent_ids - - $qry = "SELECT - prestudent_id - from - tbl_dokumentprestudent - join - tbl_prestudent using (prestudent_id) - where - person_id = ".$this->db_add_param($person_id)." - and dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz); - - // echo var_dump($qry); - //for all prestudents - - - //gibt ein Array von zu Entakzeptierenden Dokumenten zurück - if($db->db_query($qry)) + * entakzeptiert ein bestimmtes Dokument + * @param char $dokument_kurzbz Kurzbezeichnung des zu entakzeptierenden Dokuments. + * @param int $person_id Personenkennzeichen. + * @return boolean true wenn entakzeptiert, false wenn noch nicht entakzeptiert + */ + protected function entakzeptiereDokument($dokument_kurzbz, $person_id) { - $num_rows = $db->db_num_rows(); - // Wenn kein ergebnis return 0 sonst ID - if ($num_rows>0) + $db = new basis_db(); + $arrayDoksZuEntakzeptieren = array(); + + //get Prestudent_ids + + $qry = "SELECT + prestudent_id + from + tbl_dokumentprestudent + join + tbl_prestudent using (prestudent_id) + where + person_id = ".$this->db_add_param($person_id)." + and dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz); + + // echo var_dump($qry); + + //gibt ein Array von zu Entakzeptierenden Dokumenten zurück + if ($db->db_query($qry)) { - while($row = $db->db_fetch_object()) + $num_rows = $db->db_num_rows(); + // Wenn kein ergebnis return 0 sonst ID + if ($num_rows > 0) { - //echo var_dump($row->prestudent_id); - $arrayDoksZuEntakzeptieren[] = $row->prestudent_id; - } - print_r($arrayDoksZuEntakzeptieren); - - //und jetzt für alle prestudent_ids das Dokument Entakzeptieren - - $qry = "DELETE FROM public.tbl_dokumentprestudent WHERE prestudent_id in ("; - //echo $qry; - - foreach ($arrayDoksZuEntakzeptieren AS $prestudent_id){ - $qry.= $prestudent_id; - - if (next($arrayDoksZuEntakzeptieren)==true){ - $qry.= ","; + while ($row = $db->db_fetch_object()) + { + //echo var_dump($row->prestudent_id); + $arrayDoksZuEntakzeptieren[] = $row->prestudent_id; } - } - $qry.= ");"; + print_r($arrayDoksZuEntakzeptieren); - echo $qry; + //und jetzt für alle prestudent_ids das Dokument Entakzeptieren - if($this->db_query($qry)) - { - echo " Jawoll: query ausgeführt"; - return true; + $qry = "DELETE FROM public.tbl_dokumentprestudent WHERE prestudent_id in ("; + //echo $qry; + + foreach ($arrayDoksZuEntakzeptieren as $prestudent_id) + { + $qry .= $prestudent_id; + + if (next($arrayDoksZuEntakzeptieren) == true) + { + $qry .= ","; + } + } + $qry .= ") AND dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz).";"; + + echo $qry; + + if ($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = 'Fehler beim Entakzeptieren'; + return false; + } } else { - $this->errormsg = 'Fehler beim Entakzeptieren'; - return false; + echo " Keine Entzuakzeptierenden Doks vorhanden"; } - - + return true; } else - { - echo "keine Entzuakzeptierenden Doks vorhanden"; - } - - return true; + return false; } - - else - return false; -} - - - } diff --git a/include/prestudent.class.php b/include/prestudent.class.php index 3b1e4d8a2..a3e0f5620 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2232,51 +2232,44 @@ class prestudent extends person $this->errormsg = 'Fehler beim Laden der Daten'; return false; } - } /** * Prueft, ob eine Person einen aktuellen PreStudentstatus-Eintrag besitzt, der die ZGV Master ersetzt - * @param integer $person_id + * @param int $person_id ID der zu überprüfenden Person. * @return true wenn vorhanden * false wenn nicht vorhanden - * false und errormsg wenn Fehler aufgetreten ist - */ - public function existsZGVIntern($person_id) + * false und errormsg wenn Fehler aufgetreten ist + */ + public function existsZGVIntern($person_id) + { + if (!is_numeric($person_id)) { - if(!is_numeric($person_id)) + $this->errormsg = 'Person_id muss eine gueltige Zahl sein'; + return false; + } + + + $qry = "SELECT count(*) as anzahl FROM public.tbl_prestudent + JOIN public.tbl_prestudentstatus USING (prestudent_id) + JOIN public.tbl_studiengang USING (studiengang_kz) + WHERE person_id = ".$this->db_add_param($person_id, FHC_INTEGER)." + AND status_kurzbz in ('Absolvent','Diplomand','Unterbrecher','Student') + AND typ in ('b','m','d')"; + + + if ($this->db_query($qry)) + { + if ($row = $this->db_fetch_object()) { - $this->errormsg = 'Person_id muss eine gueltige Zahl sein'; - return false; - } - - - $qry = "SELECT count(*) as anzahl FROM public.tbl_prestudent - JOIN public.tbl_prestudentstatus USING (prestudent_id) - JOIN public.tbl_studiengang USING (studiengang_kz) - WHERE person_id = ".$this->db_add_param($person_id, FHC_INTEGER)." - AND status_kurzbz in ('Absolvent','Diplomand','Unterbrecher','Student') - AND typ in ('b','m','d')"; - - - if($this->db_query($qry)) - { - if($row = $this->db_fetch_object()) + if ($row->anzahl > 0) { - if($row->anzahl>0) - { - $this->errormsg = ''; - return true; - } - else - { - $this->errormsg = ''; - return false; - } + $this->errormsg = ''; + return true; } else { - $this->errormsg = 'Fehler beim Laden der Daten'; + $this->errormsg = ''; return false; } } @@ -2286,5 +2279,91 @@ class prestudent extends person return false; } } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + /** + * Befüllt MasterZGV Nation mit Österreich + * @param int $person_id Personenkennzeichen. + * @return true wenn erfolgreich durchgeführt + * false und errormsg wenn ein Fehler aufgetreten ist + */ + public function setManationZGV($person_id) + { + if (!is_numeric($person_id)) + { + $this->errormsg = 'Person_id muss eine gueltige Zahl sein'; + return false; + } + + $db = new basis_db(); + $arrayleereManations = array(); + + //all prestudent_ids mit leerer ZGV_Nation + $qry = "SELECT + * + FROM + public.tbl_prestudent + JOIN + public.tbl_studiengang USING (studiengang_kz) + WHERE + person_id = ".$this->db_add_param($person_id)." + AND + zgvmanation is NULL + AND + typ in ('m','d')"; + + if ($db->db_query($qry)) + { + $num_rows = $db->db_num_rows(); + + if ($num_rows > 0) + { + while ($row = $db->db_fetch_object()) + { + //echo var_dump($row->prestudent_id); + $arrayleereManations[] = $row->prestudent_id; + } + print_r($arrayleereManations); + + $qry = "UPDATE + public.tbl_prestudent + SET + zgvmanation = 'A' + WHERE + prestudent_id in ("; + + foreach ($arrayleereManations as $prestudent_id) + { + $qry .= $prestudent_id; + + if (next($arrayleereManations) == true) + { + $qry .= ","; + } + } + $qry .= ");"; + + echo $qry; + + if ($this->db_query($qry)) + { + echo " ZGV-Master Nation A eingetragen!"; + return true; + } + else + { + $this->errormsg = 'Fehler beim Eintragen zgvMasternation'; + return false; + } + } + else + echo " Keine leere ZGVManation gefunden"; + return true; + } + } } From 36f52cf3cc30ce51a52d5e015fcb3e7e695680c3 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 31 May 2021 13:20:45 +0200 Subject: [PATCH 36/95] dokumententyp kann nun im Infocenter geaendert werden und zgv master wird angezeigt --- .../system/infocenter/InfoCenter.php | 50 ++++++++++++++++++- .../views/system/infocenter/dokpruefung.php | 9 +++- .../system/infocenter/infocenterData.php | 4 +- .../infocenter/infocenterFreigegebenData.php | 4 +- .../infocenterReihungstestAbsolviertData.php | 4 +- public/js/infocenter/infocenterDetails.js | 27 +++++++++- 6 files changed, 88 insertions(+), 10 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 43de8bb60..950507b0c 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -63,7 +63,13 @@ class InfoCenter extends Auth_Controller 'name' => 'Note updated', 'message' => 'Note with title %s was updated', 'success' => null - ) + ), + 'updatedoctyp' => array( + 'logtype' => 'Action', + 'name' => 'Document type updated', + 'message' => 'Type of Document %s was updated, set to %s', + 'success' => null + ), ); // Name of Interessentenstatus @@ -87,6 +93,7 @@ class InfoCenter extends Auth_Controller 'showDetails' => 'infocenter:r', 'unlockPerson' => 'infocenter:rw', 'saveFormalGeprueft' => 'infocenter:rw', + 'saveDocTyp' => 'infocenter:rw', 'getPrestudentData' => 'infocenter:r', 'getLastPrestudentWithZgvJson' => 'infocenter:r', 'getZgvInfoForPrestudent' => 'infocenter:r', @@ -114,6 +121,7 @@ class InfoCenter extends Auth_Controller // Loads models $this->load->model('crm/Akte_model', 'AkteModel'); + $this->load->model('crm/Dokument_model', 'DokumentModel'); $this->load->model('crm/Prestudent_model', 'PrestudentModel'); $this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel'); $this->load->model('crm/Statusgrund_model', 'StatusgrundModel'); @@ -211,9 +219,12 @@ class InfoCenter extends Auth_Controller $persondata = $this->_loadPersonData($person_id); $prestudentdata = $this->_loadPrestudentData($person_id); + $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); + $data = array_merge( $persondata, - $prestudentdata + $prestudentdata, + $dokumentdata ); $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); @@ -898,6 +909,41 @@ class InfoCenter extends Auth_Controller $this->outputJsonSuccess('success'); } + public function saveDocTyp($person_id) + { + $akte_id = $this->input->post('akte_id'); + $typ = $this->input->post('typ'); + + if (!isset($akte_id) || !isset($typ) || !isset($person_id)) + $this->terminateWithJsonError("Nicht alle sind Parameter übergeben worden"); + + $akte = $this->AkteModel->load($akte_id); + + if (!hasData($akte)) + $this->terminateWithJsonError("Fehler beim Laden der Akte"); + + $result = $this->AkteModel->update($akte_id, array('dokument_kurzbz' => $typ)); + + if (!isSuccess($result)) + $this->terminateWithJsonError("Fehler beim Update aufgetreten"); + + $dokument = $this->DokumentModel->load($akte->retval[0]->dokument_kurzbz); + + if (!hasData($dokument)) + $this->terminateWithJsonError("Fehler beim Laden des Dokumententypes"); + + $this->_log( + $person_id, + 'updatedoctyp', + array( + isEmptyString($akte->retval[0]->titel) ? $akte->retval[0]->bezeichnung : $akte->retval[0]->titel, + isEmptyString($dokument->retval[0]->bezeichnung) ? $dokument->retval[0]->dokument_kurbz : $dokument->retval[0]->bezeichnung + ) + ); + + $this->outputJsonSuccess('success'); + } + // ----------------------------------------------------------------------------------------------------------------- // Private methods diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index 7c431fc46..b7b22150f 100644 --- a/application/views/system/infocenter/dokpruefung.php +++ b/application/views/system/infocenter/dokpruefung.php @@ -18,7 +18,14 @@ titel) ? $dokument->bezeichnung : $dokument->titel ?> - dokument_bezeichnung ?> + + + erstelltam), 'd.m.Y') ?> langtext ?> diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 0c7030059..6eb1accae 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -208,10 +208,10 @@ LIMIT 1 ) AS "StgAktiv", ( - SELECT ps.zgvnation + SELECT CONCAT(COALESCE(ps.zgvnation, \'-\'), \' / \' , COALESCE(ps.zgvmanation, \'-\')) FROM public.tbl_prestudent ps WHERE ps.person_id = p.person_id - ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC + ORDER BY ps.zgvnation, ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 ) AS "ZGVNation" FROM public.tbl_person p diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index aab69b651..02d15655a 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -205,10 +205,10 @@ LIMIT 1 ) AS "ReihungstestDate", ( - SELECT ps.zgvnation + SELECT CONCAT(COALESCE(ps.zgvnation, \'-\'), \' / \' , COALESCE(ps.zgvmanation, \'-\')) FROM public.tbl_prestudent ps WHERE ps.person_id = p.person_id - ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC + ORDER BY ps.zgvnation, ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 ) AS "ZGVNation" FROM public.tbl_person p diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 22b122bb0..9f7a5204a 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -161,10 +161,10 @@ LIMIT 1 ) AS "ReihungstestDatum", ( - SELECT ps.zgvnation + SELECT CONCAT(COALESCE(ps.zgvnation, \'-\'), \' / \' , COALESCE(ps.zgvmanation, \'-\')) FROM public.tbl_prestudent ps WHERE ps.person_id = p.person_id - ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC + ORDER BY ps.zgvnation, ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 ) AS "ZGVNation" FROM public.tbl_person p diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 7023af277..43f3315e0 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -114,7 +114,13 @@ $(document).ready(function () { $('html,body').animate({scrollTop:0},250,'linear'); } - ) + ); + + $('.aktenid').change(function(){ + var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + var typ = $(this).val(); + InfocenterDetails.saveDocTyp(personid, akteid, typ); + }); }); var InfocenterDetails = { @@ -702,6 +708,25 @@ var InfocenterDetails = { ); }, + saveDocTyp: function(personid, akteid, typ) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + "/saveDocTyp/"+encodeURIComponent(personid), + { + "akte_id": akteid, + "typ" : typ + }, + { + successCallback: function(data, textStatus, jqXHR) { + InfocenterDetails._refreshLog(); + }, + errorCallback: function() { + FHC_DialogLib.alertWarning("Document type could not be updated"); + } + } + ); + }, + // ----------------------------------------------------------------------------------------------------------------- // (private) methods executed after ajax (refreshers) From 6550fb6301f1929a7fb8411ae7eceff4e8d7cb23 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 31 May 2021 13:29:13 +0200 Subject: [PATCH 37/95] wording angepasst --- public/js/infocenter/zgvUeberpruefung.js | 2 +- system/phrasesupdate.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/infocenter/zgvUeberpruefung.js b/public/js/infocenter/zgvUeberpruefung.js index 37189d9fb..0be4dfdad 100644 --- a/public/js/infocenter/zgvUeberpruefung.js +++ b/public/js/infocenter/zgvUeberpruefung.js @@ -37,7 +37,7 @@ $(document).ready(function () var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); $('#inputStatus_' + prestudentid).val('accepted_pruefung'); $('#notizModal_' + prestudentid).modal('show'); - $('#notizModal_' + prestudentid + ' #inputNotizTitelModal').val('ZGV erfüllt mit Prüfung') + $('#notizModal_' + prestudentid + ' #inputNotizTitelModal').val('ZGV mit Prüfungen erfüllt') }); $('.saveZgvNotiz').click(function (){ diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 9f9c541d6..f5bfc2578 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -3094,7 +3094,7 @@ $phrases = array( 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'ZGV erfüllt mit Prüfung', + 'text' => 'ZGV mit Prüfungen erfüllt', 'description' => '', 'insertvon' => 'system' ), From 9a0df4352670ee81c1aa03e655b4089fbd9b995a Mon Sep 17 00:00:00 2001 From: manu Date: Tue, 1 Jun 2021 09:47:02 +0200 Subject: [PATCH 38/95] 13219 Master Dokumente: Anzeige akzeptierter Dokumente als nicht erforderlich --- include/dokument.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/dokument.class.php b/include/dokument.class.php index 8e1f16346..da03983ab 100644 --- a/include/dokument.class.php +++ b/include/dokument.class.php @@ -890,7 +890,7 @@ class dokument extends basis_db * @param int $person_id Personenkennzeichen. * @return boolean true wenn akzeptiert, false wenn noch nicht akzeptiert */ - protected function akzeptiereDokument($dokument_kurzbz, $person_id) + public function akzeptiereDokument($dokument_kurzbz, $person_id) { $db = new basis_db(); $arrayDoksZuAkzeptieren = array(); @@ -975,7 +975,7 @@ class dokument extends basis_db * @param int $person_id Personenkennzeichen. * @return boolean true wenn entakzeptiert, false wenn noch nicht entakzeptiert */ - protected function entakzeptiereDokument($dokument_kurzbz, $person_id) + public function entakzeptiereDokument($dokument_kurzbz, $person_id) { $db = new basis_db(); $arrayDoksZuEntakzeptieren = array(); From 5330e2b250715f3551cdd48d145d08054743f09f Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 1 Jun 2021 11:13:23 +0200 Subject: [PATCH 39/95] beim abweisen das studiensemester hinzugefuegt --- application/controllers/system/infocenter/InfoCenter.php | 3 ++- application/models/crm/Prestudent_model.php | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index fd3f98320..40ff3ceff 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -1713,13 +1713,14 @@ class InfoCenter extends Auth_Controller $statusgrund = $this->input->post('statusgrund'); $studiengang = $this->input->post('studiengang'); $personen = $this->input->post('personen'); + $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); if ($statusgrund === 'null' || $studiengang === 'null' || empty($personen)) $this->terminateWithJsonError("Bitte Statusgrund, Studiengang und Personen auswählen."); foreach($personen as $person) { - $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person); + $prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester); if(!hasData($prestudent)) continue; diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 41639d0ac..52ba4d9f3 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -582,7 +582,7 @@ class Prestudent_model extends DB_Model return $this->execQuery($query, array($person_id)); } - public function getPrestudentByStudiengangAndPerson($studiengang, $person) + public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester) { $query = "SELECT ps.prestudent_id FROM public.tbl_prestudentstatus pss @@ -590,8 +590,10 @@ class Prestudent_model extends DB_Model JOIN public.tbl_studiengang sg USING(studiengang_kz) JOIN lehre.tbl_studienplan sp USING(studienplan_id) WHERE ps.person_id = ? - AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ?"; + AND UPPER((sg.typ || sg.kurzbz) || ':' || sp.orgform_kurzbz) = ? + AND pss.studiensemester_kurzbz = ? + "; - return $this->execQuery($query, array($person, $studiengang)); + return $this->execQuery($query, array($person, $studiengang, $studienSemester)); } } From a6b53b8fd7585be4d5e64fe64521dddc43363745 Mon Sep 17 00:00:00 2001 From: manu Date: Mon, 7 Jun 2021 11:29:39 +0200 Subject: [PATCH 40/95] 13412 Refactoring Functions for Master Documents --- include/prestudent.class.php | 95 ++++++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index a3e0f5620..06115dab2 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2366,4 +2366,99 @@ class prestudent extends person return true; } } + + /** + * liefert den letztgültigen Status des Prestudenten + * @param int $prestudent_id ID der zu überprüfenden Person. + * @return string $result wenn vorhanden + * false und errormsg wenn Fehler aufgetreten ist + */ + public function getLastPrestudentStatus($prestudent_id) + { + if (!is_numeric($prestudent_id)) + { + $this->errormsg = 'Prestudent_id muss eine gueltige Zahl sein'; + return false; + } + + $db = new basis_db(); + //get all prestudents + $qry = "SELECT pss.status_kurzbz + FROM public.tbl_prestudentstatus pss + JOIN public.tbl_prestudent ps using (prestudent_id) + where ps.prestudent_id = ".$this->db_add_param($prestudent_id)." + group by prestudent_id, pss.status_kurzbz, pss.insertamum + order by pss.insertamum DESC limit 1"; + + if ($db->db_query($qry)) + { + $row = $db->db_fetch_object(); + $result = $row->status_kurzbz; + return $result; + } + else + { + return false; + } + } + + /** + * Prueft, ob eine Person einen aktuellen PreStudentstatus-Eintrag Interessent für einen Masterstudiengang besitzt + * @param int $person_id ID der zu überprüfenden Person. + * @return true wenn vorhanden + * false wenn nicht vorhanden + * false und errormsg wenn Fehler aufgetreten ist + */ + public function existsStatusInteressentMaster($person_id) + { + if (!is_numeric($person_id)) + { + $this->errormsg = 'Person_id muss eine gueltige Zahl sein'; + return false; + } + + $db = new basis_db(); + $prestudentsOfMaster = array(); + //get all prestudents + $qry = "SELECT + prestudent_id + FROM + tbl_prestudent ps, tbl_studiengang sg + WHERE + ps.studiengang_kz = sg.studiengang_kz + AND + sg.typ in ('m','d') + AND person_id = ".$this->db_add_param($person_id).";"; + + + + if ($db->db_query($qry)) + { + $num_rows = $db->db_num_rows(); + // Wenn kein ergebnis return 0 sonst ID + if ($num_rows > 0) + { + while ($row = $db->db_fetch_object()) + { + //echo var_dump($row->prestudent_id); + $prestudentsOfMaster[] = $row->prestudent_id; + } + + //prestudentIds auf Interessentenstatus prüfen + foreach ($prestudentsOfMaster as $prestudent_id) + { + //echo $prestudent_id; + //echo "last status = " . $this->getLastPrestudentStatus($prestudent_id); + //echo "
"; + if ($this->getLastPrestudentStatus($prestudent_id) == "Interessent") + { + return true; + } + } + } + } + else + return false; + } + } From 8a870fb4c8061dc10a357c7fbb7356c8ac0ee6cb Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 7 Jun 2021 12:07:34 +0200 Subject: [PATCH 41/95] reihungstest msg unterscheiden zwischen deutsch, englisch & bachelor & master --- public/js/infocenter/infocenterDetails.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 09f4ed6f7..48c5a08ae 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -4,6 +4,7 @@ const CALLED_PATH = FHC_JS_DATA_STORAGE_OBJECT.called_path; const CONTROLLER_URL = BASE_URL + "/"+CALLED_PATH; const RTFREIGABE_MESSAGE_VORLAGE = "InfocenterRTfreigegeben"; const RTFREIGABE_MESSAGE_VORLAGE_MASTER = "InfocenterRTfreigegebenM"; +const RTFREIGABE_MESSAGE_VORLAGE_MASTER_ENGLISCH = "InfocenterRTfreigegebenMEnglisch"; const RTFREIGABE_MESSAGE_VORLAGE_QUER = "InfocenterRTfreigegQuer"; const RTFREIGABE_MESSAGE_VORLAGE_QUER_KURZ = "InfocenterRTfreigegQuerKurz"; const STGFREIGABE_MESSAGE_VORLAGE = "InfocenterSTGfreigegeben"; @@ -662,10 +663,12 @@ var InfocenterDetails = { else { //send normal RTfreigabe message - if (receiverPrestudent.studiengangtyp === 'm') - { - vorlage = RTFREIGABE_MESSAGE_VORLAGE_MASTER - }else + if (receiverPrestudent.studiengangtyp === 'm') { + if (receiverPrestudentstatus.sprache === 'English') + vorlage = RTFREIGABE_MESSAGE_VORLAGE_MASTER_ENGLISCH + else + vorlage = RTFREIGABE_MESSAGE_VORLAGE_MASTER + } else { vorlage = RTFREIGABE_MESSAGE_VORLAGE } @@ -681,6 +684,12 @@ var InfocenterDetails = { { if (receiverPrestudent.studiengangtyp === 'm' && (freigabedata.statusgrundbezeichnung === 'Ergänzungsprüfungen' || freigabedata.statusgrundbezeichnung === 'Supplementary exams')) { + msgvars = { + 'studiengangbezeichnung': studiengangbezeichnung, + 'studiengangbezeichnung_englisch': studiengangbezeichnung_englisch, + 'orgform_deutsch': orgform_deutsch, + 'orgform_englisch': orgform_englisch + } InfocenterDetails.sendFreigabeMessage(prestudent_id, STGFREIGABE_MESSAGE_VORLAGE_MASTER, msgvars); }else { From 4a2c90ac605d62558cdff4415d00a9a21df77aa7 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 7 Jun 2021 12:28:32 +0200 Subject: [PATCH 42/95] doktypen in zgv uebersicht nur readonly --- application/controllers/system/infocenter/InfoCenter.php | 6 +++++- application/views/system/infocenter/dokpruefung.php | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 621563c71..44d393e86 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -133,6 +133,7 @@ class InfoCenter extends Auth_Controller // Loads models $this->load->model('crm/Akte_model', 'AkteModel'); + $this->load->model('crm/Dokument_model', 'DokumentModel'); $this->load->model('crm/Prestudent_model', 'PrestudentModel'); $this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel'); $this->load->model('crm/Statusgrund_model', 'StatusgrundModel'); @@ -232,10 +233,13 @@ class InfoCenter extends Auth_Controller $prestudent_id = array('prestudent_id' => $prestudent_id); $status = array('status' => getData($zgv)[0]->status); + $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); + $data = array_merge( $persondata, $prestudent_id, - $status + $status, + $dokumentdata ); $origin_page = $this->input->get(self::ORIGIN_PAGE); diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index aa76bbd52..7ee77e815 100644 --- a/application/views/system/infocenter/dokpruefung.php +++ b/application/views/system/infocenter/dokpruefung.php @@ -21,7 +21,14 @@ titel) ? $dokument->bezeichnung : $dokument->titel ?> - dokument_bezeichnung ?> + + + erstelltam), 'd.m.Y') ?> langtext ?> Date: Mon, 7 Jun 2021 16:55:39 +0200 Subject: [PATCH 43/95] 13412 Refactoring Functions Dokumente ZGV Master --- include/dokument.class.php | 32 +++++--------------------------- include/prestudent.class.php | 14 +++++--------- 2 files changed, 10 insertions(+), 36 deletions(-) diff --git a/include/dokument.class.php b/include/dokument.class.php index da03983ab..4d70891c0 100644 --- a/include/dokument.class.php +++ b/include/dokument.class.php @@ -888,7 +888,7 @@ class dokument extends basis_db * Akzeptiert ein bestimmtes Dokument * @param char $dokument_kurzbz Bezeichner Dokument. * @param int $person_id Personenkennzeichen. - * @return boolean true wenn akzeptiert, false wenn noch nicht akzeptiert + * @return boolean true wenn akzeptiert bzw geprüft ohne Akzeptieren, false wenn Fehler */ public function akzeptiereDokument($dokument_kurzbz, $person_id) { @@ -910,10 +910,7 @@ class dokument extends basis_db where dok.prestudent_id = ps.prestudent_id and dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz).")"; - //echo var_dump($qry); - //for all prestudents - //gibt ein Array von zu akzeptierenden Dokumenten zurück if ($db->db_query($qry)) @@ -929,10 +926,8 @@ class dokument extends basis_db } //print_r($arrayDoksZuAkzeptieren); - //und jetzt für alle prestudent_ids das Dokument akzeptieren - + //für alle prestudent_ids das Dokument akzeptieren $qry = "INSERT INTO public.tbl_dokumentprestudent(dokument_kurzbz, prestudent_id) VALUES"; - //echo $qry; foreach ($arrayDoksZuAkzeptieren as $prestudent_id) { @@ -945,11 +940,8 @@ class dokument extends basis_db } $qry .= ";"; - echo $qry; - if ($this->db_query($qry)) { - echo " Jawoll: query ausgeführt"; return true; } else @@ -958,10 +950,6 @@ class dokument extends basis_db return false; } } - else - { - echo " Keine zu akzeptierenden Doks vorhanden"; - } return true; } @@ -973,7 +961,7 @@ class dokument extends basis_db * entakzeptiert ein bestimmtes Dokument * @param char $dokument_kurzbz Kurzbezeichnung des zu entakzeptierenden Dokuments. * @param int $person_id Personenkennzeichen. - * @return boolean true wenn entakzeptiert, false wenn noch nicht entakzeptiert + * @return boolean true wenn entakzeptiert bzw geprüft ohne Entakzeptieren, false wenn Fehler */ public function entakzeptiereDokument($dokument_kurzbz, $person_id) { @@ -981,7 +969,6 @@ class dokument extends basis_db $arrayDoksZuEntakzeptieren = array(); //get Prestudent_ids - $qry = "SELECT prestudent_id from @@ -1003,15 +990,12 @@ class dokument extends basis_db { while ($row = $db->db_fetch_object()) { - //echo var_dump($row->prestudent_id); $arrayDoksZuEntakzeptieren[] = $row->prestudent_id; } - print_r($arrayDoksZuEntakzeptieren); - - //und jetzt für alle prestudent_ids das Dokument Entakzeptieren + //print_r($arrayDoksZuEntakzeptieren); + //für alle prestudent_ids das Dokument Entakzeptieren $qry = "DELETE FROM public.tbl_dokumentprestudent WHERE prestudent_id in ("; - //echo $qry; foreach ($arrayDoksZuEntakzeptieren as $prestudent_id) { @@ -1024,8 +1008,6 @@ class dokument extends basis_db } $qry .= ") AND dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz).";"; - echo $qry; - if ($this->db_query($qry)) { return true; @@ -1036,10 +1018,6 @@ class dokument extends basis_db return false; } } - else - { - echo " Keine Entzuakzeptierenden Doks vorhanden"; - } return true; } else diff --git a/include/prestudent.class.php b/include/prestudent.class.php index 06115dab2..747fd5da4 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2215,9 +2215,9 @@ class prestudent extends person WHERE laststatus NOT IN ('Abbrecher', 'Abgewiesener', 'Absolvent') AND priorisierung <= ".$this->db_add_param($priorisierungAbsolut, FHC_INTEGER); - if($result = $this->db_query($qry)) + if ($result = $this->db_query($qry)) { - if($row = $this->db_fetch_object($result)) + if ($row = $this->db_fetch_object($result)) { return $row->prio_relativ; } @@ -2328,7 +2328,7 @@ class prestudent extends person //echo var_dump($row->prestudent_id); $arrayleereManations[] = $row->prestudent_id; } - print_r($arrayleereManations); + //print_r($arrayleereManations); $qry = "UPDATE public.tbl_prestudent @@ -2352,7 +2352,7 @@ class prestudent extends person if ($this->db_query($qry)) { - echo " ZGV-Master Nation A eingetragen!"; + //echo " ZGV-Master Nation A eingetragen!"; return true; } else @@ -2362,7 +2362,7 @@ class prestudent extends person } } else - echo " Keine leere ZGVManation gefunden"; + //echo " Keine leere ZGVManation gefunden"; return true; } } @@ -2447,9 +2447,6 @@ class prestudent extends person //prestudentIds auf Interessentenstatus prüfen foreach ($prestudentsOfMaster as $prestudent_id) { - //echo $prestudent_id; - //echo "last status = " . $this->getLastPrestudentStatus($prestudent_id); - //echo "
"; if ($this->getLastPrestudentStatus($prestudent_id) == "Interessent") { return true; @@ -2460,5 +2457,4 @@ class prestudent extends person else return false; } - } From e157945ae9f016766412cc8e893b44d7686ffbcf Mon Sep 17 00:00:00 2001 From: manu Date: Wed, 9 Jun 2021 08:58:17 +0200 Subject: [PATCH 44/95] Auskommentieren Testausgaben --- include/prestudent.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index 747fd5da4..9f8b2fa27 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2348,7 +2348,7 @@ class prestudent extends person } $qry .= ");"; - echo $qry; + //echo $qry; if ($this->db_query($qry)) { From 49363e893b6d4ec0b1ea40ce86954e3dda7d0e51 Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 10 Jun 2021 10:30:49 +0200 Subject: [PATCH 45/95] 13218 update Eintragen MasterZGV Nation --- include/prestudent.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index 9f8b2fa27..8f76a8dd3 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2303,19 +2303,23 @@ class prestudent extends person $db = new basis_db(); $arrayleereManations = array(); - //all prestudent_ids mit leerer ZGV_Nation + //all prestudent_ids mit leerer ZGV_Nation und Status Interessent $qry = "SELECT * FROM public.tbl_prestudent JOIN public.tbl_studiengang USING (studiengang_kz) + JOIN + public.tbl_prestudentstatus USING (prestudent_id) WHERE person_id = ".$this->db_add_param($person_id)." AND zgvmanation is NULL AND - typ in ('m','d')"; + typ in ('m','d') + AND + status_kurzbz = 'Interessent'"; if ($db->db_query($qry)) { From 3ba88b43dd7a94541085da7b0008185c183a9759 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 10 Jun 2021 11:49:48 +0200 Subject: [PATCH 46/95] zgvmaster spalte hinzugefuegt --- .../system/infocenter/infocenterData.php | 23 +++++++++++++++---- .../infocenter/infocenterFreigegebenData.php | 21 +++++++++++++---- .../infocenterReihungstestAbsolviertData.php | 21 +++++++++++++---- system/filtersupdate.php | 6 +++++ 4 files changed, 58 insertions(+), 13 deletions(-) diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 6eb1accae..5f881b485 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -3,7 +3,7 @@ $APP = '\'infocenter\''; $REJECTED_STATUS = '\'Abgewiesener\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\'m\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\', \'Interessent rejected\''; $LOGDATA_NAME_PARKED = '\'Parked\''; @@ -208,12 +208,19 @@ LIMIT 1 ) AS "StgAktiv", ( - SELECT CONCAT(COALESCE(ps.zgvnation, \'-\'), \' / \' , COALESCE(ps.zgvmanation, \'-\')) + SELECT ps.zgvnation FROM public.tbl_prestudent ps WHERE ps.person_id = p.person_id - ORDER BY ps.zgvnation, ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC + ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 - ) AS "ZGVNation" + ) AS "ZGVNation", + ( + SELECT ps.zgvmanation + FROM public.tbl_prestudent ps + WHERE ps.person_id = p.person_id + ORDER BY ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC + LIMIT 1 + ) AS "ZGVMNation" FROM public.tbl_person p LEFT JOIN ( SELECT tpl.person_id, @@ -298,7 +305,8 @@ ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'gesendet').')', ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'nichtGesendet').')', ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'aktiv').')', - 'ZGV Nation' + 'ZGV Nation', + 'ZGV Master Nation' ), 'formatRow' => function($datasetRaw) { @@ -380,6 +388,11 @@ $datasetRaw->{'ZGVNation'} = '-'; } + if ($datasetRaw->{'ZGVMNation'} == null) + { + $datasetRaw->{'ZGVMNation'} = '-'; + } + return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 02d15655a..244b96855 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -205,12 +205,19 @@ LIMIT 1 ) AS "ReihungstestDate", ( - SELECT CONCAT(COALESCE(ps.zgvnation, \'-\'), \' / \' , COALESCE(ps.zgvmanation, \'-\')) + SELECT ps.zgvnation FROM public.tbl_prestudent ps WHERE ps.person_id = p.person_id - ORDER BY ps.zgvnation, ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC + ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 - ) AS "ZGVNation" + ) AS "ZGVNation", + ( + SELECT ps.zgvmanation + FROM public.tbl_prestudent ps + WHERE ps.person_id = p.person_id + ORDER BY ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC + LIMIT 1 + ) AS "ZGVMNation" FROM public.tbl_person p LEFT JOIN ( SELECT tpl.person_id, @@ -278,7 +285,8 @@ 'Reihungstest angetreten', 'Reihungstest angemeldet', 'Reihungstest date', - 'ZGV Nation' + 'ZGV Nation', + 'ZGV Master Nation' ), 'formatRow' => function($datasetRaw) { @@ -371,6 +379,11 @@ { $datasetRaw->{'ZGVNation'} = '-'; } + + if ($datasetRaw->{'ZGVMNation'} == null) + { + $datasetRaw->{'ZGVMNation'} = '-'; + } return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 9f7a5204a..121aa72da 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -161,12 +161,19 @@ LIMIT 1 ) AS "ReihungstestDatum", ( - SELECT CONCAT(COALESCE(ps.zgvnation, \'-\'), \' / \' , COALESCE(ps.zgvmanation, \'-\')) + SELECT ps.zgvnation FROM public.tbl_prestudent ps WHERE ps.person_id = p.person_id - ORDER BY ps.zgvnation, ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC + ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 - ) AS "ZGVNation" + ) AS "ZGVNation", + ( + SELECT ps.zgvmanation + FROM public.tbl_prestudent ps + WHERE ps.person_id = p.person_id + ORDER BY ps.zgvmanation DESC NULLS LAST, ps.prestudent_id DESC + LIMIT 1 + ) AS "ZGVMNation" FROM public.tbl_person p LEFT JOIN ( SELECT tpl.person_id, @@ -225,7 +232,8 @@ 'Reihungstest angetreten', 'Reihungstest angemeldet', 'Reihungstest Datum', - 'ZGV Nation' + 'ZGV Nation', + 'ZGV Master Nation' ), 'formatRow' => function($datasetRaw) { @@ -313,6 +321,11 @@ { $datasetRaw->{'ZGVNation'} = '-'; } + + if ($datasetRaw->{'ZGVMNation'} == null) + { + $datasetRaw->{'ZGVMNation'} = '-'; + } return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 2d8daed4d..44772d249 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -33,6 +33,7 @@ $filters = array( {"name": "Vorname"}, {"name": "Nachname"}, {"name": "ZGVNation"}, + {"name": "ZGVMNation"}, {"name": "StgAbgeschickt"}, {"name": "Studiensemester"}, {"name": "LastAction"}, @@ -66,6 +67,7 @@ $filters = array( {"name": "Vorname"}, {"name": "Nachname"}, {"name": "ZGVNation"}, + {"name": "ZGVMNation"}, {"name": "StgAbgeschickt"}, {"name": "Studiensemester"}, {"name": "LastAction"}, @@ -105,6 +107,7 @@ $filters = array( {"name": "Vorname"}, {"name": "Nachname"}, {"name": "ZGVNation"}, + {"name": "ZGVMNation"}, {"name": "LastAction"}, {"name": "LastActionType"}, {"name": "User/Operator"}, @@ -140,6 +143,7 @@ $filters = array( {"name": "Vorname"}, {"name": "Nachname"}, {"name": "ZGVNation"}, + {"name": "ZGVMNation"}, {"name": "LastAction"}, {"name": "User/Operator"}, {"name": "LockUser"}, @@ -180,6 +184,7 @@ $filters = array( {"name": "Vorname"}, {"name": "Nachname"}, {"name": "ZGVNation"}, + {"name": "ZGVMNation"}, {"name": "StgAbgeschickt"}, {"name": "Studiensemester"}, {"name": "LastAction"}, @@ -218,6 +223,7 @@ $filters = array( {"name": "Vorname"}, {"name": "Nachname"}, {"name": "ZGVNation"}, + {"name": "ZGVMNation"}, {"name": "LastAction"}, {"name": "User/Operator"}, {"name": "LockUser"}, From cdfaf5b90bb8e884343f8250025c5598efc88531 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 10 Jun 2021 11:56:07 +0200 Subject: [PATCH 47/95] dokumententypen nach bezeichnung sortiert --- application/controllers/system/infocenter/InfoCenter.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 950507b0c..ff9e54aa5 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -219,6 +219,7 @@ class InfoCenter extends Auth_Controller $persondata = $this->_loadPersonData($person_id); $prestudentdata = $this->_loadPrestudentData($person_id); + $this->DokumentModel->addOrder('bezeichnung'); $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); $data = array_merge( From ccffdf9b7ff7663a009998638d6b20e3b20829ce Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 10 Jun 2021 12:00:09 +0200 Subject: [PATCH 48/95] statusgruende sortiert --- application/models/crm/Statusgrund_model.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/models/crm/Statusgrund_model.php b/application/models/crm/Statusgrund_model.php index f9b156b76..7ab17a45b 100644 --- a/application/models/crm/Statusgrund_model.php +++ b/application/models/crm/Statusgrund_model.php @@ -14,6 +14,7 @@ class Statusgrund_model extends DB_Model public function getStatus($status_kurzbz = null, $aktiv = null) { + $this->addOrder('bezeichnung_mehrsprachig'); $where = array(); if (!is_null($status_kurzbz)) $where['status_kurzbz'] = $status_kurzbz; From 3171ec2c4241c8a01eef4a469f59641eea0ec30c Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 10 Jun 2021 12:01:01 +0200 Subject: [PATCH 49/95] dokumententypen nach bezeichnung sortiert --- application/controllers/system/infocenter/InfoCenter.php | 1 + 1 file changed, 1 insertion(+) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 44d393e86..f2a63c46b 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -233,6 +233,7 @@ class InfoCenter extends Auth_Controller $prestudent_id = array('prestudent_id' => $prestudent_id); $status = array('status' => getData($zgv)[0]->status); + $this->DokumentModel->addOrder('bezeichnung'); $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); $data = array_merge( From c9ec4cb6749b5ea7b85ea3141a5afcb2b73f3867 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 10 Jun 2021 12:19:42 +0200 Subject: [PATCH 50/95] ist infocentermitarbeiter spalte nachgezogen --- .../infocenter/infocenterFreigegebenData.php | 32 +++++++++++++++++-- .../infocenterReihungstestAbsolviertData.php | 32 +++++++++++++++++-- system/filtersupdate.php | 9 ++++++ 3 files changed, 69 insertions(+), 4 deletions(-) diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 3b7ff1dbe..62ecaef96 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -207,7 +207,24 @@ WHERE ps.person_id = p.person_id ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 - ) AS "ZGVNation" + ) AS "ZGVNation", + ( + SELECT tbl_organisationseinheit.bezeichnung + FROM public.tbl_benutzerfunktion + JOIN public.tbl_organisationseinheit USING(oe_kurzbz) + WHERE (tbl_benutzerfunktion.datum_von IS NULL OR tbl_benutzerfunktion.datum_von <= now()) + AND (tbl_benutzerfunktion.datum_bis IS NULL OR tbl_benutzerfunktion.datum_bis >= now()) + AND tbl_benutzerfunktion.uid = ( + SELECT l.insertvon + FROM system.tbl_log l + WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') + AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') + AND l.person_id = p.person_id + ORDER BY l.zeitpunkt DESC + LIMIT 1 + ) + LIMIT 1 + ) AS "InfoCenterMitarbeiter" FROM public.tbl_person p LEFT JOIN ( SELECT tpl.person_id, @@ -275,7 +292,8 @@ 'Reihungstest angetreten', 'Reihungstest angemeldet', 'Reihungstest date', - 'ZGV Nation' + 'ZGV Nation', + 'InfoCenter Mitarbeiter' ), 'formatRow' => function($datasetRaw) { @@ -368,6 +386,16 @@ { $datasetRaw->{'ZGVNation'} = '-'; } + + if ($datasetRaw->{'InfoCenterMitarbeiter'} === 'InfoCenter') + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; + } + else + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; + } + return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 6b0918174..b11fdc481 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -163,7 +163,24 @@ WHERE ps.person_id = p.person_id ORDER BY ps.zgvnation DESC NULLS LAST, ps.prestudent_id DESC LIMIT 1 - ) AS "ZGVNation" + ) AS "ZGVNation", + ( + SELECT tbl_organisationseinheit.bezeichnung + FROM public.tbl_benutzerfunktion + JOIN public.tbl_organisationseinheit USING(oe_kurzbz) + WHERE (tbl_benutzerfunktion.datum_von IS NULL OR tbl_benutzerfunktion.datum_von <= now()) + AND (tbl_benutzerfunktion.datum_bis IS NULL OR tbl_benutzerfunktion.datum_bis >= now()) + AND tbl_benutzerfunktion.uid = ( + SELECT l.insertvon + FROM system.tbl_log l + WHERE l.taetigkeit_kurzbz IN ('.$TAETIGKEIT_KURZBZ.') + AND l.logdata->>\'name\' NOT IN ('.$LOGDATA_NAME.') + AND l.person_id = p.person_id + ORDER BY l.zeitpunkt DESC + LIMIT 1 + ) + LIMIT 1 + ) AS "InfoCenterMitarbeiter" FROM public.tbl_person p LEFT JOIN ( SELECT tpl.person_id, @@ -222,7 +239,8 @@ 'Reihungstest angetreten', 'Reihungstest angemeldet', 'Reihungstest Datum', - 'ZGV Nation' + 'ZGV Nation', + 'InfoCenter Mitarbeiter' ), 'formatRow' => function($datasetRaw) { @@ -310,6 +328,16 @@ { $datasetRaw->{'ZGVNation'} = '-'; } + + if ($datasetRaw->{'InfoCenterMitarbeiter'} === 'InfoCenter') + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; + } + else + { + $datasetRaw->{'InfoCenterMitarbeiter'} = 'Nein'; + } + return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 5a5b983a2..4624dc042 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -38,6 +38,7 @@ $filters = array( {"name": "LastAction"}, {"name": "LastActionType"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"} ], "filters": [ @@ -71,6 +72,7 @@ $filters = array( {"name": "LastAction"}, {"name": "LastActionType"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"} ], "filters": [ @@ -108,6 +110,7 @@ $filters = array( {"name": "LastAction"}, {"name": "LastActionType"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"}, {"name": "StgNichtAbgeschickt"}, {"name": "StgAbgeschickt"}, @@ -142,6 +145,7 @@ $filters = array( {"name": "ZGVNation"}, {"name": "LastAction"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"}, {"name": "StgNichtAbgeschickt"}, {"name": "StgAbgeschickt"}, @@ -184,6 +188,7 @@ $filters = array( {"name": "Studiensemester"}, {"name": "LastAction"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"} ], "filters": [ @@ -220,6 +225,7 @@ $filters = array( {"name": "ZGVNation"}, {"name": "LastAction"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"}, {"name": "StgNichtAbgeschickt"}, {"name": "StgAbgeschickt"}, @@ -266,6 +272,7 @@ $filters = array( {"name": "StgAbgeschickt"}, {"name": "LastAction"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"}, {"name": "Statusgrund"} ], @@ -302,6 +309,7 @@ $filters = array( {"name": "LastAction"}, {"name": "LastActionType"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"}, {"name": "Statusgrund"}, {"name": "Studiensemester"}, @@ -383,6 +391,7 @@ $filters = array( {"name": "StgAbgeschickt"}, {"name": "LastAction"}, {"name": "User/Operator"}, + {"name": "InfoCenterMitarbeiter"}, {"name": "LockUser"} ], "filters": [ From 42ff593cb160412d5d15302350be748ce8b095a1 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 14 Jun 2021 15:44:38 +0200 Subject: [PATCH 51/95] zgvnation spalten umbenannt --- application/views/system/infocenter/infocenterData.php | 4 ++-- .../views/system/infocenter/infocenterFreigegebenData.php | 4 ++-- .../infocenter/infocenterReihungstestAbsolviertData.php | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 5f881b485..4660cba6c 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -305,8 +305,8 @@ ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'gesendet').')', ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'nichtGesendet').')', ucfirst($this->p->t('lehre', 'studiengang')).' ('.$this->p->t('global', 'aktiv').')', - 'ZGV Nation', - 'ZGV Master Nation' + 'ZGV Nation BA', + 'ZGV Nation MA' ), 'formatRow' => function($datasetRaw) { diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 244b96855..93e524d2c 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -285,8 +285,8 @@ 'Reihungstest angetreten', 'Reihungstest angemeldet', 'Reihungstest date', - 'ZGV Nation', - 'ZGV Master Nation' + 'ZGV Nation BA', + 'ZGV Nation MA' ), 'formatRow' => function($datasetRaw) { diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 121aa72da..7ac66e71a 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -232,8 +232,8 @@ 'Reihungstest angetreten', 'Reihungstest angemeldet', 'Reihungstest Datum', - 'ZGV Nation', - 'ZGV Master Nation' + 'ZGV Nation BA', + 'ZGV Nation MA' ), 'formatRow' => function($datasetRaw) { From 6a3fb14ea66ffd4af21df6844c998beb11673775 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 16 Jun 2021 09:16:15 +0200 Subject: [PATCH 52/95] zgv ueberpruefung zwischen master und bachelor unterscheiden --- .../controllers/system/infocenter/InfoCenter.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index f2a63c46b..db62748fa 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -13,6 +13,7 @@ class InfoCenter extends Auth_Controller const TAETIGKEIT = 'bewerbung'; const FREIGABE_MAIL_VORLAGE = 'InfocenterMailFreigabeAssistenz'; const ZGVPRUEFUNG_MAIL_VORLAGE = 'InfocenterMailZgvUeberpruefung'; + const ZGVPRUEFUNG_MAIL_VORLAGE_MASTER = 'InfocenterMailZgvUeberpruefungM'; const INFOCENTER_URI = 'system/infocenter/InfoCenter'; // URL prefix for this controller const ZGV_UEBERPRUEFUNG_URI = 'system/infocenter/ZGVUeberpruefung'; @@ -521,7 +522,7 @@ class InfoCenter extends Auth_Controller /** * Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang */ - private function sendZgvMail($mail){ + private function sendZgvMail($mail, $typ){ $data = array( 'link' => site_url('system/infocenter/ZGVUeberpruefung') ); @@ -529,7 +530,7 @@ class InfoCenter extends Auth_Controller $this->load->helper('hlp_sancho'); sendSanchoMail( - self::ZGVPRUEFUNG_MAIL_VORLAGE, + ($typ === 'm' ? self::ZGVPRUEFUNG_MAIL_VORLAGE_MASTER : self::ZGVPRUEFUNG_MAIL_VORLAGE), $data, $mail, 'ZGV Ueberpruefung', @@ -622,6 +623,8 @@ class InfoCenter extends Auth_Controller $data = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); $mail = $data['studiengang_mail']; + $typ = $data['studiengang_typ']; + if (hasData($zgv)) { $zgv = getData($zgv); @@ -647,7 +650,7 @@ class InfoCenter extends Auth_Controller $this->_log($person_id, 'updatezgv', array($zgv[0]->zgvpruefung_id, 'pruefung_stg')); if (isSuccess($insert)) - $this->sendZgvMail($mail); + $this->sendZgvMail($mail, $typ); elseif (isError($insert)) $this->terminateWithJsonError('Fehler beim Speichern'); }else @@ -673,7 +676,7 @@ class InfoCenter extends Auth_Controller $this->_log($person_id, 'newzgv', array($zgvpruefung_id)); if (isSuccess($result)) - $this->sendZgvMail($mail); + $this->sendZgvMail($mail, $typ); elseif (isError($result)) $this->terminateWithJsonError('Fehler beim Speichern'); } @@ -1824,8 +1827,9 @@ class InfoCenter extends Auth_Controller $studiengang_kurzbz = $prestudentdata->studiengang; $studiengang_bezeichnung = $prestudentdata->studiengangbezeichnung; $studiengang_mail = $prestudentdata->studiengangmail; + $studiengang_typ = $prestudentdata->studiengangtyp; - return array('person_id' => $person_id, 'studiengang_kurzbz' => $studiengang_kurzbz, 'studiengang_bezeichnung' => $studiengang_bezeichnung, 'studiengang_mail' => $studiengang_mail); + return array('person_id' => $person_id, 'studiengang_kurzbz' => $studiengang_kurzbz, 'studiengang_bezeichnung' => $studiengang_bezeichnung, 'studiengang_mail' => $studiengang_mail, 'studiengang_typ' => $studiengang_typ); } /** From 212261a38ef6e908425cfe83740835da0cae179f Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 16 Jun 2021 09:18:53 +0200 Subject: [PATCH 53/95] autofill vom username im falschen feld verhindern --- application/views/lehre/lehrauftrag/acceptLehrauftrag.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php index e87f0945c..521883452 100644 --- a/application/views/lehre/lehrauftrag/acceptLehrauftrag.php +++ b/application/views/lehre/lehrauftrag/acceptLehrauftrag.php @@ -189,7 +189,7 @@ $this->load->view(
- + From ab799cb54fc7d58ac621859cbb1bb7b5451dda5e Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 17 Jun 2021 13:47:21 +0200 Subject: [PATCH 54/95] abweisen auch wenn bereits freigegeben --- .../system/infocenter/InfoCenter.php | 6 +- .../system/infocenter/infocenterData.php | 2 +- .../infocenter/infocenterFreigegeben.php | 2 + .../infocenter/infocenterFreigegebenData.php | 2 +- .../infocenterReihungstestAbsolviert.php | 2 + .../views/system/infocenter/zgvpruefungen.php | 57 +++++++++++++++++++ 6 files changed, 67 insertions(+), 4 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 40ff3ceff..cc8d25cec 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -451,8 +451,8 @@ class InfoCenter extends Auth_Controller if (hasData($lastStatus) && hasData($statusgrresult)) { - //check if still Interessent and not freigegeben yet - if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS && !isset($lastStatus->retval[0]->bestaetigtam)) + //check if still Interessent + if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS) { $result = $this->PrestudentstatusModel->insert( array( @@ -1363,6 +1363,8 @@ class InfoCenter extends Auth_Controller || isset($zgvpruefung->prestudentstatus->bestaetigtam) || $zgvpruefung->prestudentstatus->status_kurzbz != self::INTERESSENTSTATUS; + $zgvpruefung->abgewiesener = $zgvpruefung->prestudentstatus->status_kurzbz === self::ABGEWIESENERSTATUS; + //wether prestudent was freigegeben for RT/Stg $zgvpruefung->isRtFreigegeben = false; $zgvpruefung->isStgFreigegeben = false; diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 0c7030059..5c0d7f105 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -3,7 +3,7 @@ $APP = '\'infocenter\''; $REJECTED_STATUS = '\'Abgewiesener\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\'m\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\', \'Interessent rejected\''; $LOGDATA_NAME_PARKED = '\'Parked\''; diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php index 15e73f1b6..4855e5cd6 100644 --- a/application/views/system/infocenter/infocenterFreigegeben.php +++ b/application/views/system/infocenter/infocenterFreigegeben.php @@ -13,6 +13,7 @@ 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, + 'dialoglib' => true, 'phrases' => array( 'person' => array('vorname', 'nachname'), 'global' => array('mailAnXversandt'), @@ -40,6 +41,7 @@
load->view('system/infocenter/infocenterFreigegebenData.php'); ?> + load->view('system/infocenter/absageModal.php'); ?>
diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index aab69b651..047afe5f2 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -2,7 +2,7 @@ $APP = '\'infocenter\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'b\''; + $STUDIENGANG_TYP = '\'m\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; $REJECTED_STATUS = '\'Abgewiesener\''; diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php index 79f75885b..f2d838fac 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php @@ -13,6 +13,7 @@ 'ajaxlib' => true, 'filterwidget' => true, 'navigationwidget' => true, + 'dialoglib' => true, 'phrases' => array( 'person' => array('vorname', 'nachname'), 'global' => array('mailAnXversandt'), @@ -40,6 +41,7 @@
load->view('system/infocenter/infocenterReihungstestAbsolviertData.php'); ?> + load->view('system/infocenter/absageModal.php'); ?>
diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 41b549616..5bf700483 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -508,6 +508,63 @@ +
+
+
+ + + + +
+ +
+
From 8b3df557192ed9133c7b9869291db664935f1ea0 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 17 Jun 2021 14:08:49 +0200 Subject: [PATCH 55/95] =?UTF-8?q?response=20bei=20doktyp=20=C3=A4nderung?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/js/infocenter/infocenterDetails.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 0df271dd5..de2ba0064 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -761,7 +761,15 @@ var InfocenterDetails = { }, { successCallback: function(data, textStatus, jqXHR) { - InfocenterDetails._refreshLog(); + if (FHC_AjaxClient.isSuccess(data)) + { + FHC_DialogLib.alertSuccess("Done!"); + InfocenterDetails._refreshLog(); + } + else + { + FHC_DialogLib.alertError("Fehler beim Speichern des Dokumententypes!"); + } }, errorCallback: function() { FHC_DialogLib.alertWarning("Document type could not be updated"); From e5a6af7eb3e50ea9124fe38261450ad3c65da76a Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 18 Jun 2021 09:16:02 +0200 Subject: [PATCH 56/95] first guess adding filter for upcoming exams --- .../lehre/pruefungsprotokollUebersicht.php | 2 ++ .../pruefungsprotokollUebersichtData.php | 1 + system/phrasesupdate.php | 20 +++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/application/views/lehre/pruefungsprotokollUebersicht.php b/application/views/lehre/pruefungsprotokollUebersicht.php index 35bea7963..2416b30bd 100644 --- a/application/views/lehre/pruefungsprotokollUebersicht.php +++ b/application/views/lehre/pruefungsprotokollUebersicht.php @@ -48,6 +48,8 @@ name="period" value="today">p->t('ui','heute'); ?> + diff --git a/application/views/lehre/pruefungsprotokollUebersichtData.php b/application/views/lehre/pruefungsprotokollUebersichtData.php index dd247c2eb..caee939a5 100644 --- a/application/views/lehre/pruefungsprotokollUebersichtData.php +++ b/application/views/lehre/pruefungsprotokollUebersichtData.php @@ -21,6 +21,7 @@ WHERE AND ( '". $PERIOD. "' = 'today' AND datum = NOW()::date OR '". $PERIOD. "' = 'lastWeek' AND datum = (NOW() - interval '1 week')::date OR + '". $PERIOD. "' = 'upcoming' AND datum > NOW()::date OR '". $PERIOD. "' = 'all' AND datum >= '2020-05-27' ) ORDER BY datum, nachname, vorname diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index b49aa6044..18098af91 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -7949,6 +7949,26 @@ Any unusual occurrences ) ) ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'zukuenftige', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Zukünftige', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'upcoming', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'ui', From a0b86b6207cdf25cd1a897554dd7728c36180842 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 18 Jun 2021 09:21:39 +0200 Subject: [PATCH 57/95] rename in_the_future to upcoming consistently --- application/views/lehre/pruefungsprotokollUebersicht.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/views/lehre/pruefungsprotokollUebersicht.php b/application/views/lehre/pruefungsprotokollUebersicht.php index 2416b30bd..c7de8fcd0 100644 --- a/application/views/lehre/pruefungsprotokollUebersicht.php +++ b/application/views/lehre/pruefungsprotokollUebersicht.php @@ -48,7 +48,7 @@ name="period" value="today">p->t('ui','heute'); ?> - From cea673fa824c4db5e6c3c6e6a4cdf8ceb04ed156 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 18 Jun 2021 12:45:44 +0200 Subject: [PATCH 58/95] adjust indentation, changed filter lastWeek to cover last 7 days and not only a week ago today --- application/views/lehre/pruefungsprotokollUebersichtData.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/lehre/pruefungsprotokollUebersichtData.php b/application/views/lehre/pruefungsprotokollUebersichtData.php index caee939a5..1450c7f93 100644 --- a/application/views/lehre/pruefungsprotokollUebersichtData.php +++ b/application/views/lehre/pruefungsprotokollUebersichtData.php @@ -20,8 +20,8 @@ WHERE vorsitz='".$UID."' AND ( '". $PERIOD. "' = 'today' AND datum = NOW()::date OR - '". $PERIOD. "' = 'lastWeek' AND datum = (NOW() - interval '1 week')::date OR - '". $PERIOD. "' = 'upcoming' AND datum > NOW()::date OR + '". $PERIOD. "' = 'lastWeek' AND datum >= (NOW() - interval '1 week')::date AND datum < NOW()::date OR + '". $PERIOD. "' = 'upcoming' AND datum > NOW()::date OR '". $PERIOD. "' = 'all' AND datum >= '2020-05-27' ) ORDER BY datum, nachname, vorname From e76dead57076bc23d1b7f9ba4958d3274f16bc21 Mon Sep 17 00:00:00 2001 From: Harald Bamberger Date: Fri, 18 Jun 2021 14:45:05 +0200 Subject: [PATCH 59/95] add parantheses although not explicitly needed for correct function --- .../views/lehre/pruefungsprotokollUebersichtData.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/application/views/lehre/pruefungsprotokollUebersichtData.php b/application/views/lehre/pruefungsprotokollUebersichtData.php index 1450c7f93..ff2caa774 100644 --- a/application/views/lehre/pruefungsprotokollUebersichtData.php +++ b/application/views/lehre/pruefungsprotokollUebersichtData.php @@ -19,10 +19,10 @@ FROM WHERE vorsitz='".$UID."' AND ( - '". $PERIOD. "' = 'today' AND datum = NOW()::date OR - '". $PERIOD. "' = 'lastWeek' AND datum >= (NOW() - interval '1 week')::date AND datum < NOW()::date OR - '". $PERIOD. "' = 'upcoming' AND datum > NOW()::date OR - '". $PERIOD. "' = 'all' AND datum >= '2020-05-27' + ('". $PERIOD. "' = 'today' AND datum = NOW()::date) OR + ('". $PERIOD. "' = 'lastWeek' AND datum >= (NOW() - interval '1 week')::date AND datum < NOW()::date) OR + ('". $PERIOD. "' = 'upcoming' AND datum > NOW()::date) OR + ('". $PERIOD. "' = 'all' AND datum >= '2020-05-27') ) ORDER BY datum, nachname, vorname "; From 3fca876f8df3f73f05e2ef986afb183a68acf6c5 Mon Sep 17 00:00:00 2001 From: manu Date: Mon, 21 Jun 2021 15:12:33 +0200 Subject: [PATCH 60/95] #13749 MasterZGV Art und Ort setzen --- include/prestudent.class.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index 8f76a8dd3..c5b632ca5 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2287,12 +2287,13 @@ class prestudent extends person } /** - * Befüllt MasterZGV Nation mit Österreich + * Befüllt MasterZGV Nation mit Österreich, + * MasterZGV-code mit FH-Bachelor(I) und MasterZGV-Ort mit Wien(FHTW) * @param int $person_id Personenkennzeichen. * @return true wenn erfolgreich durchgeführt * false und errormsg wenn ein Fehler aufgetreten ist */ - public function setManationZGV($person_id) + public function setZGVMasterFields($person_id) { if (!is_numeric($person_id)) { @@ -2337,7 +2338,7 @@ class prestudent extends person $qry = "UPDATE public.tbl_prestudent SET - zgvmanation = 'A' + (zgvmanation, zgvmaort, zgvmas_code) = ('A','Wien (FHTW)',1) WHERE prestudent_id in ("; @@ -2356,12 +2357,12 @@ class prestudent extends person if ($this->db_query($qry)) { - //echo " ZGV-Master Nation A eingetragen!"; + //echo " ZGV-Master Eintragungen vorgenommen!"; return true; } else { - $this->errormsg = 'Fehler beim Eintragen zgvMasternation'; + $this->errormsg = 'Fehler beim Eintragen zgvMasterFields'; return false; } } From 35366efdadb912cf95bd34fd368ce9f5882240f7 Mon Sep 17 00:00:00 2001 From: manu Date: Tue, 22 Jun 2021 10:20:56 +0200 Subject: [PATCH 61/95] =?UTF-8?q?Bewerbungstool:=20Korrektur=20Anzeige=20v?= =?UTF-8?q?orl=C3=A4ufiges=20Sprachzertifikat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cms/dms.php | 1 + 1 file changed, 1 insertion(+) diff --git a/cms/dms.php b/cms/dms.php index 7e587b6ec..307bc002f 100644 --- a/cms/dms.php +++ b/cms/dms.php @@ -85,6 +85,7 @@ if($doc->isLocked($id)) $dokumente_arr[] .= 'ZgvBaPre'; $dokumente_arr[] .= 'ZgvMaPre'; $dokumente_arr[] .= 'InvitLet'; + $dokumente_arr[] .= 'VorlSpB2'; } if ($person_id!=$akte_person || !in_array($akte_dokument_kurzbz, $dokumente_arr)) die('Sie haben keinen Zugriff auf dieses Dokument'); From 7314352e794981ec5f67f5c0b0d48de5aaa01bf7 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 22 Jun 2021 16:54:45 +0200 Subject: [PATCH 62/95] =?UTF-8?q?absagen=20nun=20m=C3=B6glich=20auch=20bei?= =?UTF-8?q?=20studenten=20die=20den=20reihungstest=20absolviert=20haben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/infocenter/InfoCenter.php | 8 +- .../models/organisation/Studiengang_model.php | 17 +- .../infocenter/infocenterFreigegebenData.php | 6 + .../infocenterReihungstestAbsolviertData.php | 3 +- .../views/system/infocenter/zgvpruefungen.php | 278 ++++++++---------- 5 files changed, 147 insertions(+), 165 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index cc8d25cec..7d36690e7 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -70,6 +70,7 @@ class InfoCenter extends Auth_Controller const INTERESSENTSTATUS = 'Interessent'; const ABGEWIESENERSTATUS = 'Abgewiesener'; const BEWERBERSTATUS = 'Bewerber'; + const WARTENDER = 'Wartender'; // Statusgruende for which no Studiengangsfreigabemessage should be sent private $_statusgruendeNoStgFreigabeMessage = array('FIT Programm', 'FIT program', 'FIT programme'); @@ -452,7 +453,9 @@ class InfoCenter extends Auth_Controller if (hasData($lastStatus) && hasData($statusgrresult)) { //check if still Interessent - if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS) + if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS + || $lastStatus->retval[0]->status_kurzbz === self::BEWERBERSTATUS + || $lastStatus->retval[0]->status_kurzbz === self::WARTENDER) { $result = $this->PrestudentstatusModel->insert( array( @@ -1700,7 +1703,8 @@ class InfoCenter extends Auth_Controller $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); $statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval; - $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm']); + $studienSemester = $this->variablelib->getVar('infocenter_studiensemester'); + $studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(['b', 'm'], $studienSemester); $data = array ( 'statusgruende' => $statusgruende, diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 999fcbbd0..41bdabd11 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -482,16 +482,17 @@ class Studiengang_model extends DB_Model return $this->loadWhere($condition); } - public function getStudiengaengeWithOrgForm($typ) + public function getStudiengaengeWithOrgForm($typ, $semester) { $query = "SELECT DISTINCT (UPPER(sg.typ || sg.kurzbz || ':' || sp.orgform_kurzbz)) AS Studiengang - FROM public.tbl_prestudentstatus pss - JOIN public.tbl_prestudent ps USING(prestudent_id) - JOIN public.tbl_studiengang sg USING(studiengang_kz) - JOIN lehre.tbl_studienplan sp USING(studienplan_id) - WHERE sg.typ IN ? - ORDER BY Studiengang;"; + FROM public.tbl_studiengang sg + JOIN lehre.tbl_studienordnung USING (studiengang_kz) + JOIN lehre.tbl_studienplan sp USING (studienordnung_id) + JOIN lehre.tbl_studienplan_semester spsem USING (studienplan_id) + WHERE sp.aktiv = TRUE AND sg.aktiv = TRUE AND sg.typ IN ? + AND spsem.studiensemester_kurzbz = ? + ORDER BY Studiengang"; - return $this->execQuery($query, array($typ)); + return $this->execQuery($query, array($typ, $semester)); } } diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 047afe5f2..83e8c8916 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -114,6 +114,12 @@ sg.studiengang_kz in('.$ADDITIONAL_STG.') ) AND pss.studiensemester_kurzbz = '.$STUDIENSEMESTER.' + AND NOT EXISTS ( + SELECT 1 + FROM tbl_prestudentstatus spss + WHERE spss.prestudent_id = ps.prestudent_id + AND spss.status_kurzbz = '.$REJECTED_STATUS.' + ) LIMIT 1 ) AS "StgAbgeschickt", ( diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php index 22b122bb0..beb4887ae 100644 --- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php +++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php @@ -83,10 +83,11 @@ LIMIT 1 ) AS "AnzahlAbgeschickt", ( - SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz || \':\' || sg.orgform_kurzbz)), \', \') + SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz || \':\' || sp.orgform_kurzbz)), \', \') FROM public.tbl_prestudentstatus pss JOIN public.tbl_prestudent ps USING(prestudent_id) JOIN public.tbl_studiengang sg USING(studiengang_kz) + JOIN lehre.tbl_studienplan sp USING(studienplan_id) WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.' AND pss.bewerbung_abgeschicktamum IS NOT NULL AND ps.person_id = p.person_id diff --git a/application/views/system/infocenter/zgvpruefungen.php b/application/views/system/infocenter/zgvpruefungen.php index 5bf700483..2d00a789d 100644 --- a/application/views/system/infocenter/zgvpruefungen.php +++ b/application/views/system/infocenter/zgvpruefungen.php @@ -344,7 +344,7 @@ prestudentstatus->status_kurzbz) && in_array($zgvpruefung->prestudentstatus->status_kurzbz, ['Bewerber', 'Wartender']))) : ?> - prestudentstatus->bewerbung_abgeschicktamum)) - { - $disabled = $disabledStg = 'disabled'; - $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); - } + prestudentstatus->bewerbung_abgeschicktamum)) + { + $disabled = $disabledStg = 'disabled'; + $disabledTxt = $disabledStgTxt = $this->p->t('infocenter', 'bewerbungMussAbgeschickt'); + } - if ($studiengangtyp !== 'b') - { - $disabled = 'disabled'; - $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); + if ($studiengangtyp !== 'b') + { + $disabled = 'disabled'; + $disabledTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); - // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter - if (!in_array($studiengang_kz, $fit_programme_studiengaenge)) - { - $disabledStg = 'disabled'; - $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); - } + // FIT-Lehrgänge: exceptions, can be freigegeben in Infocenter + if (!in_array($studiengang_kz, $fit_programme_studiengaenge)) + { + $disabledStg = 'disabled'; + $disabledStgTxt = $this->p->t('infocenter', 'nurBachelorFreigeben'); } - ?> -
-
-
- - - + +
+
+ - -
-
- +
- - + + prestudentstatus->status_kurzbz) && $zgvpruefung->prestudentstatus->status_kurzbz === 'Interessent'): ?> @@ -528,46 +495,49 @@ - - + + + + Date: Wed, 23 Jun 2021 11:41:38 +0200 Subject: [PATCH 63/95] Adaptierungen setZGVMasterFields() --- include/prestudent.class.php | 69 ++++++++++++++++++++---------------- 1 file changed, 39 insertions(+), 30 deletions(-) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index c5b632ca5..73432e76e 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2318,9 +2318,9 @@ class prestudent extends person AND zgvmanation is NULL AND - typ in ('m','d') - AND - status_kurzbz = 'Interessent'"; + typ in ('m','d')";"; + -- AND + -- status_kurzbz = Interessent"; if ($db->db_query($qry)) { @@ -2330,44 +2330,54 @@ class prestudent extends person { while ($row = $db->db_fetch_object()) { - //echo var_dump($row->prestudent_id); - $arrayleereManations[] = $row->prestudent_id; + // echo ($row->prestudent_id . " = id " . $row->status_kurzbz . " = status " . $row->studiengang_kz . " = stg
"); + echo ($this->getLastPrestudentStatus($row->prestudent_id)); + if ($this->getLastPrestudentStatus($row->prestudent_id) == "Interessent") + { + $arrayleereManations[] = $row->prestudent_id; + } + } - //print_r($arrayleereManations); + print_r($arrayleereManations); - $qry = "UPDATE - public.tbl_prestudent - SET - (zgvmanation, zgvmaort, zgvmas_code) = ('A','Wien (FHTW)',1) - WHERE - prestudent_id in ("; - foreach ($arrayleereManations as $prestudent_id) + if($arrayleereManations) { - $qry .= $prestudent_id; + $qry = "UPDATE + public.tbl_prestudent + SET + (zgvmanation, zgvmaort, zgvmas_code) = ('A','Wien (FHTW)',1) + WHERE + prestudent_id in ("; - if (next($arrayleereManations) == true) + foreach ($arrayleereManations as $prestudent_id) { - $qry .= ","; + $qry .= $prestudent_id; + + if (next($arrayleereManations) == true) + { + $qry .= ","; + } } - } - $qry .= ");"; + $qry .= ");"; - //echo $qry; + echo $qry; - if ($this->db_query($qry)) - { - //echo " ZGV-Master Eintragungen vorgenommen!"; - return true; - } - else - { - $this->errormsg = 'Fehler beim Eintragen zgvMasterFields'; - return false; + if ($this->db_query($qry)) + { + echo " ZGV-Master Eintragungen vorgenommen!"; + return true; + } + else + { + $this->errormsg = 'Fehler beim Eintragen zgvMasterFields'; + return false; + } + } } else - //echo " Keine leere ZGVManation gefunden"; + echo " Keine prestudentId Master gefunden"; return true; } } @@ -2445,7 +2455,6 @@ class prestudent extends person { while ($row = $db->db_fetch_object()) { - //echo var_dump($row->prestudent_id); $prestudentsOfMaster[] = $row->prestudent_id; } From 84950649c4b56dc1a37a85728092303021f9c359 Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 24 Jun 2021 12:00:49 +0200 Subject: [PATCH 64/95] Adaptierungen ZGV-Master Funktionen --- include/prestudent.class.php | 97 +++++++----------------------------- 1 file changed, 17 insertions(+), 80 deletions(-) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index 73432e76e..8e19927ff 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2287,13 +2287,13 @@ class prestudent extends person } /** - * Befüllt MasterZGV Nation mit Österreich, - * MasterZGV-code mit FH-Bachelor(I) und MasterZGV-Ort mit Wien(FHTW) + * Befüllt MasterZGV-Felder: Nation mit Österreich und MasterZGV-code mit FH-Bachelor(I) * @param int $person_id Personenkennzeichen. + * @param varchar $ort Ort. * @return true wenn erfolgreich durchgeführt * false und errormsg wenn ein Fehler aufgetreten ist */ - public function setZGVMasterFields($person_id) + public function setZGVMasterFields($person_id, $ort) { if (!is_numeric($person_id)) { @@ -2311,16 +2311,14 @@ class prestudent extends person public.tbl_prestudent JOIN public.tbl_studiengang USING (studiengang_kz) - JOIN - public.tbl_prestudentstatus USING (prestudent_id) WHERE person_id = ".$this->db_add_param($person_id)." AND zgvmanation is NULL AND - typ in ('m','d')";"; - -- AND - -- status_kurzbz = Interessent"; + typ ='m' + And + get_rolle_prestudent(prestudent_id, null) = 'Interessent';"; if ($db->db_query($qry)) { @@ -2330,23 +2328,15 @@ class prestudent extends person { while ($row = $db->db_fetch_object()) { - // echo ($row->prestudent_id . " = id " . $row->status_kurzbz . " = status " . $row->studiengang_kz . " = stg
"); - echo ($this->getLastPrestudentStatus($row->prestudent_id)); - if ($this->getLastPrestudentStatus($row->prestudent_id) == "Interessent") - { - $arrayleereManations[] = $row->prestudent_id; - } - + $arrayleereManations[] = $row->prestudent_id; } - print_r($arrayleereManations); - - if($arrayleereManations) + if ($arrayleereManations) { $qry = "UPDATE public.tbl_prestudent SET - (zgvmanation, zgvmaort, zgvmas_code) = ('A','Wien (FHTW)',1) + (zgvmanation, zgvmaort, zgvmas_code) = ('A',".$this->db_add_param($ort).",1) WHERE prestudent_id in ("; @@ -2361,11 +2351,8 @@ class prestudent extends person } $qry .= ");"; - echo $qry; - if ($this->db_query($qry)) { - echo " ZGV-Master Eintragungen vorgenommen!"; return true; } else @@ -2373,56 +2360,18 @@ class prestudent extends person $this->errormsg = 'Fehler beim Eintragen zgvMasterFields'; return false; } - } } else - echo " Keine prestudentId Master gefunden"; return true; } } - /** - * liefert den letztgültigen Status des Prestudenten - * @param int $prestudent_id ID der zu überprüfenden Person. - * @return string $result wenn vorhanden - * false und errormsg wenn Fehler aufgetreten ist - */ - public function getLastPrestudentStatus($prestudent_id) - { - if (!is_numeric($prestudent_id)) - { - $this->errormsg = 'Prestudent_id muss eine gueltige Zahl sein'; - return false; - } - - $db = new basis_db(); - //get all prestudents - $qry = "SELECT pss.status_kurzbz - FROM public.tbl_prestudentstatus pss - JOIN public.tbl_prestudent ps using (prestudent_id) - where ps.prestudent_id = ".$this->db_add_param($prestudent_id)." - group by prestudent_id, pss.status_kurzbz, pss.insertamum - order by pss.insertamum DESC limit 1"; - - if ($db->db_query($qry)) - { - $row = $db->db_fetch_object(); - $result = $row->status_kurzbz; - return $result; - } - else - { - return false; - } - } /** * Prueft, ob eine Person einen aktuellen PreStudentstatus-Eintrag Interessent für einen Masterstudiengang besitzt * @param int $person_id ID der zu überprüfenden Person. - * @return true wenn vorhanden - * false wenn nicht vorhanden - * false und errormsg wenn Fehler aufgetreten ist + * @return true wenn vorhanden, false wenn nicht vorhanden */ public function existsStatusInteressentMaster($person_id) { @@ -2434,7 +2383,7 @@ class prestudent extends person $db = new basis_db(); $prestudentsOfMaster = array(); - //get all prestudents + $qry = "SELECT prestudent_id FROM @@ -2442,30 +2391,18 @@ class prestudent extends person WHERE ps.studiengang_kz = sg.studiengang_kz AND - sg.typ in ('m','d') - AND person_id = ".$this->db_add_param($person_id).";"; - - + sg.typ in ('m') + AND + person_id = ".$this->db_add_param($person_id)." + And + get_rolle_prestudent(prestudent_id, null) = 'Interessent';"; if ($db->db_query($qry)) { $num_rows = $db->db_num_rows(); - // Wenn kein ergebnis return 0 sonst ID if ($num_rows > 0) { - while ($row = $db->db_fetch_object()) - { - $prestudentsOfMaster[] = $row->prestudent_id; - } - - //prestudentIds auf Interessentenstatus prüfen - foreach ($prestudentsOfMaster as $prestudent_id) - { - if ($this->getLastPrestudentStatus($prestudent_id) == "Interessent") - { - return true; - } - } + return true; } } else From f4ddbd3084b65a3ed79e0b9ba07baac1102fb6f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 25 Jun 2021 11:15:12 +0200 Subject: [PATCH 65/95] Added DB-Index for lehre.tbl_pruefung to speed up queries --- system/dbupdate_3.3.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index e658d7a97..407a4aa24 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4767,6 +4767,20 @@ if($result = @$db->db_query("SELECT 1 FROM system.tbl_berechtigung WHERE berecht } } +// Add index to system.tbl_log +if ($result = $db->db_query("SELECT * FROM pg_class WHERE relname='idx_tbl_pruefung_student_uid'")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "CREATE INDEX idx_tbl_pruefung_student_uid ON lehre.tbl_pruefung USING btree (student_uid)"; + + if (! $db->db_query($qry)) + echo 'Indizes: ' . $db->db_last_error() . '
'; + else + echo 'Index fuer lehre.pruefung.student_uid hinzugefuegt
'; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; From d4d84a93ba82e5710b9e5f1f02635f2cc7f92415 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 29 Jun 2021 14:43:19 +0200 Subject: [PATCH 66/95] Nachreichdatum kann nun auch ueber das Infocenter gesetzt werden --- .../system/infocenter/InfoCenter.php | 59 +++++++ .../views/system/infocenter/dokpruefung.php | 30 ++++ .../system/infocenter/infocenterDetails.php | 3 +- public/css/infocenter/infocenterDetails.css | 11 ++ public/js/infocenter/docUeberpruefung.js | 145 ++++++++++++++++++ public/js/infocenter/infocenterDetails.js | 32 ---- system/phrasesupdate.php | 20 +++ 7 files changed, 267 insertions(+), 33 deletions(-) create mode 100644 public/js/infocenter/docUeberpruefung.js diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 4ac74dde5..7dceb954c 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -112,6 +112,7 @@ class InfoCenter extends Auth_Controller 'unlockPerson' => 'infocenter:rw', 'saveFormalGeprueft' => 'infocenter:rw', 'saveDocTyp' => 'infocenter:rw', + 'saveNachreichung' => 'infocenter:rw', 'getPrestudentData' => 'infocenter:r', 'getLastPrestudentWithZgvJson' => 'infocenter:r', 'getZgvInfoForPrestudent' => 'infocenter:r', @@ -1211,6 +1212,64 @@ class InfoCenter extends Auth_Controller $this->outputJsonSuccess('success'); } + public function saveNachreichung($person_id) + { + $nachreichungAm = $this->input->post('nachreichungAm'); + $nachreichungAnmerkung = empty($this->input->post('nachreichungAnmerkung')) ? NULL : $this->input->post('nachreichungAnmerkung'); + $typ = $this->input->post('typ'); + + $allowedTypes = [ + 'VorlSpB2' => 'SprachB2', + 'ZgvBaPre' => 'zgv_bakk', + 'ZgvMaPre' => 'zgv_mast' + ]; + + if (!in_array($typ, array_keys($allowedTypes))) + $this->terminateWithJsonError('Bei dem Dokument ist keine Nachreichung möglich'); + + if (empty($nachreichungAm)) + $this->terminateWithJsonError('Ein Datum muss im folgenden Format angegeben werden: tt.mm.jjjj'); + + if (!preg_match('/^\d{2}\.\d{2}\.(\d{2}|\d{4})$/ ', $nachreichungAm)) + $this->terminateWithJsonError('Bitte das Datum im folgenden Format angeben: tt.mm.jjjj'); + + $akte = $this->AkteModel->loadWhere(array('person_id' => $person_id, 'dokument_kurzbz' => $allowedTypes[$typ])); + + if (hasData($akte)) { + $akte = getData($akte)[0]; + $this->AkteModel->update( + $akte->akte_id, + array( + 'anmerkung' => $nachreichungAnmerkung, + 'updateamum' => date('Y-m-d H:i:s'), + 'updatevon' => get_uid(), + 'nachgereicht' => true, + 'nachgereicht_am' => date_format(date_create($nachreichungAm), 'Y-m-d') + ) + ); + } + else + { + $this->AkteModel->insert( + array( + 'dokument_kurzbz' => $allowedTypes[$typ], + 'person_id' => $person_id, + 'erstelltam' => NULL, + 'gedruckt' => false, + 'anmerkung' => $nachreichungAnmerkung, + 'updateamum' => date('Y-m-d H:i:s'), + 'updatevon' => get_uid(), + 'insertamum' => date('Y-m-d H:i:s'), + 'insertvon' => get_uid(), + 'uid' => NULL, + 'nachgereicht' => true, + 'nachgereicht_am' => date_format(date_create($nachreichungAm), 'Y-m-d') + ) + ); + } + + $this->outputJsonSuccess("Done!"); + } // ----------------------------------------------------------------------------------------------------------------- // Private methods diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index 7ee77e815..214f450b0 100644 --- a/application/views/system/infocenter/dokpruefung.php +++ b/application/views/system/infocenter/dokpruefung.php @@ -28,6 +28,36 @@ echo "" ?> + +
+ +
+ + + + erstelltam), 'd.m.Y') ?> langtext ?> diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index a448e95ce..dbfff7d08 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -26,7 +26,8 @@ 'public/js/tablesort/tablesort.js', 'public/js/infocenter/messageList.js', 'public/js/infocenter/infocenterDetails.js', - 'public/js/infocenter/zgvUeberpruefung.js' + 'public/js/infocenter/zgvUeberpruefung.js', + 'public/js/infocenter/docUeberpruefung.js' ), 'phrases' => array( 'infocenter' => array( diff --git a/public/css/infocenter/infocenterDetails.css b/public/css/infocenter/infocenterDetails.css index 38a7824fa..2f2debc00 100644 --- a/public/css/infocenter/infocenterDetails.css +++ b/public/css/infocenter/infocenterDetails.css @@ -76,6 +76,17 @@ font-weight: normal; } +.nachreichungInfos +{ + float: right; + margin: 5px 15px 0 0; +} + +.nachreichungInputs .row +{ + margin-top: 5px; +} + @media screen and (max-width: 1510px) { #postponing{ diff --git a/public/js/infocenter/docUeberpruefung.js b/public/js/infocenter/docUeberpruefung.js new file mode 100644 index 000000000..495257f41 --- /dev/null +++ b/public/js/infocenter/docUeberpruefung.js @@ -0,0 +1,145 @@ +$(document).ready(function () +{ + var personid = $("#hiddenpersonid").val(); + + DocUeberpruefung.checkNachreichungButtons(); + + $('select.aktenid').change(function() + { + var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + var typ = $(this).val(); + DocUeberpruefung.saveDocTyp(personid, akteid, typ); + }); + + $('.nachreichungInfos').click(function() + { + var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + DocUeberpruefung.checkNachreichungInputs(akteid); + }); + + $('.nachreichungAbbrechen').click(function() + { + var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + DocUeberpruefung.checkNachreichungInputs(akteid); + }); + + $('.nachreichungSpeichern').click(function() + { + var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + var typ = $('#aktenid_' + akteid).val(); + + var nachreichungAm = $('#nachreichungAm_' + akteid).val(); + var nachreichungAnmerkung = $('#nachreichungAnmerkung_' + akteid).val(); + + if(nachreichungAm === '') + { + FHC_DialogLib.alertError('Ein Datum muss im folgenden Format angegeben werden: tt.mm.jjjj'); + return false; + } + + var regEx = /^\d{2}\.\d{2}\.(\d{2}|\d{4})$/; + if(nachreichungAm.match(regEx) === null) + { + FHC_DialogLib.alertError('Bitte das Datum im folgenden Format angeben: tt.mm.jjjj') + return false; + } + + DocUeberpruefung.saveNachreichung(personid, nachreichungAm, nachreichungAnmerkung, typ); + }) +}); + +var DocUeberpruefung = { + + saveDocTyp: function(personid, akteid, typ) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + "/saveDocTyp/"+encodeURIComponent(personid), + { + "akte_id": akteid, + "typ" : typ + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isSuccess(data)) + { + FHC_DialogLib.alertSuccess("Done!"); + InfocenterDetails._refreshLog(); + DocUeberpruefung.checkNachreichungButton(akteid); + } + else + { + FHC_DialogLib.alertError(data); + } + }, + errorCallback: function() { + FHC_DialogLib.alertWarning("Fehler beim Speichern!"); + } + } + ); + }, + + saveNachreichung: function (personid, nachreichungAm, nachreichungAnmerkung, typ) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + "/saveNachreichung/"+encodeURIComponent(personid), + { + "nachreichungAm": nachreichungAm, + "nachreichungAnmerkung" : nachreichungAnmerkung, + "typ" : typ + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.isSuccess(data)) + { + FHC_DialogLib.alertSuccess("Done!"); + InfocenterDetails._refreshLog(); + } + else + { + FHC_DialogLib.alertError(data); + } + }, + errorCallback: function() { + FHC_DialogLib.alertWarning("Fehler beim Speichern!"); + } + } + ); + }, + + checkNachreichungInputs: function(akteid) + { + var inputs = $('#nachreichungInputs_' + akteid); + + if (inputs.hasClass('hidden')) + { + inputs.removeClass('hidden'); + } + else + { + inputs.addClass('hidden'); + $('#nachreichungAnmerkung_' + akteid).val(""); + $('#nachreichungAm_' + akteid).val(""); + } + }, + + checkNachreichungButtons: function() + { + $('select.aktenid').each(function () { + var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); + DocUeberpruefung.checkNachreichungButton(akteid); + }); + }, + + checkNachreichungButton: function(akteid) + { + var allowedTyps = ['VorlSpB2', 'ZgvBaPre', 'ZgvMaPre']; + var typ = $('#aktenid_' + akteid).val(); + var infos = $('#nachreichungInfos_' + akteid); + + if ($.inArray(typ, allowedTyps) === -1) + infos.addClass('hidden'); + else + infos.removeClass('hidden'); + } + +} \ No newline at end of file diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index de2ba0064..1e393fc28 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -119,11 +119,6 @@ $(document).ready(function () } ); - $('.aktenid').change(function(){ - var akteid = InfocenterDetails._getPrestudentIdFromElementId(this.id); - var typ = $(this).val(); - InfocenterDetails.saveDocTyp(personid, akteid, typ); - }); }); var InfocenterDetails = { @@ -751,33 +746,6 @@ var InfocenterDetails = { ); }, - saveDocTyp: function(personid, akteid, typ) - { - FHC_AjaxClient.ajaxCallPost( - CALLED_PATH + "/saveDocTyp/"+encodeURIComponent(personid), - { - "akte_id": akteid, - "typ" : typ - }, - { - successCallback: function(data, textStatus, jqXHR) { - if (FHC_AjaxClient.isSuccess(data)) - { - FHC_DialogLib.alertSuccess("Done!"); - InfocenterDetails._refreshLog(); - } - else - { - FHC_DialogLib.alertError("Fehler beim Speichern des Dokumententypes!"); - } - }, - errorCallback: function() { - FHC_DialogLib.alertWarning("Document type could not be updated"); - } - } - ); - }, - // ----------------------------------------------------------------------------------------------------------------- // (private) methods executed after ajax (refreshers) diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index b977e28a8..9559cb0c2 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -3486,6 +3486,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'dokumentWirdNachgereicht', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Dokument wird nachgereicht', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Document will be submitted later', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global', From 67aa88798116444c3eb4d70c30639523830c333d Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 29 Jun 2021 14:47:57 +0200 Subject: [PATCH 67/95] anzeige des errors --- public/js/infocenter/docUeberpruefung.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/js/infocenter/docUeberpruefung.js b/public/js/infocenter/docUeberpruefung.js index 495257f41..ba45b8986 100644 --- a/public/js/infocenter/docUeberpruefung.js +++ b/public/js/infocenter/docUeberpruefung.js @@ -68,7 +68,7 @@ var DocUeberpruefung = { } else { - FHC_DialogLib.alertError(data); + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); } }, errorCallback: function() { @@ -96,7 +96,7 @@ var DocUeberpruefung = { } else { - FHC_DialogLib.alertError(data); + FHC_DialogLib.alertError(FHC_AjaxClient.getError(data)); } }, errorCallback: function() { From 36507959acd1be8c9c21b333ec0d591603d50ca4 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 30 Jun 2021 13:09:56 +0200 Subject: [PATCH 68/95] dokumentenpruefung im infocenter in eigenes js ausgelagert, reloaden der anzeige beim nachreichen eines doks --- .../system/infocenter/InfoCenter.php | 42 +++++++-- .../system/infocenter/dokNachzureichend.php | 32 +++++++ .../views/system/infocenter/dokpruefung.php | 34 +------ .../system/infocenter/infocenterDetails.php | 7 +- .../infocenter/infocenterZgvDetails.php | 3 + public/js/infocenter/docUeberpruefung.js | 91 +++++++++++++++++-- public/js/infocenter/infocenterDetails.js | 49 ---------- system/phrasesupdate.php | 60 ++++++++++++ 8 files changed, 218 insertions(+), 100 deletions(-) create mode 100644 application/views/system/infocenter/dokNachzureichend.php diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 7dceb954c..deb388add 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -127,6 +127,7 @@ class InfoCenter extends Auth_Controller 'updateNotiz' => 'infocenter:rw', 'reloadZgvPruefungen' => 'infocenter:r', 'reloadMessages' => 'infocenter:r', + 'reloadDoks' => 'infocenter:r', 'reloadNotizen' => 'infocenter:r', 'reloadLogs' => 'infocenter:r', 'outputAkteContent' => 'infocenter:r', @@ -1023,6 +1024,13 @@ class InfoCenter extends Auth_Controller $this->load->view('system/infocenter/logs.php', array('logs' => $logs)); } + public function reloadDoks($person_id) + { + $dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true); + + $this->load->view('system/infocenter/dokNachzureichend.php', array('dokumente_nachgereicht' => $dokumente_nachgereicht->retval)); + } + /** * Outputs content of an Akte, sends appropriate headers (so the document can be downloaded) * @param $akte_id @@ -1225,13 +1233,31 @@ class InfoCenter extends Auth_Controller ]; if (!in_array($typ, array_keys($allowedTypes))) - $this->terminateWithJsonError('Bei dem Dokument ist keine Nachreichung möglich'); + $this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern')); if (empty($nachreichungAm)) - $this->terminateWithJsonError('Ein Datum muss im folgenden Format angegeben werden: tt.mm.jjjj'); + $this->terminateWithJsonError($this->p->t('infocenter', 'datumUngueltig')); if (!preg_match('/^\d{2}\.\d{2}\.(\d{2}|\d{4})$/ ', $nachreichungAm)) - $this->terminateWithJsonError('Bitte das Datum im folgenden Format angeben: tt.mm.jjjj'); + { + $this->terminateWithJsonError($this->p->t('infocenter', 'datumUngueltig')); + } + else + { + $ds = explode('.', $nachreichungAm); + if (! checkdate($ds[1], $ds[0], $ds[2])) + { + $this->terminateWithJsonError($this->p->t('infocenter', 'datumUngueltig')); + } + } + + $nachreichungAm = (date_format(date_create($nachreichungAm), 'Y-m-d')); + + $today = date('Y-m-d H:i:s'); + + if($nachreichungAm < $today) + $this->terminateWithJsonError($this->p->t('infocenter', 'nachreichDatumNichtVergangenheit')); + $akte = $this->AkteModel->loadWhere(array('person_id' => $person_id, 'dokument_kurzbz' => $allowedTypes[$typ])); @@ -1241,10 +1267,10 @@ class InfoCenter extends Auth_Controller $akte->akte_id, array( 'anmerkung' => $nachreichungAnmerkung, - 'updateamum' => date('Y-m-d H:i:s'), + 'updateamum' => $today, 'updatevon' => get_uid(), 'nachgereicht' => true, - 'nachgereicht_am' => date_format(date_create($nachreichungAm), 'Y-m-d') + 'nachgereicht_am' => $nachreichungAm ) ); } @@ -1257,13 +1283,13 @@ class InfoCenter extends Auth_Controller 'erstelltam' => NULL, 'gedruckt' => false, 'anmerkung' => $nachreichungAnmerkung, - 'updateamum' => date('Y-m-d H:i:s'), + 'updateamum' => $today, 'updatevon' => get_uid(), - 'insertamum' => date('Y-m-d H:i:s'), + 'insertamum' => $today, 'insertvon' => get_uid(), 'uid' => NULL, 'nachgereicht' => true, - 'nachgereicht_am' => date_format(date_create($nachreichungAm), 'Y-m-d') + 'nachgereicht_am' => $nachreichungAm ) ); } diff --git a/application/views/system/infocenter/dokNachzureichend.php b/application/views/system/infocenter/dokNachzureichend.php new file mode 100644 index 000000000..7a3b3aa03 --- /dev/null +++ b/application/views/system/infocenter/dokNachzureichend.php @@ -0,0 +1,32 @@ + 0): ?> +
+

p->t('infocenter','nachzureichendeDokumente')) ?>

+ + + + + + + + + + + + + + + + + + + +
p->t('global','typ')) ?>p->t('infocenter','nachzureichenAm')) ?>p->t('infocenter','ausstellungsnation')) ?>p->t('global','anmerkung')) ?>
dokument_bezeichnung ?> + nachgereicht_am) ? date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : ''; ?> + + langtext ?> + + anmerkung; ?> +
+ \ No newline at end of file diff --git a/application/views/system/infocenter/dokpruefung.php b/application/views/system/infocenter/dokpruefung.php index 214f450b0..95e383569 100644 --- a/application/views/system/infocenter/dokpruefung.php +++ b/application/views/system/infocenter/dokpruefung.php @@ -76,36 +76,4 @@ - - 0): ?> -
-

p->t('infocenter','nachzureichendeDokumente')) ?>

- - - - - - - - - - - - - - - - - - - -
p->t('global','typ')) ?>p->t('infocenter','nachzureichenAm')) ?>p->t('infocenter','ausstellungsnation')) ?>p->t('global','anmerkung')) ?>
dokument_bezeichnung ?> - nachgereicht_am) ? date_format(date_create($dokument->nachgereicht_am), 'd.m.Y') : ''; ?> - - langtext ?> - - anmerkung; ?> -
- + \ No newline at end of file diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index dbfff7d08..30acb8617 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -49,7 +49,9 @@ 'zgvInPruefung', 'zgvErfuellt', 'zgvNichtErfuellt', - 'zgvErfuelltPruefung' + 'zgvErfuelltPruefung', + 'datumUngueltig', + 'nachreichDatumNichtVergangenheit' ), 'ui' => array( 'gespeichert', @@ -127,6 +129,9 @@
load->view('system/infocenter/dokpruefung.php'); ?> +
+ load->view('system/infocenter/dokNachzureichend.php'); ?> +
diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index a1362d2fa..1f50aa147 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -116,6 +116,9 @@
load->view('system/infocenter/dokpruefung.php', array('formalReadonly' => true)); ?> +
+ load->view('system/infocenter/dokNachzureichend.php'); ?> +
diff --git a/public/js/infocenter/docUeberpruefung.js b/public/js/infocenter/docUeberpruefung.js index ba45b8986..acb0ca60f 100644 --- a/public/js/infocenter/docUeberpruefung.js +++ b/public/js/infocenter/docUeberpruefung.js @@ -1,8 +1,20 @@ +const ALLOWED_DOC_TYPES = ['VorlSpB2', 'ZgvBaPre', 'ZgvMaPre']; + $(document).ready(function () { + DocUeberpruefung._formatDocTable(); + DocUeberpruefung.checkNachreichungButtons(); + var personid = $("#hiddenpersonid").val(); - DocUeberpruefung.checkNachreichungButtons(); + //add click events to "formal geprüft" checkboxes + $(".prchbox").click(function () + { + var boxid = this.id; + var akteid = InfocenterDetails._getPrestudentIdFromElementId(boxid); + var checked = this.checked; + DocUeberpruefung.saveFormalGeprueft(personid, akteid, checked) + }); $('select.aktenid').change(function() { @@ -33,14 +45,15 @@ $(document).ready(function () if(nachreichungAm === '') { - FHC_DialogLib.alertError('Ein Datum muss im folgenden Format angegeben werden: tt.mm.jjjj'); + FHC_DialogLib.alertError(FHC_PhrasesLib.t('infocenter', 'datumUngueltig')); return false; } var regEx = /^\d{2}\.\d{2}\.(\d{2}|\d{4})$/; + if(nachreichungAm.match(regEx) === null) { - FHC_DialogLib.alertError('Bitte das Datum im folgenden Format angeben: tt.mm.jjjj') + FHC_DialogLib.alertError(FHC_PhrasesLib.t('infocenter', 'datumUngueltig')) return false; } @@ -50,10 +63,48 @@ $(document).ready(function () var DocUeberpruefung = { + saveFormalGeprueft: function(personid, akteid, checked) + { + FHC_AjaxClient.ajaxCallPost( + CALLED_PATH + '/saveFormalGeprueft/' + encodeURIComponent(personid), + { + akte_id: akteid, + formal_geprueft: checked + }, + { + successCallback: function(data, textStatus, jqXHR) { + if (FHC_AjaxClient.hasData(data)) + { + var timestamp = data.retval[0]; + if (timestamp === "") + { + $("#formalgeprueftam_" + akteid).text(""); + } + else + { + var fgdatum = $.datepicker.parseDate("yy-mm-dd", timestamp); + var gerfgdatum = $.datepicker.formatDate("dd.mm.yy", fgdatum); + $("#formalgeprueftam_" + akteid).text(gerfgdatum); + } + //refresh doctable tablesorter, formal geprueft changed! + $("#doctable").trigger("update"); + InfocenterDetails._refreshLog(); + } + else + { + InfocenterDetails._genericSaveError(); + } + }, + errorCallback: InfocenterDetails._genericSaveError, + veilTimeout: 0 + } + ); + }, + saveDocTyp: function(personid, akteid, typ) { FHC_AjaxClient.ajaxCallPost( - CALLED_PATH + "/saveDocTyp/"+encodeURIComponent(personid), + CALLED_PATH + "/saveDocTyp/" + encodeURIComponent(personid), { "akte_id": akteid, "typ" : typ @@ -81,7 +132,7 @@ var DocUeberpruefung = { saveNachreichung: function (personid, nachreichungAm, nachreichungAnmerkung, typ) { FHC_AjaxClient.ajaxCallPost( - CALLED_PATH + "/saveNachreichung/"+encodeURIComponent(personid), + CALLED_PATH + "/saveNachreichung/" + encodeURIComponent(personid), { "nachreichungAm": nachreichungAm, "nachreichungAnmerkung" : nachreichungAnmerkung, @@ -91,8 +142,9 @@ var DocUeberpruefung = { successCallback: function(data, textStatus, jqXHR) { if (FHC_AjaxClient.isSuccess(data)) { - FHC_DialogLib.alertSuccess("Done!"); + DocUeberpruefung._refreshNachzureichendeDoks(); InfocenterDetails._refreshLog(); + FHC_DialogLib.alertSuccess("Done!"); } else { @@ -132,14 +184,35 @@ var DocUeberpruefung = { checkNachreichungButton: function(akteid) { - var allowedTyps = ['VorlSpB2', 'ZgvBaPre', 'ZgvMaPre']; var typ = $('#aktenid_' + akteid).val(); var infos = $('#nachreichungInfos_' + akteid); - if ($.inArray(typ, allowedTyps) === -1) + if ($.inArray(typ, ALLOWED_DOC_TYPES) === -1) + { infos.addClass('hidden'); + } else + { infos.removeClass('hidden'); - } + } + }, + + _refreshNachzureichendeDoks: function() + { + var personid = $("#hiddenpersonid").val(); + + $("#nachzureichendeDoks").load( + CONTROLLER_URL + '/reloadDoks/' + personid + '?fhc_controller_id=' + FHC_AjaxClient.getUrlParameter('fhc_controller_id'), + function () { + DocUeberpruefung._formatDocTable(); + } + ); + }, + + _formatDocTable: function() + { + Tablesort.addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]); + Tablesort.addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]); + }, } \ No newline at end of file diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 1e393fc28..871516935 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -21,9 +21,6 @@ const ONHOLDNAME = 'onhold'; */ $(document).ready(function () { - //initialise table sorter - Tablesort.addTablesorter("doctable", [[2, 1], [1, 0]], ["zebra"]); - Tablesort.addTablesorter("nachgdoctable", [[2, 0], [1, 1]], ["zebra"]); InfocenterDetails._formatMessageTable(); InfocenterDetails._formatNotizTable(); @@ -37,15 +34,6 @@ $(document).ready(function () $("#sendmsgform").submit(); }); - //add click events to "formal geprüft" checkboxes - $(".prchbox").click(function () - { - var boxid = this.id; - var akteid = InfocenterDetails._getPrestudentIdFromElementId(boxid); - var checked = this.checked; - InfocenterDetails.saveFormalGeprueft(personid, akteid, checked) - }); - //add click events to zgv Prüfung section InfocenterDetails._addZgvPruefungEvents(personid); @@ -133,43 +121,6 @@ var InfocenterDetails = { // ----------------------------------------------------------------------------------------------------------------- // ajax calls - saveFormalGeprueft: function(personid, akteid, checked) - { - FHC_AjaxClient.ajaxCallPost( - CALLED_PATH + '/saveFormalGeprueft/' + encodeURIComponent(personid), - { - akte_id: akteid, - formal_geprueft: checked - }, - { - successCallback: function(data, textStatus, jqXHR) { - if (FHC_AjaxClient.hasData(data)) - { - var timestamp = data.retval[0]; - if (timestamp === "") - { - $("#formalgeprueftam_" + akteid).text(""); - } - else - { - var fgdatum = $.datepicker.parseDate("yy-mm-dd", timestamp); - var gerfgdatum = $.datepicker.formatDate("dd.mm.yy", fgdatum); - $("#formalgeprueftam_" + akteid).text(gerfgdatum); - } - //refresh doctable tablesorter, formal geprueft changed! - $("#doctable").trigger("update"); - InfocenterDetails._refreshLog(); - } - else - { - InfocenterDetails._genericSaveError(); - } - }, - errorCallback: InfocenterDetails._genericSaveError, - veilTimeout: 0 - } - ); - }, saveBewPriorisierung: function(data) { FHC_AjaxClient.ajaxCallPost( diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 9559cb0c2..587308519 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -3506,6 +3506,66 @@ $phrases = array( ) ) ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'datumUngueltig', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Das Datumsformat ist ungültig oder liegt außerhalb des gültigen Bereichs. Bitte geben Sie ein gültiges Datum im Format tt.mm.jjjj ein.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Date is invalid or out of range. Please enter a valid date in the format dd.mm.yyyy.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'dokUngueltig', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bei dem Dokument ist keine Nachreichung möglich.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Date is invalid or out of range. Please enter a valid date in the format dd.mm.yyyy.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'infocenter', + 'category' => 'infocenter', + 'phrase' => 'nachreichDatumNichtVergangenheit', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Das Datum der Nachreichung darf nicht in der Vergangenheit liegen.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'The date of submission may not be in the past.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global', From 745ecf47111293f47aa1231473a14677102c3cab Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 30 Jun 2021 13:29:09 +0200 Subject: [PATCH 69/95] zgv pruefung unterscheiden zwischen bachelor und master --- .../system/infocenter/InfoCenter.php | 4 +++- .../infocenter/infocenterZgvDetails.php | 13 +++++++--- public/js/infocenter/zgvUeberpruefung.js | 24 ++++++++++++++----- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index deb388add..12d9a9c4d 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -242,6 +242,7 @@ class InfoCenter extends Auth_Controller $persondata = $this->_loadPersonData(getData($prestudentexists)[0]->person_id); $prestudent_id = array('prestudent_id' => $prestudent_id); $status = array('status' => getData($zgv)[0]->status); + $prestudent_data = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); $this->DokumentModel->addOrder('bezeichnung'); $dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load()))); @@ -250,7 +251,8 @@ class InfoCenter extends Auth_Controller $persondata, $prestudent_id, $status, - $dokumentdata + $dokumentdata, + $prestudent_data ); $origin_page = $this->input->get(self::ORIGIN_PAGE); diff --git a/application/views/system/infocenter/infocenterZgvDetails.php b/application/views/system/infocenter/infocenterZgvDetails.php index 1f50aa147..62fefbec8 100644 --- a/application/views/system/infocenter/infocenterZgvDetails.php +++ b/application/views/system/infocenter/infocenterZgvDetails.php @@ -59,6 +59,7 @@
+
diff --git a/public/js/infocenter/zgvUeberpruefung.js b/public/js/infocenter/zgvUeberpruefung.js index 0be4dfdad..6181083f2 100644 --- a/public/js/infocenter/zgvUeberpruefung.js +++ b/public/js/infocenter/zgvUeberpruefung.js @@ -2,6 +2,8 @@ $(document).ready(function () { var personid = $("#hiddenpersonid").val(); + var studiengang = $('#studiengangtyp').val(); + zgvUeberpruefung.checkAfterReload(); $('.zgvRueckfragen').click(function () @@ -18,12 +20,22 @@ $(document).ready(function () $('.zgvAkzeptieren').click(function (){ var prestudentid = InfocenterDetails._getPrestudentIdFromElementId(this.id); - var data = { - 'person_id' : personid, - 'prestudent_id' : prestudentid, - 'status' : 'accepted' + if (studiengang === 'b') + { + $('#inputStatus_' + prestudentid).val('accepted'); + $('#notizModal_' + prestudentid).modal('show'); + $('#notizModal_' + prestudentid + ' #inputNotizTitelModal').val('ZGV wurde erfüllt') } - zgvUeberpruefung.zgvStatusUpdate(data); + else + { + var data = { + 'person_id' : personid, + 'prestudent_id' : prestudentid, + 'status' : 'accepted' + } + zgvUeberpruefung.zgvStatusUpdate(data); + } + }); $('.zgvAblehnen').click(function (){ @@ -176,7 +188,7 @@ var zgvUeberpruefung = { checkAfterReload: function() { $('.zgvStatusText').each(function() { - if($(this).data('info')) { + if ($(this).data('info')) { zgvUeberpruefung.checkStatus(InfocenterDetails._getPrestudentIdFromElementId($(this).attr('id'))); } }); From 36d162d2d7d2ff58dc3b0b18371e808bb3577116 Mon Sep 17 00:00:00 2001 From: manu Date: Wed, 30 Jun 2021 14:29:58 +0200 Subject: [PATCH 70/95] =?UTF-8?q?13850=20Best=C3=A4tigungsmail=20an=20Mita?= =?UTF-8?q?rbeiter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/profile/urlaubsfreigabe.php | 36 +++++++++++++++++++++++++ locale/de-AT/urlaubstool.php | 6 +++++ locale/en-US/urlaubstool.php | 5 ++++ 3 files changed, 47 insertions(+) diff --git a/cis/private/profile/urlaubsfreigabe.php b/cis/private/profile/urlaubsfreigabe.php index 251e1ee3e..bf790871e 100644 --- a/cis/private/profile/urlaubsfreigabe.php +++ b/cis/private/profile/urlaubsfreigabe.php @@ -18,6 +18,7 @@ * Authors: Christian Paminger , * Andreas Oesterreicher , * Rudolf Hangl and + * Manuela Thamer */ require_once('../../../config/cis.config.inc.php'); require_once('../../../include/functions.inc.php'); @@ -28,6 +29,13 @@ require_once('../../../include/benutzer.class.php'); require_once('../../../include/mitarbeiter.class.php'); require_once('../../../include/benutzerberechtigung.class.php'); require_once('../../../include/addon.class.php'); +require_once('../../../include/mail.class.php'); +require_once('../../../include/phrasen.class.php'); +require_once('../../../include/globals.inc.php'); +require_once('../../../include/sprache.class.php'); + +$sprache = getSprache(); +$p = new phrasen($sprache); if (!$db = new basis_db()) die('Fehler beim Oeffnen der Datenbankverbindung'); @@ -54,6 +62,7 @@ if(isset($_GET['uid'])) else $uid=''; + $datum_obj = new datum(); echo ' @@ -141,7 +150,34 @@ if(isset($_GET['action']) && $_GET['action']=='freigabe') $zeitsperre->freigabeamum = date('Y-m-d H:i:s'); $zeitsperre->freigabevon = $user; if(!$zeitsperre->save(false)) + { echo "Fehler bei der Freigabe: $zeitsperre->errormsg"; + } + + + //Bestätigungsmail an Mitarbeiter*in + $to = $uid . '@'.DOMAIN; + $benutzer = new benutzer(); + $benutzer->load($uid); + $person = new person(); + $fullName = $person->getFullNameFromBenutzer($uid); + $from = 'noreply@'.DOMAIN; + $subject = $p->t('urlaubstool/urlaubsfreigabe') . date("d.m.Y", strtotime($zeitsperre->vondatum)). " " . $p->t('urlaubstool/bis'). " ". date("d.m.Y", strtotime($zeitsperre->bisdatum)); + $text = $p->t('urlaubstool/diesIstEineAutomatischeMail')."\n"; + $text .= $p->t('urlaubstool/urlaubVon')." ".date("d.m.Y", strtotime($zeitsperre->vondatum))." ".$p->t('urlaubstool/bis')." ".date("d.m.Y", strtotime($zeitsperre->bisdatum)); + $text .= $p->t('urlaubstool/urlaubBis',array($fullName)); + $text .= "\n". "\n". $p->t('urlaubstool/sieKoennenDiesenUnterFolgenderAdresseEinsehen'); + $text .= "\n". APP_ROOT . 'cis/private/profile/urlaubstool.php?uid='.$uid; + + + $mail = new mail($to, $from, $subject, $text); + + if($mail->send()) + { + echo "".$p->t('urlaubstool/bestaetigungsmailWurdeVersandt',array($fullName)).""; + + } + } else { diff --git a/locale/de-AT/urlaubstool.php b/locale/de-AT/urlaubstool.php index cd34be0da..6d6edde09 100644 --- a/locale/de-AT/urlaubstool.php +++ b/locale/de-AT/urlaubstool.php @@ -40,4 +40,10 @@ $this->phrasen['urlaubstool/freigegebenerUrlaubGeloescht']='Bereits Freigegebene $this->phrasen['urlaubstool/VorgesetzteInformiert']='Email wurde an %s versandt'; $this->phrasen['urlaubstool/konnteKeinInformationsemailVersendetWerden']='Es konnte kein Email versendet werden, da kein Vorgesetzter eingetragen ist!'; $this->phrasen['urlaubstool/xHatUrlaubGeloescht']='%s %s hat bereits freigegebenen Urlaub gelöscht'; +$this->phrasen['urlaubstool/urlaubsfreigabe']='Freigabe Urlaub: '; +$this->phrasen['urlaubstool/bestaetigungsmailWurdeVersandt']='Bestätigungsmail an %s versandt'; +$this->phrasen['urlaubstool/urlaubVon']='Ihr angefragter Urlaub von'; +$this->phrasen['urlaubstool/urlaubBis']=' wurde von %s freigegeben.'; +$this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseEinsehen']='Sie können diesen unter folgender Adresse einsehen:'; + ?> diff --git a/locale/en-US/urlaubstool.php b/locale/en-US/urlaubstool.php index f52f2d981..d8c947947 100644 --- a/locale/en-US/urlaubstool.php +++ b/locale/en-US/urlaubstool.php @@ -36,4 +36,9 @@ $this->phrasen['urlaubstool/meineZeitsperren']='My Planned Absences'; $this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseFreigeben']='Sie können diesen unter folgender Adresse freigeben'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll $this->phrasen['urlaubstool/freigabeansuchenUrlaub']='Freigabeansuchen Urlaub'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll $this->phrasen['urlaubstool/freigabeFehlt']='Vacation has not been approved yet'; +$this->phrasen['urlaubstool/urlaubsfreigabe']='Vacation approval: '; +$this->phrasen['urlaubstool/bestaetigungsmailWurdeVersandt']='Confirmation mail to %s sent'; +$this->phrasen['urlaubstool/urlaubVon']='The requested vacation from'; +$this->phrasen['urlaubstool/urlaubBis']=' was approved by %s.'; +$this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseEinsehen']='Review your vacation here:'; ?> From 6246312ce52115f5484793523955122bc6dfafad Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 30 Jun 2021 15:24:25 +0200 Subject: [PATCH 71/95] bei ergaenzungspruefungen immer eine mail rausschicken und unterscheiden zw englisch und deutsch --- public/js/infocenter/infocenterDetails.js | 34 +++++++++++++---------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index 871516935..f5f435acb 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -9,6 +9,7 @@ const RTFREIGABE_MESSAGE_VORLAGE_QUER = "InfocenterRTfreigegQuer"; const RTFREIGABE_MESSAGE_VORLAGE_QUER_KURZ = "InfocenterRTfreigegQuerKurz"; const STGFREIGABE_MESSAGE_VORLAGE = "InfocenterSTGfreigegeben"; const STGFREIGABE_MESSAGE_VORLAGE_MASTER = "InfocenterSTGfreigegebenM"; +const STGFREIGABE_MESSAGE_VORLAGE_MASTER_ENGLISCH = "InfocenterSTGfreigegebenMEng"; //Statusgründe for which no Studiengang Freigabe Message should be sent const FIT_PROGRAMM_STUDIENGAENGE = [10021, 10027]; @@ -588,6 +589,7 @@ var InfocenterDetails = { var ausbildungssemester = receiverPrestudentstatus.ausbildungssemester; var studiengangbezeichnung = receiverPrestudentstatus.studiengangbezeichnung; var studiengangbezeichnung_englisch = receiverPrestudentstatus.studiengangbezeichnung_englisch; + var vorlage = null; var orgform_deutsch, orgform_englisch; orgform_deutsch = orgform_englisch = ""; @@ -625,7 +627,6 @@ var InfocenterDetails = { } else //not already for RT freigegeben - send RTfreigabe message { - var vorlage = null; //send Quereinstiegsmessage if later Ausbildungssemester if (ausbildungssemester > 1) { @@ -651,22 +652,25 @@ var InfocenterDetails = { } else { - //if Freigabe to Studiengang, send StgFreigabe Message if not already sent and allowed to send - if (!stgFreigegeben && receiverPrestudent.sendStgFreigabeMsg === true) + if (receiverPrestudent.studiengangtyp === 'm' && (freigabedata.statusgrundbezeichnung === 'Ergänzungsprüfungen' || freigabedata.statusgrundbezeichnung === 'Supplementary exams')) { - if (receiverPrestudent.studiengangtyp === 'm' && (freigabedata.statusgrundbezeichnung === 'Ergänzungsprüfungen' || freigabedata.statusgrundbezeichnung === 'Supplementary exams')) - { - msgvars = { - 'studiengangbezeichnung': studiengangbezeichnung, - 'studiengangbezeichnung_englisch': studiengangbezeichnung_englisch, - 'orgform_deutsch': orgform_deutsch, - 'orgform_englisch': orgform_englisch - } - InfocenterDetails.sendFreigabeMessage(prestudent_id, STGFREIGABE_MESSAGE_VORLAGE_MASTER, msgvars); - }else - { - InfocenterDetails.sendFreigabeMessage(prestudent_id, STGFREIGABE_MESSAGE_VORLAGE, msgvars); + msgvars = { + 'studiengangbezeichnung': studiengangbezeichnung, + 'studiengangbezeichnung_englisch': studiengangbezeichnung_englisch, + 'orgform_deutsch': orgform_deutsch, + 'orgform_englisch': orgform_englisch } + if (receiverPrestudentstatus.sprache === 'English') + vorlage = STGFREIGABE_MESSAGE_VORLAGE_MASTER_ENGLISCH + else + vorlage = STGFREIGABE_MESSAGE_VORLAGE_MASTER + + InfocenterDetails.sendFreigabeMessage(prestudent_id, vorlage, msgvars); + } + //if Freigabe to Studiengang, send StgFreigabe Message if not already sent and allowed to send + else if (!stgFreigegeben && receiverPrestudent.sendStgFreigabeMsg === true) + { + InfocenterDetails.sendFreigabeMessage(prestudent_id, STGFREIGABE_MESSAGE_VORLAGE, msgvars); } } }; From 3dd67b90b2a168b56a6d124327eb7b3671daa0ba Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 1 Jul 2021 08:13:17 +0200 Subject: [PATCH 72/95] Update Phrasen --- cis/private/profile/urlaubsfreigabe.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/cis/private/profile/urlaubsfreigabe.php b/cis/private/profile/urlaubsfreigabe.php index bf790871e..dde27d5fc 100644 --- a/cis/private/profile/urlaubsfreigabe.php +++ b/cis/private/profile/urlaubsfreigabe.php @@ -40,7 +40,8 @@ $p = new phrasen($sprache); if (!$db = new basis_db()) die('Fehler beim Oeffnen der Datenbankverbindung'); -$user = get_uid(); +//$user = get_uid(); +$user = 'ma0080'; $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($user); @@ -61,6 +62,7 @@ if(isset($_GET['uid'])) $uid=$_GET['uid']; else $uid=''; +echo "uid: " . $uid; $datum_obj = new datum(); @@ -157,15 +159,14 @@ if(isset($_GET['action']) && $_GET['action']=='freigabe') //Bestätigungsmail an Mitarbeiter*in $to = $uid . '@'.DOMAIN; - $benutzer = new benutzer(); - $benutzer->load($uid); $person = new person(); - $fullName = $person->getFullNameFromBenutzer($uid); + $fullNameVG = $person->getFullNameFromBenutzer($user); + $fullNameMA = $person->getFullNameFromBenutzer($uid); $from = 'noreply@'.DOMAIN; $subject = $p->t('urlaubstool/urlaubsfreigabe') . date("d.m.Y", strtotime($zeitsperre->vondatum)). " " . $p->t('urlaubstool/bis'). " ". date("d.m.Y", strtotime($zeitsperre->bisdatum)); $text = $p->t('urlaubstool/diesIstEineAutomatischeMail')."\n"; $text .= $p->t('urlaubstool/urlaubVon')." ".date("d.m.Y", strtotime($zeitsperre->vondatum))." ".$p->t('urlaubstool/bis')." ".date("d.m.Y", strtotime($zeitsperre->bisdatum)); - $text .= $p->t('urlaubstool/urlaubBis',array($fullName)); + $text .= $p->t('urlaubstool/urlaubBis',array($fullNameVG)); $text .= "\n". "\n". $p->t('urlaubstool/sieKoennenDiesenUnterFolgenderAdresseEinsehen'); $text .= "\n". APP_ROOT . 'cis/private/profile/urlaubstool.php?uid='.$uid; @@ -174,7 +175,7 @@ if(isset($_GET['action']) && $_GET['action']=='freigabe') if($mail->send()) { - echo "".$p->t('urlaubstool/bestaetigungsmailWurdeVersandt',array($fullName)).""; + echo "".$p->t('urlaubstool/bestaetigungsmailWurdeVersandt',array($fullNameMA)).""; } From b1ce67ebd587a99d073a5d956ff4e49f7e12e079 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 1 Jul 2021 14:59:11 +0200 Subject: [PATCH 73/95] Infocenter fixed STG Typ --- application/views/system/infocenter/infocenterData.php | 2 +- .../views/system/infocenter/infocenterFreigegebenData.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index 5c0d7f105..0c7030059 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -3,7 +3,7 @@ $APP = '\'infocenter\''; $REJECTED_STATUS = '\'Abgewiesener\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'m\''; + $STUDIENGANG_TYP = '\'b\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\', \'Interessent rejected\''; $LOGDATA_NAME_PARKED = '\'Parked\''; diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 83e8c8916..3e14e7323 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -2,7 +2,7 @@ $APP = '\'infocenter\''; $INTERESSENT_STATUS = '\'Interessent\''; - $STUDIENGANG_TYP = '\'m\''; + $STUDIENGANG_TYP = '\'b\''; $TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\''; $LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\''; $REJECTED_STATUS = '\'Abgewiesener\''; From 2bef17d65b01f5c3b964e5069e0602363802d54d Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 1 Jul 2021 15:23:41 +0200 Subject: [PATCH 74/95] Update Phrasen Englisch und Codesniffer --- cis/private/profile/urlaubsfreigabe.php | 107 +++++++++++------------- locale/en-US/urlaubstool.php | 7 +- 2 files changed, 54 insertions(+), 60 deletions(-) diff --git a/cis/private/profile/urlaubsfreigabe.php b/cis/private/profile/urlaubsfreigabe.php index dde27d5fc..6d705a5b9 100644 --- a/cis/private/profile/urlaubsfreigabe.php +++ b/cis/private/profile/urlaubsfreigabe.php @@ -40,8 +40,7 @@ $p = new phrasen($sprache); if (!$db = new basis_db()) die('Fehler beim Oeffnen der Datenbankverbindung'); -//$user = get_uid(); -$user = 'ma0080'; +$user = get_uid(); $rechte = new benutzerberechtigung(); $rechte->getBerechtigungen($user); @@ -52,18 +51,16 @@ else { //Bis August das aktuelle Jahr anzeigen //Ab September das naechste - if(date('m')<9) + if (date('m') < 9) $year = date('Y'); else - $year = date('Y')+1; + $year = date('Y') + 1; } -if(isset($_GET['uid'])) - $uid=$_GET['uid']; +if (isset($_GET['uid'])) + $uid = $_GET['uid']; else - $uid=''; -echo "uid: " . $uid; - + $uid = ''; $datum_obj = new datum(); @@ -109,76 +106,74 @@ echo ' $mitarbeiter = new mitarbeiter(); $mitarbeiter->getUntergebene($user); -if(count($mitarbeiter->untergebene)==0 && !$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('mitarbeiter/urlaube', null, 'suid')) +if (count($mitarbeiter->untergebene) == 0 && !$rechte->isBerechtigt('admin') && !$rechte->isBerechtigt('mitarbeiter/urlaube', null, 'suid')) die('Es sind Ihnen keine Mitarbeiter zugeteilt für die sie den Urlaub freigeben dürfen'); $untergebene = ''; foreach ($mitarbeiter->untergebene as $row) { - if($untergebene!='') - $untergebene.=','; + if ($untergebene != '') + $untergebene .= ','; $untergebene .= $db->db_add_param($row); } -if($rechte->isBerechtigt('admin') || $rechte->isBerechtigt('mitarbeiter/urlaube', null, 'suid')) +if ($rechte->isBerechtigt('admin') || $rechte->isBerechtigt('mitarbeiter/urlaube', null, 'suid')) { - if($untergebene!='') - $untergebene.=','; + if ($untergebene != '') + $untergebene .= ','; $untergebene .= $db->db_add_param($uid); } $qry = "SELECT * FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) WHERE uid in($untergebene)"; $mitarbeiter = array(); -if($result = $db->db_query($qry)) +if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { - $mitarbeiter[$row->uid]['vorname']=$row->vorname; - $mitarbeiter[$row->uid]['nachname']=$row->nachname; - $mitarbeiter[$row->uid]['titelpre']=$row->titelpre; - $mitarbeiter[$row->uid]['titelpost']=$row->titelpost; + $mitarbeiter[$row->uid]['vorname'] = $row->vorname; + $mitarbeiter[$row->uid]['nachname'] = $row->nachname; + $mitarbeiter[$row->uid]['titelpre'] = $row->titelpre; + $mitarbeiter[$row->uid]['titelpost'] = $row->titelpost; } } -if($uid!='' && !isset($mitarbeiter[$uid]) && $uid!=$user && !$rechte->isBerechtigt('admin')) +if ($uid != '' && !isset($mitarbeiter[$uid]) && $uid != $user && !$rechte->isBerechtigt('admin')) die('Sie haben keine Berechtigung fuer diesen Mitarbeiter'); //Freigeben eines Urlaubes -if(isset($_GET['action']) && $_GET['action']=='freigabe') +if (isset($_GET['action']) && $_GET['action'] == 'freigabe') { $zeitsperre = new zeitsperre(); - if($zeitsperre->load($_GET['id'])) + if ($zeitsperre->load($_GET['id'])) { - if(isset($mitarbeiter[$zeitsperre->mitarbeiter_uid])) + if (isset($mitarbeiter[$zeitsperre->mitarbeiter_uid])) { $zeitsperre->freigabeamum = date('Y-m-d H:i:s'); $zeitsperre->freigabevon = $user; - if(!$zeitsperre->save(false)) + if (!$zeitsperre->save(false)) { echo "Fehler bei der Freigabe: $zeitsperre->errormsg"; } - //Bestätigungsmail an Mitarbeiter*in - $to = $uid . '@'.DOMAIN; + $to = $uid. '@'.DOMAIN; $person = new person(); $fullNameVG = $person->getFullNameFromBenutzer($user); $fullNameMA = $person->getFullNameFromBenutzer($uid); $from = 'noreply@'.DOMAIN; - $subject = $p->t('urlaubstool/urlaubsfreigabe') . date("d.m.Y", strtotime($zeitsperre->vondatum)). " " . $p->t('urlaubstool/bis'). " ". date("d.m.Y", strtotime($zeitsperre->bisdatum)); + $subject = $p->t('urlaubstool/urlaubsfreigabe'). date("d.m.Y", strtotime($zeitsperre->vondatum)). " ". + $p->t('urlaubstool/bis'). " ". date("d.m.Y", strtotime($zeitsperre->bisdatum)); $text = $p->t('urlaubstool/diesIstEineAutomatischeMail')."\n"; - $text .= $p->t('urlaubstool/urlaubVon')." ".date("d.m.Y", strtotime($zeitsperre->vondatum))." ".$p->t('urlaubstool/bis')." ".date("d.m.Y", strtotime($zeitsperre->bisdatum)); - $text .= $p->t('urlaubstool/urlaubBis',array($fullNameVG)); + $text .= $p->t('urlaubstool/urlaubVon')." ".date("d.m.Y", strtotime($zeitsperre->vondatum))." ". + $p->t('urlaubstool/bis')." ".date("d.m.Y", strtotime($zeitsperre->bisdatum)); + $text .= $p->t('urlaubstool/urlaubBis', array($fullNameVG)); $text .= "\n". "\n". $p->t('urlaubstool/sieKoennenDiesenUnterFolgenderAdresseEinsehen'); - $text .= "\n". APP_ROOT . 'cis/private/profile/urlaubstool.php?uid='.$uid; - + $text .= "\n". APP_ROOT. 'cis/private/profile/urlaubstool.php?uid='. $uid; $mail = new mail($to, $from, $subject, $text); - if($mail->send()) + if ($mail->send()) { - echo "".$p->t('urlaubstool/bestaetigungsmailWurdeVersandt',array($fullNameMA)).""; - + echo "".$p->t('urlaubstool/bestaetigungsmailWurdeVersandt', array($fullNameMA)).""; } - } else { @@ -189,40 +184,38 @@ if(isset($_GET['action']) && $_GET['action']=='freigabe') { echo 'Die Zeitsperre konnte nicht geladen werden'; } - } -//Monat zeichenen +//Monat zeichnen function draw_monat($monat) { global $untergebene, $mitarbeiter, $year, $datum_obj, $uid; - if (!$db = new basis_db()) - die('Fehler beim Oeffnen der Datenbankverbindung'); - + if (!$db = new basis_db()) + die('Fehler beim Oeffnen der Datenbankverbindung'); echo ''; echo '
'; - echo date('F',mktime(0,0,0,$monat,1,date('Y'))); - echo " ".($monat>8?$year-1:$year); + echo date('F', mktime(0,0,0,$monat,1,date('Y'))); + echo " ".($monat > 8?$year-1:$year); echo '
'; //Alle Anzeigen bei denen das von- oder bisdatum in dieses monat fallen $qry = "SELECT * FROM campus.tbl_zeitsperre WHERE zeitsperretyp_kurzbz='Urlaub' AND ( - (date_part('month', vondatum)='$monat' AND date_part('year', vondatum)='".($monat>8?$year-1:$year)."') + (date_part('month', vondatum)='$monat' AND date_part('year', vondatum)='".($monat > 8?$year - 1:$year)."') OR - (date_part('month', bisdatum)='$monat' AND date_part('year', bisdatum)='".($monat>8?$year-1:$year)."') + (date_part('month', bisdatum)='$monat' AND date_part('year', bisdatum)='".($monat > 8?$year - 1:$year)."') )"; - if($uid=='') - $qry.=" AND mitarbeiter_uid in($untergebene)"; + if($uid == '') + $qry.= " AND mitarbeiter_uid in($untergebene)"; else - $qry.=" AND mitarbeiter_uid=".$db->db_add_param($uid); + $qry.= " AND mitarbeiter_uid=". $db->db_add_param($uid); $qry.="ORDER BY vondatum, mitarbeiter_uid"; - if($result = $db->db_query($qry)) + if ($result = $db->db_query($qry)) { - while($row = $db->db_fetch_object($result)) + while ($row = $db->db_fetch_object($result)) { $vertretung = new benutzer($row->vertretung_uid); $freigabe=''; @@ -235,7 +228,7 @@ function draw_monat($monat) if ($vertretung->uid != '') echo ' (Vertretung: '.$vertretung->nachname.')'; if($row->freigabeamum=='') - echo " zeitsperre_id&year=$year&uid=$uid' class='Item'>Freigabe"; + echo " zeitsperre_id&year=$year&uid=$uid class='Item'>Freigabe"; echo ""; echo '
'; } @@ -244,7 +237,7 @@ function draw_monat($monat) } //Jahr mit Pfeilen zum blaettern anzeigen -if($uid!='') +if ($uid!='') { echo '"; @@ -269,16 +262,16 @@ echo '
'; //Tabelle mit den Monaten ausgeben echo '
'; echo "Alle Mitarbeiter anzeigen
'; $monat=9; -for($i=0;$i<12;$i++) +for($i = 0;$i < 12;$i++) { - if($i%3==0) + if ($i%3 == 0) { echo ''; } draw_monat($monat); $monat++; - if($monat>12) - $monat=1; + if ($monat > 12) + $monat = 1; } echo '
diff --git a/locale/en-US/urlaubstool.php b/locale/en-US/urlaubstool.php index d8c947947..697117c34 100644 --- a/locale/en-US/urlaubstool.php +++ b/locale/en-US/urlaubstool.php @@ -38,7 +38,8 @@ $this->phrasen['urlaubstool/freigabeansuchenUrlaub']='Freigabeansuchen Urlaub'; $this->phrasen['urlaubstool/freigabeFehlt']='Vacation has not been approved yet'; $this->phrasen['urlaubstool/urlaubsfreigabe']='Vacation approval: '; $this->phrasen['urlaubstool/bestaetigungsmailWurdeVersandt']='Confirmation mail to %s sent'; -$this->phrasen['urlaubstool/urlaubVon']='The requested vacation from'; -$this->phrasen['urlaubstool/urlaubBis']=' was approved by %s.'; -$this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseEinsehen']='Review your vacation here:'; +$this->phrasen['urlaubstool/urlaubVon']='Ihr angefragter Urlaub von'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll +$this->phrasen['urlaubstool/urlaubBis']=' wurde von %s freigegeben.'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll +$this->phrasen['urlaubstool/sieKoennenDiesenUnterFolgenderAdresseEinsehen']='Sie können diesen unter folgender Adresse einsehen:'; //Nur übersetzen, wenn die eMail in der eingestellten Sprache versandt werden soll + ?> From 752a891c6bb5153dade5747424616068649b4026 Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 1 Jul 2021 15:29:19 +0200 Subject: [PATCH 75/95] 13887 Freigabemail bei \"Alle Anzeigen\" --- cis/private/profile/urlaubsfreigabe.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cis/private/profile/urlaubsfreigabe.php b/cis/private/profile/urlaubsfreigabe.php index 6d705a5b9..384a3415d 100644 --- a/cis/private/profile/urlaubsfreigabe.php +++ b/cis/private/profile/urlaubsfreigabe.php @@ -228,7 +228,7 @@ function draw_monat($monat) if ($vertretung->uid != '') echo ' (Vertretung: '.$vertretung->nachname.')'; if($row->freigabeamum=='') - echo " zeitsperre_id&year=$year&uid=$uid class='Item'>Freigabe"; + echo " zeitsperre_id&year=$year&uid=$row->mitarbeiter_uid' class='Item'>Freigabe"; echo ""; echo '
'; } From 5d48b0aad049a0e0999e89489874241df4c1e828 Mon Sep 17 00:00:00 2001 From: manu Date: Fri, 2 Jul 2021 13:14:08 +0200 Subject: [PATCH 76/95] =?UTF-8?q?BT:=20neue=20zu=20akzeptierende=20Dokumen?= =?UTF-8?q?te,=20Studiengang=20als=20=C3=BCbergebener=20zgvma=5FOrt,=20Sty?= =?UTF-8?q?ling=20nicht=20verpflichtende=20Dokumente?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/dokument.class.php | 13 +++------ include/prestudent.class.php | 51 +++++++++++++++++++++++++++++++++--- 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/include/dokument.class.php b/include/dokument.class.php index 4d70891c0..6dec9a66d 100644 --- a/include/dokument.class.php +++ b/include/dokument.class.php @@ -1,5 +1,5 @@ db_add_param($dokument_kurzbz).")"; - //echo var_dump($qry); - //gibt ein Array von zu akzeptierenden Dokumenten zurück if ($db->db_query($qry)) { $num_rows = $db->db_num_rows(); - // Wenn kein ergebnis return 0 sonst ID + if ($num_rows > 0) { while ($row = $db->db_fetch_object()) { - //echo var_dump($row->prestudent_id); $arrayDoksZuAkzeptieren[] = $row->prestudent_id; } - //print_r($arrayDoksZuAkzeptieren); //für alle prestudent_ids das Dokument akzeptieren $qry = "INSERT INTO public.tbl_dokumentprestudent(dokument_kurzbz, prestudent_id) VALUES"; @@ -979,20 +975,17 @@ class dokument extends basis_db person_id = ".$this->db_add_param($person_id)." and dokument_kurzbz = ".$this->db_add_param($dokument_kurzbz); - // echo var_dump($qry); - //gibt ein Array von zu Entakzeptierenden Dokumenten zurück if ($db->db_query($qry)) { $num_rows = $db->db_num_rows(); - // Wenn kein ergebnis return 0 sonst ID + if ($num_rows > 0) { while ($row = $db->db_fetch_object()) { $arrayDoksZuEntakzeptieren[] = $row->prestudent_id; } - //print_r($arrayDoksZuEntakzeptieren); //für alle prestudent_ids das Dokument Entakzeptieren $qry = "DELETE FROM public.tbl_dokumentprestudent WHERE prestudent_id in ("; diff --git a/include/prestudent.class.php b/include/prestudent.class.php index 8e19927ff..0fe4a06e6 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -1,5 +1,5 @@ , - * Andreas Oesterreicher and - * Rudolf Hangl . + * Andreas Oesterreicher , + * Rudolf Hangl and + * Manuela Thamer . */ require_once(dirname(__FILE__).'/person.class.php'); require_once(dirname(__FILE__).'/log.class.php'); @@ -2408,4 +2409,48 @@ class prestudent extends person else return false; } + + + /** + * Liefert den wahrscheinlichen Studiengang der MasterZGV einer Person + * @param int $person_id ID der zu überprüfenden Person. + * @return string studiengangkurzbzlang + */ + public function getZGVMasterStg($person_id) + { + if (!is_numeric($person_id)) + { + $this->errormsg = 'Person_id muss eine gueltige Zahl sein'; + return false; + } + + $qry = "SELECT kurzbzlang + FROM public.tbl_prestudent + JOIN public.tbl_prestudentstatus USING (prestudent_id) + JOIN public.tbl_studiengang USING (studiengang_kz) + WHERE person_id = ".$this->db_add_param($person_id, FHC_INTEGER)." + AND status_kurzbz in ('Absolvent','Diplomand','Unterbrecher','Student') + AND typ in ('b','m','d') + ORDER BY status_kurzbz ASC + LIMIT 1;"; + + if ($this->db_query($qry)) + { + if ($row = $this->db_fetch_object()) + { + $stg = $row->kurzbzlang; + return $stg; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } } From 25124e035404d6d4580daca2dec54c20254dac38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 5 Jul 2021 18:13:37 +0200 Subject: [PATCH 77/95] Reduced amount of LDAP Requests when Loading CIS Menu --- cms/menu.inc.php | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/cms/menu.inc.php b/cms/menu.inc.php index 136187f70..7375ee849 100644 --- a/cms/menu.inc.php +++ b/cms/menu.inc.php @@ -19,7 +19,7 @@ */ /** * Dieses File enthaelt Hilfsklassen zur Anzeige des CMS-Menues - * + * * mit drawSubmenu($id) wird das enstprechende Menue gezeichnet. */ require_once(dirname(__FILE__).'/../include/functions.inc.php'); @@ -30,13 +30,14 @@ $params = array(); foreach($_REQUEST as $key=>$value) $params[$key]=$value; +$user = null; //Parameter fuer Include Addons $includeparams = array(); $contentobjects=array(); $chldsobject = array(); /** * Zeichnet einen Menueeintrag aus dem CMS System - * + * * @param $content_id */ function drawSubmenu($content_id) @@ -47,16 +48,16 @@ function drawSubmenu($content_id) global $contentobjects; $content = new content(); $sprache = getSprache(); - + // Daten Laden - + // Alle Kindelemente des Contents holen $ids = $content->getAllChilds($content_id); - // Alle vorkommenden Contenteintraege laden + // Alle vorkommenden Contenteintraege laden $content->loadArray($ids, $sprache, true); $contentobjects = $content->result; - + // Baumstruktur laden $childsobject = $content->getChildArray($content_id); @@ -91,7 +92,7 @@ function drawSubmenu1($content_id) drawEntry($contentobj); } } - + } } @@ -101,12 +102,13 @@ function drawSubmenu1($content_id) */ function drawEntry($item) { - global $childsobject; + global $childsobject, $user; //pruefen ob der Content eine Berechtigung erfordert if($item->locked) { - $user = get_uid(); + if(is_null($user)) + $user = get_uid(); $content = new content(); //wenn der User nicht berechtigt ist, dann wird der Eintrag nicht angezeigt if(!$content->berechtigt($item->content_id, $user)) @@ -139,7 +141,7 @@ function drawEntry($item) Redirect($item); else DrawLink(APP_ROOT.'cms/content.php?content_id='.$item->content_id,'content',$item->titel); - + echo ""; } } @@ -155,7 +157,7 @@ function DrawLink($link, $target, $name, $content_id=null, $open=null) { if($target=='') $target='content'; - + if($open) $class='class="selected"'; else @@ -167,7 +169,7 @@ function DrawLink($link, $target, $name, $content_id=null, $open=null) * Redirects sind Links Seiten ausserhalb des CMS * die URL kann Variablen enthalten. Diese werden hier ersetzt. * Danach wird der Link angezeigt. - * + * * @param $content_id ContentID des Redirects * @param $name Anzeigename des Links * @param $content_id_Submenu ID des Submenues das geoeffnet werden soll (optional) @@ -175,42 +177,42 @@ function DrawLink($link, $target, $name, $content_id=null, $open=null) function Redirect($content, $content_id_Submenu=null) { global $sprache, $params; - + $xml = new DOMDocument(); if($content->content!='') { $xml->loadXML($content->content); } - + if($xml->getElementsByTagName('url')->item(0)) $url = $xml->getElementsByTagName('url')->item(0)->nodeValue; else $url=''; - + //Variablen Ersetzen foreach($params as $key=>$value) { $url = str_replace('$'.$key,addslashes($value),$url); } - + if($xml->getElementsByTagName('target')->item(0)) $target = $xml->getElementsByTagName('target')->item(0)->nodeValue; else $target=''; - + DrawLink($url, $target, $content->titel, $content_id_Submenu, $content->menu_open); } /** - * Bei Content mit Include Templates wird + * Bei Content mit Include Templates wird * das entsprechende Menu-Addon geladen und inkludiert - * + * * @param $content_id */ function IncludeMenuAddon($content) { global $sprache, $includeparams; - + $xml = new DOMDocument(); if($content->content!='') { @@ -223,6 +225,6 @@ function IncludeMenuAddon($content) if($url!='') { $includeparams['content']=$content; - include(dirname(__FILE__).'/menu/'.$url); + include(dirname(__FILE__).'/menu/'.$url); } } From 0ee6485ece2841bf0065cfdfcda7db955f9f52c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Mon, 5 Jul 2021 18:18:20 +0200 Subject: [PATCH 78/95] Dependecy Update --- FHC-vendor/jquery-tablesorter/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FHC-vendor/jquery-tablesorter/package.json b/FHC-vendor/jquery-tablesorter/package.json index b16fcb45e..110042959 100644 --- a/FHC-vendor/jquery-tablesorter/package.json +++ b/FHC-vendor/jquery-tablesorter/package.json @@ -56,7 +56,7 @@ ] }, "devDependencies": { - "grunt": "^0.4.5", + "grunt": "^1.3.0", "grunt-cli": "~0.1.13", "grunt-contrib-clean": "^0.7.0", "grunt-contrib-concat": "^0.5.1", From cee615664605f1e18c8ca31264e97f8a372bcac0 Mon Sep 17 00:00:00 2001 From: KarpAlex Date: Wed, 7 Jul 2021 20:22:53 +0200 Subject: [PATCH 79/95] - added Bisioaufenthaltfoerderung_model.php - dbupdate_3.3.php: added Buchungstyp "ZuschussIO" --- .../codex/Bisioaufenthaltfoerderung_model.php | 15 +++++++++++++++ system/dbupdate_3.3.php | 13 +++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 application/models/codex/Bisioaufenthaltfoerderung_model.php diff --git a/application/models/codex/Bisioaufenthaltfoerderung_model.php b/application/models/codex/Bisioaufenthaltfoerderung_model.php new file mode 100644 index 000000000..7a817d67c --- /dev/null +++ b/application/models/codex/Bisioaufenthaltfoerderung_model.php @@ -0,0 +1,15 @@ +dbTable = 'bis.tbl_bisio_aufenthaltfoerderung'; + $this->pk = array('bisio_id', 'aufenthaltfoerderung_code'); + $this->hasSequence = false; + } +} diff --git a/system/dbupdate_3.3.php b/system/dbupdate_3.3.php index 407a4aa24..045170661 100644 --- a/system/dbupdate_3.3.php +++ b/system/dbupdate_3.3.php @@ -4781,6 +4781,19 @@ if ($result = $db->db_query("SELECT * FROM pg_class WHERE relname='idx_tbl_pruef } } +// Added Buchungstyp "ZuschussIO" +if ($result = @$db->db_query("SELECT 1 FROM public.tbl_buchungstyp WHERE buchungstyp_kurzbz = 'ZuschussIO';")) +{ + if ($db->db_num_rows($result) == 0) + { + $qry = "INSERT INTO public.tbl_buchungstyp (buchungstyp_kurzbz, beschreibung, standardtext) VALUES ('ZuschussIO', 'Zuschuss IO', 'Zuschuss Incoming Outgoing');"; + if (!$db->db_query($qry)) + echo 'public.tbl_buchungstyp '.$db->db_last_error().'
'; + else + echo ' public.tbl_buchungstyp: Added buchungstyp "ZuschussIO"
'; + } +} + // *** Pruefung und hinzufuegen der neuen Attribute und Tabellen echo '

Pruefe Tabellen und Attribute!

'; From 1c0de3ec451b49b8857396e835b1cc2256dde2cc Mon Sep 17 00:00:00 2001 From: cris-technikum Date: Thu, 8 Jul 2021 15:05:19 +0200 Subject: [PATCH 80/95] Fixed: Doppelte Tabellenanzeige in SanchoMail korrigiert Signed-off-by: cris-technikum --- application/controllers/jobs/LehrauftragJob.php | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/application/controllers/jobs/LehrauftragJob.php b/application/controllers/jobs/LehrauftragJob.php index 4ba327a2f..7f5754595 100644 --- a/application/controllers/jobs/LehrauftragJob.php +++ b/application/controllers/jobs/LehrauftragJob.php @@ -383,8 +383,8 @@ class LehrauftragJob extends JOB_Controller } // Else if UID exists else { - // Search if studiensemester exists - $ss_index = array_search($data['studiensemester_kurzbz'], array_column($mail_data_arr, 'studiensemester_kurzbz')); + // Search if studiensemester exists inside the existing UID array + $ss_index = array_search($data['studiensemester_kurzbz'], array_column($mail_data_arr[$uid_index], 'studiensemester_kurzbz')); // If studiensemester is new, add studiensemester to existing UID if ($ss_index === false) @@ -394,13 +394,6 @@ class LehrauftragJob extends JOB_Controller $data[$i] ); } - // Else if studiensemester exists - else - { - // Add corresponding data to existing studiensemester of UID - $mail_data_arr[$uid_index]['studiensemester_kurbz'][] = $data[$i]; - } - } } } From f16ea874dbd7c457e7d11c4842d8336d137bf146 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 8 Jul 2021 15:47:31 +0200 Subject: [PATCH 81/95] fragt bei den mails auch nun den studiengangtyp ab --- public/js/infocenter/infocenterDetails.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/public/js/infocenter/infocenterDetails.js b/public/js/infocenter/infocenterDetails.js index f5f435acb..70f5ed982 100644 --- a/public/js/infocenter/infocenterDetails.js +++ b/public/js/infocenter/infocenterDetails.js @@ -571,7 +571,8 @@ var InfocenterDetails = { { var fitstg = $.inArray(parseInt(prestudent.studiengang_kz), FIT_PROGRAMM_STUDIENGAENGE) >= 0; - if (receiverPrestudentstatus.studiensemester_kurzbz === prestudentstatus.studiensemester_kurzbz + if ((receiverPrestudentstatus.studiensemester_kurzbz === prestudentstatus.studiensemester_kurzbz) + && (receiverPrestudent.studiengangtyp === prestudent.studiengangtyp) && (prestudent.studiengangtyp === "b" || prestudent.studiengangtyp === "m" || fitstg)) { if (prestudent.isRtFreigegeben) @@ -596,7 +597,7 @@ var InfocenterDetails = { if (typeof receiverPrestudentstatus.bezeichnung_orgform_german === 'string') { - orgform_deutsch = receiverPrestudentstatus.bezeichnung_orgform_german.toLowerCase(); + orgform_deutsch = receiverPrestudentstatus.bezeichnung_orgform_german; } if (typeof receiverPrestudentstatus.bezeichnung_orgform_english === 'string') From 54593512af9345f38ce66af682b70dfdbdb92041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 8 Jul 2021 18:09:04 +0200 Subject: [PATCH 82/95] Added Sort for Loading of Notizen in Bewerbungstool --- include/notiz.class.php | 1237 ++++++++++++++++++++------------------- 1 file changed, 619 insertions(+), 618 deletions(-) diff --git a/include/notiz.class.php b/include/notiz.class.php index 459bdc6a6..5d237e2b8 100644 --- a/include/notiz.class.php +++ b/include/notiz.class.php @@ -1,618 +1,619 @@ - and - */ -require_once(dirname(__FILE__).'/basis_db.class.php'); -require_once(dirname(__FILE__).'/dms.class.php'); - -class notiz extends basis_db -{ - public $new; - public $result=array(); - public $dokumente=array(); - - //Tabellenspalten - public $notiz_id; - public $titel; - public $text; - public $verfasser_uid; - public $bearbeiter_uid; - public $start; - public $ende; - public $erledigt; - public $insertamum; - public $insertvon; - public $updateamum; - public $updatevon; - - public $projekt_kurzbz; - public $projektphase_id; - public $projekttask_id; - public $uid; - public $person_id; - public $prestudent_id; - public $bestellung_id; - public $lehreinheit_id; - public $anrechnung_id; - - /** - * Konstruktor - * @param $notiz_id - */ - public function __construct($notiz_id = null) - { - parent::__construct(); - - if($notiz_id != null) - $this->load($notiz_id); - } - - /** - * Laedt eine Notiz - * @param $notiz_id - * @return true wenn ok, false im Fehlerfall - */ - public function load($notiz_id) - { - if(!is_numeric($notiz_id)) - { - $this->errormsg = 'NotizID ist ungueltig'; - return false; - } - - $qry = "SELECT * FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); - - if($this->db_query($qry)) - { - if($row = $this->db_fetch_object()) - { - $this->notiz_id=$row->notiz_id; - $this->titel=$row->titel; - $this->text=$row->text; - $this->verfasser_uid=$row->verfasser_uid; - $this->bearbeiter_uid=$row->bearbeiter_uid; - $this->start=$row->start; - $this->ende=$row->ende; - $this->erledigt=$this->db_parse_bool($row->erledigt); - $this->insertamum=$row->insertamum; - $this->insertvon=$row->insertvon; - $this->updateamum=$row->updateamum; - $this->updatevon=$row->updatevon; - $this->getDokumente($row->notiz_id); - - return true; - } - else - { - $this->errormsg = 'Datensatz wurde nicht gefunden'; - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Löscht eine Notiz - * @param $notiz_id - * @return true wenn ok, false im Fehlerfall - */ - public function delete($notiz_id) - { - if(!is_numeric($notiz_id)) - { - $this->errormsg = 'NotizID ist ungueltig'; - return false; - } - - // Dokumente der Notiz löschen - $this->getDokumente($notiz_id); - if(!empty($this->dokumente)) - { - $dms = new dms(); - - foreach($this->dokumente as $dms_id) - { - $dms->deleteDms($dms_id); - } - } - - $qry = "Delete FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); - - if(!$this->db_query($qry)) - { - $this->errormsg = 'Fehler beim Loeschen der Daten'; - return false; - } - return true; - } - - /** - * Prueft die Daten vor dem Speichern - * auf Gueltigkeit - */ - public function validate() - { - return true; - } - - /** - * Speichert den aktuellen Datensatz in die Datenbank - * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt - * andernfalls wird der Datensatz mit der ID in $notiz_id aktualisiert - * @return true wenn ok, false im Fehlerfall - */ - public function save($new=null) - { - if($new==null) - $new=$this->new; - - if(!$this->validate()) - return false; - - if($new) - { - //Neuen Datensatz einfuegen - $qry='BEGIN;INSERT INTO public.tbl_notiz (titel, text, verfasser_uid, - bearbeiter_uid, start, ende, erledigt, insertamum, insertvon, - updateamum, updatevon) VALUES('. - $this->db_add_param($this->titel).', '. - $this->db_add_param($this->text).', '. - $this->db_add_param($this->verfasser_uid).','. - $this->db_add_param($this->bearbeiter_uid).','. - $this->db_add_param($this->start).','. - $this->db_add_param($this->ende).','. - $this->db_add_param($this->erledigt,FHC_BOOLEAN).','. - $this->db_add_param($this->insertamum).','. - $this->db_add_param($this->insertvon).','. - $this->db_add_param($this->updateamum).','. - $this->db_add_param($this->updatevon).');'; - } - else - { - $qry='UPDATE public.tbl_notiz SET '. - 'titel='.$this->db_add_param($this->titel).', '. - 'text='.$this->db_add_param($this->text).', '. - 'verfasser_uid='.$this->db_add_param($this->verfasser_uid).', '. - 'bearbeiter_uid='.$this->db_add_param($this->bearbeiter_uid).', '. - 'start='.$this->db_add_param($this->start).', '. - 'ende='.$this->db_add_param($this->ende).', '. - 'erledigt='.$this->db_add_param($this->erledigt,FHC_BOOLEAN).', '. - 'updateamum='.$this->db_add_param($this->updateamum).', '. - 'updatevon='.$this->db_add_param($this->updatevon).' '. - 'WHERE notiz_id='.$this->db_add_param($this->notiz_id,FHC_INTEGER).';'; - } - - if($this->db_query($qry)) - { - if($new) - { - $qry="SELECT currval('seq_notiz_notiz_id') as id;"; - if($result = $this->db_query($qry)) - { - if($row = $this->db_fetch_object($result)) - { - $this->notiz_id = $row->id; - $this->db_query('COMMIT;'); - return true; - } - else - { - $this->errormsg = 'Fehler beim Lesen der Sequence'; - $this->db_query('ROLLBACK'); - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Lesen der Sequence'; - $this->db_query('ROLLBACK'); - return false; - } - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Speichern des Datensatzes'; - return false; - } - } - - /** - * Speichert die Zuordnung einer Notiz - * - */ - public function saveZuordnung() - { - $qry = "INSERT INTO public.tbl_notizzuordnung(notiz_id, projekt_kurzbz, projektphase_id, projekttask_id, - uid, person_id, prestudent_id, bestellung_id, lehreinheit_id, anrechnung_id) VALUES(". - $this->db_add_param($this->notiz_id, FHC_INTEGER).','. - $this->db_add_param($this->projekt_kurzbz).','. - $this->db_add_param($this->projektphase_id, FHC_INTEGER).','. - $this->db_add_param($this->projekttask_id, FHC_INTEGER).','. - $this->db_add_param($this->uid).','. - $this->db_add_param($this->person_id, FHC_INTEGER).','. - $this->db_add_param($this->prestudent_id, FHC_INTEGER).','. - $this->db_add_param($this->bestellung_id, FHC_INTEGER).','. - $this->db_add_param($this->lehreinheit_id, FHC_INTEGER).','. - $this->db_add_param($this->anrechnung_id, FHC_INTEGER).');'; - - if($this->db_query($qry)) - { - return true; - } - else - { - $this->errormsg = 'Fehler beim Speichern der Daten'; - return false; - } - } - - /** - * Speichert ein Dokument zur Notiz - * @param int $dms_id - * @return boolean - */ - public function saveDokument($dms_id) - { - $qry = "INSERT INTO public.tbl_notiz_dokument(notiz_id, dms_id) VALUES(". - $this->db_add_param($this->notiz_id, FHC_INTEGER).','. - $this->db_add_param($dms_id, FHC_INTEGER).');'; - - if($this->db_query($qry)) - { - return true; - } - else - { - $this->errormsg = 'Fehler beim Speichern der Daten'; - return false; - } - } - - /** - * - * Laedt die Notizen - * @param $erledigt - * @param $projekt_kurzbz - * @param $projektphase_id - * @param $projekttask_id - * @param $uid - * @param $person_id - * @param $prestudent_id - * @param $bestellung_id - * @param $user - * @param $lehreinheit_id - * @param $anrechnung_id - * @return boolean - */ - public function getNotiz( - $erledigt=null, - $projekt_kurzbz=null, - $projektphase_id=null, - $projekttask_id=null, - $uid=null, - $person_id=null, - $prestudent_id=null, - $bestellung_id=null, - $user=null, - $lehreinheit_id=null, - $stundenplandev_id=null, - $anrechnung_id=null, - $titel=null) - { - $qry = "SELECT - * - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE 1=1"; - - if(!is_null($erledigt)) - { - if($erledigt) - $qry.=" AND erledigt=true"; - else - $qry.=" AND erledigt=false"; - } - if($projekt_kurzbz!='') - $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); - if($projektphase_id!='') - $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); - if($projekttask_id!='') - $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); - if($uid!='') - $qry.=" AND uid=".$this->db_add_param($uid); - if($person_id!='') - $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); - if($prestudent_id!='') - $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); - if($bestellung_id!='') - $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); - if($user!='') - $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; - if($lehreinheit_id!='') - $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); - if($anrechnung_id!='') - $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); - if($titel!='') - $qry.=" AND titel=".$this->db_add_param($titel); - - $qry.=' ORDER BY start, ende, titel'; - - if($result = $this->db_query($qry)) - { - while($row = $this->db_fetch_object($result)) - { - $obj = new notiz(); - - $obj->notiz_id=$row->notiz_id; - $obj->titel=$row->titel; - $obj->text=$row->text; - $obj->verfasser_uid=$row->verfasser_uid; - $obj->bearbeiter_uid=$row->bearbeiter_uid; - $obj->start=$row->start; - $obj->ende=$row->ende; - $obj->erledigt=$this->db_parse_bool($row->erledigt); - $obj->insertamum=$row->insertamum; - $obj->insertvon=$row->insertvon; - $obj->updateamum=$row->updateamum; - $obj->updatevon=$row->updatevon; - $obj->getDokumente($row->notiz_id); - - $this->result[] = $obj; - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * - * Laedt die Notizen vom Bewerbungstool - * @param integer $person_id - * @param integer $prestudent_id - * @return boolean - */ - public function getBewerbungstoolNotizen($person_id, $prestudent_id = null) - { - $qry = "SELECT - * - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE (insertvon = 'online' OR insertvon = 'online_notiz') - AND person_id = ".$this->db_add_param($person_id, FHC_INTEGER); - if ($prestudent_id != '') - { - $qry .= " AND prestudent_id = ".$this->db_add_param($prestudent_id, FHC_INTEGER); - } - - $qry .= " ORDER BY notiz_id"; - - if($result = $this->db_query($qry)) - { - while($row = $this->db_fetch_object($result)) - { - $obj = new notiz(); - - $obj->notiz_id=$row->notiz_id; - $obj->titel=$row->titel; - $obj->text=$row->text; - $obj->verfasser_uid=$row->verfasser_uid; - $obj->bearbeiter_uid=$row->bearbeiter_uid; - $obj->start=$row->start; - $obj->ende=$row->ende; - $obj->erledigt=$this->db_parse_bool($row->erledigt); - $obj->insertamum=$row->insertamum; - $obj->insertvon=$row->insertvon; - $obj->updateamum=$row->updateamum; - $obj->updatevon=$row->updatevon; - - $this->result[] = $obj; - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - - /** - * TEMPORARY: kurzfristig wird für das Onlinebewerbungstool die Ausbildung - * (Name und Adresse der besuchten Schule) in eine Notiz mit - * insertvon = online_ausbildung gespeichert. - * Wird auf UDF umgebaut! - * - * Laedt die Notizen zur Ausbilund vom Bewerbungstool - * @param $person_id int - * @return boolean - */ - public function getBewerbungstoolNotizenAusbildung($person_id) - { - $qry = 'SELECT - * - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE person_id = ' . $this->db_add_param($person_id, FHC_INTEGER) . - ' AND insertvon = ' . $this->db_add_param('online_ausbildung') . - ' ORDER BY notiz_id'; - - if($result = $this->db_query($qry)) - { - while($row = $this->db_fetch_object($result)) - { - $obj = new notiz(); - - $obj->notiz_id=$row->notiz_id; - $obj->titel=$row->titel; - $obj->text=$row->text; - $obj->verfasser_uid=$row->verfasser_uid; - $obj->bearbeiter_uid=$row->bearbeiter_uid; - $obj->start=$row->start; - $obj->ende=$row->ende; - $obj->erledigt=$this->db_parse_bool($row->erledigt); - $obj->insertamum=$row->insertamum; - $obj->insertvon=$row->insertvon; - $obj->updateamum=$row->updateamum; - $obj->updatevon=$row->updatevon; - - $this->result[] = $obj; - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - - - /** - - * - - * Laedt die Notizen - * @param $erledigt - * @param $projekt_kurzbz - * @param $projektphase_id - * @param $projekttask_id - * @param $uid - * @param $person_id - * @param $prestudent_id - * @param $bestellung_id - * @param $user - * @param $lehreinheit_id - * @param $anrechnung_id - * @return boolean - */ - public function getAnzahlNotizen($erledigt=null, $projekt_kurzbz=null, $projektphase_id=null, $projekttask_id=null, $uid=null, $person_id=null, $prestudent_id=null, $bestellung_id=null, $user=null, $lehreinheit_id=null, $anrechnung_id=null) - { - $qry = "SELECT - count(*) as anzahl - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE 1=1"; - - if(!is_null($erledigt)) - { - if($erledigt) - $qry.=" AND erledigt=true"; - else - $qry.=" AND erledigt=false"; - } - if($projekt_kurzbz!='') - $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); - if($projektphase_id!='') - $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); - if($projekttask_id!='') - $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); - if($uid!='') - $qry.=" AND uid=".$this->db_add_param($uid); - if($person_id!='') - $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); - if($prestudent_id!='') - $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); - if($bestellung_id!='') - $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); - if($user!='') - $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; - if($lehreinheit_id!='') - $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); - if($anrechnung_id!='') - $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); - - if($result = $this->db_query($qry)) - { - if($row = $this->db_fetch_object($result)) - return $row->anzahl; - else - { - $this->errormsg='Fehler beim Laden der Daten'; - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Laedt die Dokumente der Notiz - * @return boolean - */ - public function getDokumente($notiz_id) - { - $qry = "SELECT dms_id FROM public.tbl_notiz_dokument WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); - - if($this->db_query($qry)) - { - while($row = $this->db_fetch_object()) - { - $this->dokumente[] = $row->dms_id; - } - - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Prueft ob das Dokument an einer Notiz haengt - * @param $dms_id DMS id des Dokuments. - * @return boolean true wenn das Dokument an einer Notiz hängt, sonst false. - */ - public function isNotizDokument($dms_id) - { - $qry = "SELECT * FROM public.tbl_notiz_dokument WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER); - - if($result = $this->db_query($qry)) - { - if($this->db_num_rows($result)>0) - return true; - else - return false; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } -} + and + */ +require_once(dirname(__FILE__).'/basis_db.class.php'); +require_once(dirname(__FILE__).'/dms.class.php'); + +class notiz extends basis_db +{ + public $new; + public $result=array(); + public $dokumente=array(); + + //Tabellenspalten + public $notiz_id; + public $titel; + public $text; + public $verfasser_uid; + public $bearbeiter_uid; + public $start; + public $ende; + public $erledigt; + public $insertamum; + public $insertvon; + public $updateamum; + public $updatevon; + + public $projekt_kurzbz; + public $projektphase_id; + public $projekttask_id; + public $uid; + public $person_id; + public $prestudent_id; + public $bestellung_id; + public $lehreinheit_id; + public $anrechnung_id; + + /** + * Konstruktor + * @param $notiz_id + */ + public function __construct($notiz_id = null) + { + parent::__construct(); + + if($notiz_id != null) + $this->load($notiz_id); + } + + /** + * Laedt eine Notiz + * @param $notiz_id + * @return true wenn ok, false im Fehlerfall + */ + public function load($notiz_id) + { + if(!is_numeric($notiz_id)) + { + $this->errormsg = 'NotizID ist ungueltig'; + return false; + } + + $qry = "SELECT * FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); + + if($this->db_query($qry)) + { + if($row = $this->db_fetch_object()) + { + $this->notiz_id=$row->notiz_id; + $this->titel=$row->titel; + $this->text=$row->text; + $this->verfasser_uid=$row->verfasser_uid; + $this->bearbeiter_uid=$row->bearbeiter_uid; + $this->start=$row->start; + $this->ende=$row->ende; + $this->erledigt=$this->db_parse_bool($row->erledigt); + $this->insertamum=$row->insertamum; + $this->insertvon=$row->insertvon; + $this->updateamum=$row->updateamum; + $this->updatevon=$row->updatevon; + $this->getDokumente($row->notiz_id); + + return true; + } + else + { + $this->errormsg = 'Datensatz wurde nicht gefunden'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Löscht eine Notiz + * @param $notiz_id + * @return true wenn ok, false im Fehlerfall + */ + public function delete($notiz_id) + { + if(!is_numeric($notiz_id)) + { + $this->errormsg = 'NotizID ist ungueltig'; + return false; + } + + // Dokumente der Notiz löschen + $this->getDokumente($notiz_id); + if(!empty($this->dokumente)) + { + $dms = new dms(); + + foreach($this->dokumente as $dms_id) + { + $dms->deleteDms($dms_id); + } + } + + $qry = "Delete FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); + + if(!$this->db_query($qry)) + { + $this->errormsg = 'Fehler beim Loeschen der Daten'; + return false; + } + return true; + } + + /** + * Prueft die Daten vor dem Speichern + * auf Gueltigkeit + */ + public function validate() + { + return true; + } + + /** + * Speichert den aktuellen Datensatz in die Datenbank + * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt + * andernfalls wird der Datensatz mit der ID in $notiz_id aktualisiert + * @return true wenn ok, false im Fehlerfall + */ + public function save($new=null) + { + if($new==null) + $new=$this->new; + + if(!$this->validate()) + return false; + + if($new) + { + //Neuen Datensatz einfuegen + $qry='BEGIN;INSERT INTO public.tbl_notiz (titel, text, verfasser_uid, + bearbeiter_uid, start, ende, erledigt, insertamum, insertvon, + updateamum, updatevon) VALUES('. + $this->db_add_param($this->titel).', '. + $this->db_add_param($this->text).', '. + $this->db_add_param($this->verfasser_uid).','. + $this->db_add_param($this->bearbeiter_uid).','. + $this->db_add_param($this->start).','. + $this->db_add_param($this->ende).','. + $this->db_add_param($this->erledigt,FHC_BOOLEAN).','. + $this->db_add_param($this->insertamum).','. + $this->db_add_param($this->insertvon).','. + $this->db_add_param($this->updateamum).','. + $this->db_add_param($this->updatevon).');'; + } + else + { + $qry='UPDATE public.tbl_notiz SET '. + 'titel='.$this->db_add_param($this->titel).', '. + 'text='.$this->db_add_param($this->text).', '. + 'verfasser_uid='.$this->db_add_param($this->verfasser_uid).', '. + 'bearbeiter_uid='.$this->db_add_param($this->bearbeiter_uid).', '. + 'start='.$this->db_add_param($this->start).', '. + 'ende='.$this->db_add_param($this->ende).', '. + 'erledigt='.$this->db_add_param($this->erledigt,FHC_BOOLEAN).', '. + 'updateamum='.$this->db_add_param($this->updateamum).', '. + 'updatevon='.$this->db_add_param($this->updatevon).' '. + 'WHERE notiz_id='.$this->db_add_param($this->notiz_id,FHC_INTEGER).';'; + } + + if($this->db_query($qry)) + { + if($new) + { + $qry="SELECT currval('seq_notiz_notiz_id') as id;"; + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + { + $this->notiz_id = $row->id; + $this->db_query('COMMIT;'); + return true; + } + else + { + $this->errormsg = 'Fehler beim Lesen der Sequence'; + $this->db_query('ROLLBACK'); + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Lesen der Sequence'; + $this->db_query('ROLLBACK'); + return false; + } + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern des Datensatzes'; + return false; + } + } + + /** + * Speichert die Zuordnung einer Notiz + * + */ + public function saveZuordnung() + { + $qry = "INSERT INTO public.tbl_notizzuordnung(notiz_id, projekt_kurzbz, projektphase_id, projekttask_id, + uid, person_id, prestudent_id, bestellung_id, lehreinheit_id, anrechnung_id) VALUES(". + $this->db_add_param($this->notiz_id, FHC_INTEGER).','. + $this->db_add_param($this->projekt_kurzbz).','. + $this->db_add_param($this->projektphase_id, FHC_INTEGER).','. + $this->db_add_param($this->projekttask_id, FHC_INTEGER).','. + $this->db_add_param($this->uid).','. + $this->db_add_param($this->person_id, FHC_INTEGER).','. + $this->db_add_param($this->prestudent_id, FHC_INTEGER).','. + $this->db_add_param($this->bestellung_id, FHC_INTEGER).','. + $this->db_add_param($this->lehreinheit_id, FHC_INTEGER).','. + $this->db_add_param($this->anrechnung_id, FHC_INTEGER).');'; + + if($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern der Daten'; + return false; + } + } + + /** + * Speichert ein Dokument zur Notiz + * @param int $dms_id + * @return boolean + */ + public function saveDokument($dms_id) + { + $qry = "INSERT INTO public.tbl_notiz_dokument(notiz_id, dms_id) VALUES(". + $this->db_add_param($this->notiz_id, FHC_INTEGER).','. + $this->db_add_param($dms_id, FHC_INTEGER).');'; + + if($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern der Daten'; + return false; + } + } + + /** + * + * Laedt die Notizen + * @param $erledigt + * @param $projekt_kurzbz + * @param $projektphase_id + * @param $projekttask_id + * @param $uid + * @param $person_id + * @param $prestudent_id + * @param $bestellung_id + * @param $user + * @param $lehreinheit_id + * @param $anrechnung_id + * @return boolean + */ + public function getNotiz( + $erledigt=null, + $projekt_kurzbz=null, + $projektphase_id=null, + $projekttask_id=null, + $uid=null, + $person_id=null, + $prestudent_id=null, + $bestellung_id=null, + $user=null, + $lehreinheit_id=null, + $stundenplandev_id=null, + $anrechnung_id=null, + $titel=null) + { + $qry = "SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE 1=1"; + + if(!is_null($erledigt)) + { + if($erledigt) + $qry.=" AND erledigt=true"; + else + $qry.=" AND erledigt=false"; + } + if($projekt_kurzbz!='') + $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); + if($projektphase_id!='') + $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); + if($projekttask_id!='') + $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); + if($uid!='') + $qry.=" AND uid=".$this->db_add_param($uid); + if($person_id!='') + $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); + if($prestudent_id!='') + $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); + if($bestellung_id!='') + $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); + if($user!='') + $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; + if($lehreinheit_id!='') + $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); + if($anrechnung_id!='') + $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); + if($titel!='') + $qry.=" AND titel=".$this->db_add_param($titel); + + $qry.=' ORDER BY start, ende, titel'; + + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $obj = new notiz(); + + $obj->notiz_id=$row->notiz_id; + $obj->titel=$row->titel; + $obj->text=$row->text; + $obj->verfasser_uid=$row->verfasser_uid; + $obj->bearbeiter_uid=$row->bearbeiter_uid; + $obj->start=$row->start; + $obj->ende=$row->ende; + $obj->erledigt=$this->db_parse_bool($row->erledigt); + $obj->insertamum=$row->insertamum; + $obj->insertvon=$row->insertvon; + $obj->updateamum=$row->updateamum; + $obj->updatevon=$row->updatevon; + $obj->getDokumente($row->notiz_id); + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * + * Laedt die Notizen vom Bewerbungstool + * @param integer $person_id + * @param integer $prestudent_id + * @param string $order Sorting order. Default: "notiz_id" + * @return boolean + */ + public function getBewerbungstoolNotizen($person_id, $prestudent_id = null, $order = 'notiz_id') + { + $qry = "SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE (insertvon = 'online' OR insertvon = 'online_notiz') + AND person_id = ".$this->db_add_param($person_id, FHC_INTEGER); + if ($prestudent_id != '') + { + $qry .= " AND prestudent_id = ".$this->db_add_param($prestudent_id, FHC_INTEGER); + } + + $qry .= " ORDER BY ".$order; + + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $obj = new notiz(); + + $obj->notiz_id=$row->notiz_id; + $obj->titel=$row->titel; + $obj->text=$row->text; + $obj->verfasser_uid=$row->verfasser_uid; + $obj->bearbeiter_uid=$row->bearbeiter_uid; + $obj->start=$row->start; + $obj->ende=$row->ende; + $obj->erledigt=$this->db_parse_bool($row->erledigt); + $obj->insertamum=$row->insertamum; + $obj->insertvon=$row->insertvon; + $obj->updateamum=$row->updateamum; + $obj->updatevon=$row->updatevon; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + + /** + * TEMPORARY: kurzfristig wird für das Onlinebewerbungstool die Ausbildung + * (Name und Adresse der besuchten Schule) in eine Notiz mit + * insertvon = online_ausbildung gespeichert. + * Wird auf UDF umgebaut! + * + * Laedt die Notizen zur Ausbilund vom Bewerbungstool + * @param $person_id int + * @return boolean + */ + public function getBewerbungstoolNotizenAusbildung($person_id) + { + $qry = 'SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE person_id = ' . $this->db_add_param($person_id, FHC_INTEGER) . + ' AND insertvon = ' . $this->db_add_param('online_ausbildung') . + ' ORDER BY notiz_id'; + + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $obj = new notiz(); + + $obj->notiz_id=$row->notiz_id; + $obj->titel=$row->titel; + $obj->text=$row->text; + $obj->verfasser_uid=$row->verfasser_uid; + $obj->bearbeiter_uid=$row->bearbeiter_uid; + $obj->start=$row->start; + $obj->ende=$row->ende; + $obj->erledigt=$this->db_parse_bool($row->erledigt); + $obj->insertamum=$row->insertamum; + $obj->insertvon=$row->insertvon; + $obj->updateamum=$row->updateamum; + $obj->updatevon=$row->updatevon; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + + + /** + + * + + * Laedt die Notizen + * @param $erledigt + * @param $projekt_kurzbz + * @param $projektphase_id + * @param $projekttask_id + * @param $uid + * @param $person_id + * @param $prestudent_id + * @param $bestellung_id + * @param $user + * @param $lehreinheit_id + * @param $anrechnung_id + * @return boolean + */ + public function getAnzahlNotizen($erledigt=null, $projekt_kurzbz=null, $projektphase_id=null, $projekttask_id=null, $uid=null, $person_id=null, $prestudent_id=null, $bestellung_id=null, $user=null, $lehreinheit_id=null, $anrechnung_id=null) + { + $qry = "SELECT + count(*) as anzahl + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE 1=1"; + + if(!is_null($erledigt)) + { + if($erledigt) + $qry.=" AND erledigt=true"; + else + $qry.=" AND erledigt=false"; + } + if($projekt_kurzbz!='') + $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); + if($projektphase_id!='') + $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); + if($projekttask_id!='') + $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); + if($uid!='') + $qry.=" AND uid=".$this->db_add_param($uid); + if($person_id!='') + $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); + if($prestudent_id!='') + $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); + if($bestellung_id!='') + $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); + if($user!='') + $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; + if($lehreinheit_id!='') + $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); + if($anrechnung_id!='') + $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); + + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + return $row->anzahl; + else + { + $this->errormsg='Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Laedt die Dokumente der Notiz + * @return boolean + */ + public function getDokumente($notiz_id) + { + $qry = "SELECT dms_id FROM public.tbl_notiz_dokument WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $this->dokumente[] = $row->dms_id; + } + + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Prueft ob das Dokument an einer Notiz haengt + * @param $dms_id DMS id des Dokuments. + * @return boolean true wenn das Dokument an einer Notiz hängt, sonst false. + */ + public function isNotizDokument($dms_id) + { + $qry = "SELECT * FROM public.tbl_notiz_dokument WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER); + + if($result = $this->db_query($qry)) + { + if($this->db_num_rows($result)>0) + return true; + else + return false; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } +} From a10cacaf4b83f2630561b5a6ee9a93b14da979ef Mon Sep 17 00:00:00 2001 From: manu Date: Fri, 9 Jul 2021 08:28:26 +0200 Subject: [PATCH 83/95] =?UTF-8?q?Anzeige=20j=C3=BCngster=20Eintrag=20Beruf?= =?UTF-8?q?st=C3=A4tigkeit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/notiz.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/notiz.class.php b/include/notiz.class.php index 459bdc6a6..e1d9e9006 100644 --- a/include/notiz.class.php +++ b/include/notiz.class.php @@ -411,7 +411,7 @@ class notiz extends basis_db $qry .= " AND prestudent_id = ".$this->db_add_param($prestudent_id, FHC_INTEGER); } - $qry .= " ORDER BY notiz_id"; + $qry .= " ORDER BY notiz_id DESC"; if($result = $this->db_query($qry)) { From bd153921c6df8ab90ce479b8da8bc7076186a9e6 Mon Sep 17 00:00:00 2001 From: manu Date: Fri, 9 Jul 2021 11:09:43 +0200 Subject: [PATCH 84/95] =?UTF-8?q?13989=20Merge=20=C3=84nderungen=20Berufst?= =?UTF-8?q?=C3=A4tigkeit=20master?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/notiz.class.php | 1237 ++++++++++++++++++++------------------- 1 file changed, 619 insertions(+), 618 deletions(-) diff --git a/include/notiz.class.php b/include/notiz.class.php index e1d9e9006..5d237e2b8 100644 --- a/include/notiz.class.php +++ b/include/notiz.class.php @@ -1,618 +1,619 @@ - and - */ -require_once(dirname(__FILE__).'/basis_db.class.php'); -require_once(dirname(__FILE__).'/dms.class.php'); - -class notiz extends basis_db -{ - public $new; - public $result=array(); - public $dokumente=array(); - - //Tabellenspalten - public $notiz_id; - public $titel; - public $text; - public $verfasser_uid; - public $bearbeiter_uid; - public $start; - public $ende; - public $erledigt; - public $insertamum; - public $insertvon; - public $updateamum; - public $updatevon; - - public $projekt_kurzbz; - public $projektphase_id; - public $projekttask_id; - public $uid; - public $person_id; - public $prestudent_id; - public $bestellung_id; - public $lehreinheit_id; - public $anrechnung_id; - - /** - * Konstruktor - * @param $notiz_id - */ - public function __construct($notiz_id = null) - { - parent::__construct(); - - if($notiz_id != null) - $this->load($notiz_id); - } - - /** - * Laedt eine Notiz - * @param $notiz_id - * @return true wenn ok, false im Fehlerfall - */ - public function load($notiz_id) - { - if(!is_numeric($notiz_id)) - { - $this->errormsg = 'NotizID ist ungueltig'; - return false; - } - - $qry = "SELECT * FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); - - if($this->db_query($qry)) - { - if($row = $this->db_fetch_object()) - { - $this->notiz_id=$row->notiz_id; - $this->titel=$row->titel; - $this->text=$row->text; - $this->verfasser_uid=$row->verfasser_uid; - $this->bearbeiter_uid=$row->bearbeiter_uid; - $this->start=$row->start; - $this->ende=$row->ende; - $this->erledigt=$this->db_parse_bool($row->erledigt); - $this->insertamum=$row->insertamum; - $this->insertvon=$row->insertvon; - $this->updateamum=$row->updateamum; - $this->updatevon=$row->updatevon; - $this->getDokumente($row->notiz_id); - - return true; - } - else - { - $this->errormsg = 'Datensatz wurde nicht gefunden'; - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Löscht eine Notiz - * @param $notiz_id - * @return true wenn ok, false im Fehlerfall - */ - public function delete($notiz_id) - { - if(!is_numeric($notiz_id)) - { - $this->errormsg = 'NotizID ist ungueltig'; - return false; - } - - // Dokumente der Notiz löschen - $this->getDokumente($notiz_id); - if(!empty($this->dokumente)) - { - $dms = new dms(); - - foreach($this->dokumente as $dms_id) - { - $dms->deleteDms($dms_id); - } - } - - $qry = "Delete FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); - - if(!$this->db_query($qry)) - { - $this->errormsg = 'Fehler beim Loeschen der Daten'; - return false; - } - return true; - } - - /** - * Prueft die Daten vor dem Speichern - * auf Gueltigkeit - */ - public function validate() - { - return true; - } - - /** - * Speichert den aktuellen Datensatz in die Datenbank - * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt - * andernfalls wird der Datensatz mit der ID in $notiz_id aktualisiert - * @return true wenn ok, false im Fehlerfall - */ - public function save($new=null) - { - if($new==null) - $new=$this->new; - - if(!$this->validate()) - return false; - - if($new) - { - //Neuen Datensatz einfuegen - $qry='BEGIN;INSERT INTO public.tbl_notiz (titel, text, verfasser_uid, - bearbeiter_uid, start, ende, erledigt, insertamum, insertvon, - updateamum, updatevon) VALUES('. - $this->db_add_param($this->titel).', '. - $this->db_add_param($this->text).', '. - $this->db_add_param($this->verfasser_uid).','. - $this->db_add_param($this->bearbeiter_uid).','. - $this->db_add_param($this->start).','. - $this->db_add_param($this->ende).','. - $this->db_add_param($this->erledigt,FHC_BOOLEAN).','. - $this->db_add_param($this->insertamum).','. - $this->db_add_param($this->insertvon).','. - $this->db_add_param($this->updateamum).','. - $this->db_add_param($this->updatevon).');'; - } - else - { - $qry='UPDATE public.tbl_notiz SET '. - 'titel='.$this->db_add_param($this->titel).', '. - 'text='.$this->db_add_param($this->text).', '. - 'verfasser_uid='.$this->db_add_param($this->verfasser_uid).', '. - 'bearbeiter_uid='.$this->db_add_param($this->bearbeiter_uid).', '. - 'start='.$this->db_add_param($this->start).', '. - 'ende='.$this->db_add_param($this->ende).', '. - 'erledigt='.$this->db_add_param($this->erledigt,FHC_BOOLEAN).', '. - 'updateamum='.$this->db_add_param($this->updateamum).', '. - 'updatevon='.$this->db_add_param($this->updatevon).' '. - 'WHERE notiz_id='.$this->db_add_param($this->notiz_id,FHC_INTEGER).';'; - } - - if($this->db_query($qry)) - { - if($new) - { - $qry="SELECT currval('seq_notiz_notiz_id') as id;"; - if($result = $this->db_query($qry)) - { - if($row = $this->db_fetch_object($result)) - { - $this->notiz_id = $row->id; - $this->db_query('COMMIT;'); - return true; - } - else - { - $this->errormsg = 'Fehler beim Lesen der Sequence'; - $this->db_query('ROLLBACK'); - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Lesen der Sequence'; - $this->db_query('ROLLBACK'); - return false; - } - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Speichern des Datensatzes'; - return false; - } - } - - /** - * Speichert die Zuordnung einer Notiz - * - */ - public function saveZuordnung() - { - $qry = "INSERT INTO public.tbl_notizzuordnung(notiz_id, projekt_kurzbz, projektphase_id, projekttask_id, - uid, person_id, prestudent_id, bestellung_id, lehreinheit_id, anrechnung_id) VALUES(". - $this->db_add_param($this->notiz_id, FHC_INTEGER).','. - $this->db_add_param($this->projekt_kurzbz).','. - $this->db_add_param($this->projektphase_id, FHC_INTEGER).','. - $this->db_add_param($this->projekttask_id, FHC_INTEGER).','. - $this->db_add_param($this->uid).','. - $this->db_add_param($this->person_id, FHC_INTEGER).','. - $this->db_add_param($this->prestudent_id, FHC_INTEGER).','. - $this->db_add_param($this->bestellung_id, FHC_INTEGER).','. - $this->db_add_param($this->lehreinheit_id, FHC_INTEGER).','. - $this->db_add_param($this->anrechnung_id, FHC_INTEGER).');'; - - if($this->db_query($qry)) - { - return true; - } - else - { - $this->errormsg = 'Fehler beim Speichern der Daten'; - return false; - } - } - - /** - * Speichert ein Dokument zur Notiz - * @param int $dms_id - * @return boolean - */ - public function saveDokument($dms_id) - { - $qry = "INSERT INTO public.tbl_notiz_dokument(notiz_id, dms_id) VALUES(". - $this->db_add_param($this->notiz_id, FHC_INTEGER).','. - $this->db_add_param($dms_id, FHC_INTEGER).');'; - - if($this->db_query($qry)) - { - return true; - } - else - { - $this->errormsg = 'Fehler beim Speichern der Daten'; - return false; - } - } - - /** - * - * Laedt die Notizen - * @param $erledigt - * @param $projekt_kurzbz - * @param $projektphase_id - * @param $projekttask_id - * @param $uid - * @param $person_id - * @param $prestudent_id - * @param $bestellung_id - * @param $user - * @param $lehreinheit_id - * @param $anrechnung_id - * @return boolean - */ - public function getNotiz( - $erledigt=null, - $projekt_kurzbz=null, - $projektphase_id=null, - $projekttask_id=null, - $uid=null, - $person_id=null, - $prestudent_id=null, - $bestellung_id=null, - $user=null, - $lehreinheit_id=null, - $stundenplandev_id=null, - $anrechnung_id=null, - $titel=null) - { - $qry = "SELECT - * - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE 1=1"; - - if(!is_null($erledigt)) - { - if($erledigt) - $qry.=" AND erledigt=true"; - else - $qry.=" AND erledigt=false"; - } - if($projekt_kurzbz!='') - $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); - if($projektphase_id!='') - $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); - if($projekttask_id!='') - $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); - if($uid!='') - $qry.=" AND uid=".$this->db_add_param($uid); - if($person_id!='') - $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); - if($prestudent_id!='') - $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); - if($bestellung_id!='') - $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); - if($user!='') - $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; - if($lehreinheit_id!='') - $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); - if($anrechnung_id!='') - $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); - if($titel!='') - $qry.=" AND titel=".$this->db_add_param($titel); - - $qry.=' ORDER BY start, ende, titel'; - - if($result = $this->db_query($qry)) - { - while($row = $this->db_fetch_object($result)) - { - $obj = new notiz(); - - $obj->notiz_id=$row->notiz_id; - $obj->titel=$row->titel; - $obj->text=$row->text; - $obj->verfasser_uid=$row->verfasser_uid; - $obj->bearbeiter_uid=$row->bearbeiter_uid; - $obj->start=$row->start; - $obj->ende=$row->ende; - $obj->erledigt=$this->db_parse_bool($row->erledigt); - $obj->insertamum=$row->insertamum; - $obj->insertvon=$row->insertvon; - $obj->updateamum=$row->updateamum; - $obj->updatevon=$row->updatevon; - $obj->getDokumente($row->notiz_id); - - $this->result[] = $obj; - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * - * Laedt die Notizen vom Bewerbungstool - * @param integer $person_id - * @param integer $prestudent_id - * @return boolean - */ - public function getBewerbungstoolNotizen($person_id, $prestudent_id = null) - { - $qry = "SELECT - * - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE (insertvon = 'online' OR insertvon = 'online_notiz') - AND person_id = ".$this->db_add_param($person_id, FHC_INTEGER); - if ($prestudent_id != '') - { - $qry .= " AND prestudent_id = ".$this->db_add_param($prestudent_id, FHC_INTEGER); - } - - $qry .= " ORDER BY notiz_id DESC"; - - if($result = $this->db_query($qry)) - { - while($row = $this->db_fetch_object($result)) - { - $obj = new notiz(); - - $obj->notiz_id=$row->notiz_id; - $obj->titel=$row->titel; - $obj->text=$row->text; - $obj->verfasser_uid=$row->verfasser_uid; - $obj->bearbeiter_uid=$row->bearbeiter_uid; - $obj->start=$row->start; - $obj->ende=$row->ende; - $obj->erledigt=$this->db_parse_bool($row->erledigt); - $obj->insertamum=$row->insertamum; - $obj->insertvon=$row->insertvon; - $obj->updateamum=$row->updateamum; - $obj->updatevon=$row->updatevon; - - $this->result[] = $obj; - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - - /** - * TEMPORARY: kurzfristig wird für das Onlinebewerbungstool die Ausbildung - * (Name und Adresse der besuchten Schule) in eine Notiz mit - * insertvon = online_ausbildung gespeichert. - * Wird auf UDF umgebaut! - * - * Laedt die Notizen zur Ausbilund vom Bewerbungstool - * @param $person_id int - * @return boolean - */ - public function getBewerbungstoolNotizenAusbildung($person_id) - { - $qry = 'SELECT - * - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE person_id = ' . $this->db_add_param($person_id, FHC_INTEGER) . - ' AND insertvon = ' . $this->db_add_param('online_ausbildung') . - ' ORDER BY notiz_id'; - - if($result = $this->db_query($qry)) - { - while($row = $this->db_fetch_object($result)) - { - $obj = new notiz(); - - $obj->notiz_id=$row->notiz_id; - $obj->titel=$row->titel; - $obj->text=$row->text; - $obj->verfasser_uid=$row->verfasser_uid; - $obj->bearbeiter_uid=$row->bearbeiter_uid; - $obj->start=$row->start; - $obj->ende=$row->ende; - $obj->erledigt=$this->db_parse_bool($row->erledigt); - $obj->insertamum=$row->insertamum; - $obj->insertvon=$row->insertvon; - $obj->updateamum=$row->updateamum; - $obj->updatevon=$row->updatevon; - - $this->result[] = $obj; - } - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - - - /** - - * - - * Laedt die Notizen - * @param $erledigt - * @param $projekt_kurzbz - * @param $projektphase_id - * @param $projekttask_id - * @param $uid - * @param $person_id - * @param $prestudent_id - * @param $bestellung_id - * @param $user - * @param $lehreinheit_id - * @param $anrechnung_id - * @return boolean - */ - public function getAnzahlNotizen($erledigt=null, $projekt_kurzbz=null, $projektphase_id=null, $projekttask_id=null, $uid=null, $person_id=null, $prestudent_id=null, $bestellung_id=null, $user=null, $lehreinheit_id=null, $anrechnung_id=null) - { - $qry = "SELECT - count(*) as anzahl - FROM - public.tbl_notiz - LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) - WHERE 1=1"; - - if(!is_null($erledigt)) - { - if($erledigt) - $qry.=" AND erledigt=true"; - else - $qry.=" AND erledigt=false"; - } - if($projekt_kurzbz!='') - $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); - if($projektphase_id!='') - $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); - if($projekttask_id!='') - $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); - if($uid!='') - $qry.=" AND uid=".$this->db_add_param($uid); - if($person_id!='') - $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); - if($prestudent_id!='') - $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); - if($bestellung_id!='') - $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); - if($user!='') - $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; - if($lehreinheit_id!='') - $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); - if($anrechnung_id!='') - $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); - - if($result = $this->db_query($qry)) - { - if($row = $this->db_fetch_object($result)) - return $row->anzahl; - else - { - $this->errormsg='Fehler beim Laden der Daten'; - return false; - } - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Laedt die Dokumente der Notiz - * @return boolean - */ - public function getDokumente($notiz_id) - { - $qry = "SELECT dms_id FROM public.tbl_notiz_dokument WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); - - if($this->db_query($qry)) - { - while($row = $this->db_fetch_object()) - { - $this->dokumente[] = $row->dms_id; - } - - return true; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } - - /** - * Prueft ob das Dokument an einer Notiz haengt - * @param $dms_id DMS id des Dokuments. - * @return boolean true wenn das Dokument an einer Notiz hängt, sonst false. - */ - public function isNotizDokument($dms_id) - { - $qry = "SELECT * FROM public.tbl_notiz_dokument WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER); - - if($result = $this->db_query($qry)) - { - if($this->db_num_rows($result)>0) - return true; - else - return false; - } - else - { - $this->errormsg = 'Fehler beim Laden der Daten'; - return false; - } - } -} + and + */ +require_once(dirname(__FILE__).'/basis_db.class.php'); +require_once(dirname(__FILE__).'/dms.class.php'); + +class notiz extends basis_db +{ + public $new; + public $result=array(); + public $dokumente=array(); + + //Tabellenspalten + public $notiz_id; + public $titel; + public $text; + public $verfasser_uid; + public $bearbeiter_uid; + public $start; + public $ende; + public $erledigt; + public $insertamum; + public $insertvon; + public $updateamum; + public $updatevon; + + public $projekt_kurzbz; + public $projektphase_id; + public $projekttask_id; + public $uid; + public $person_id; + public $prestudent_id; + public $bestellung_id; + public $lehreinheit_id; + public $anrechnung_id; + + /** + * Konstruktor + * @param $notiz_id + */ + public function __construct($notiz_id = null) + { + parent::__construct(); + + if($notiz_id != null) + $this->load($notiz_id); + } + + /** + * Laedt eine Notiz + * @param $notiz_id + * @return true wenn ok, false im Fehlerfall + */ + public function load($notiz_id) + { + if(!is_numeric($notiz_id)) + { + $this->errormsg = 'NotizID ist ungueltig'; + return false; + } + + $qry = "SELECT * FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); + + if($this->db_query($qry)) + { + if($row = $this->db_fetch_object()) + { + $this->notiz_id=$row->notiz_id; + $this->titel=$row->titel; + $this->text=$row->text; + $this->verfasser_uid=$row->verfasser_uid; + $this->bearbeiter_uid=$row->bearbeiter_uid; + $this->start=$row->start; + $this->ende=$row->ende; + $this->erledigt=$this->db_parse_bool($row->erledigt); + $this->insertamum=$row->insertamum; + $this->insertvon=$row->insertvon; + $this->updateamum=$row->updateamum; + $this->updatevon=$row->updatevon; + $this->getDokumente($row->notiz_id); + + return true; + } + else + { + $this->errormsg = 'Datensatz wurde nicht gefunden'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Löscht eine Notiz + * @param $notiz_id + * @return true wenn ok, false im Fehlerfall + */ + public function delete($notiz_id) + { + if(!is_numeric($notiz_id)) + { + $this->errormsg = 'NotizID ist ungueltig'; + return false; + } + + // Dokumente der Notiz löschen + $this->getDokumente($notiz_id); + if(!empty($this->dokumente)) + { + $dms = new dms(); + + foreach($this->dokumente as $dms_id) + { + $dms->deleteDms($dms_id); + } + } + + $qry = "Delete FROM public.tbl_notiz WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); + + if(!$this->db_query($qry)) + { + $this->errormsg = 'Fehler beim Loeschen der Daten'; + return false; + } + return true; + } + + /** + * Prueft die Daten vor dem Speichern + * auf Gueltigkeit + */ + public function validate() + { + return true; + } + + /** + * Speichert den aktuellen Datensatz in die Datenbank + * Wenn $neu auf true gesetzt ist wird ein neuer Datensatz angelegt + * andernfalls wird der Datensatz mit der ID in $notiz_id aktualisiert + * @return true wenn ok, false im Fehlerfall + */ + public function save($new=null) + { + if($new==null) + $new=$this->new; + + if(!$this->validate()) + return false; + + if($new) + { + //Neuen Datensatz einfuegen + $qry='BEGIN;INSERT INTO public.tbl_notiz (titel, text, verfasser_uid, + bearbeiter_uid, start, ende, erledigt, insertamum, insertvon, + updateamum, updatevon) VALUES('. + $this->db_add_param($this->titel).', '. + $this->db_add_param($this->text).', '. + $this->db_add_param($this->verfasser_uid).','. + $this->db_add_param($this->bearbeiter_uid).','. + $this->db_add_param($this->start).','. + $this->db_add_param($this->ende).','. + $this->db_add_param($this->erledigt,FHC_BOOLEAN).','. + $this->db_add_param($this->insertamum).','. + $this->db_add_param($this->insertvon).','. + $this->db_add_param($this->updateamum).','. + $this->db_add_param($this->updatevon).');'; + } + else + { + $qry='UPDATE public.tbl_notiz SET '. + 'titel='.$this->db_add_param($this->titel).', '. + 'text='.$this->db_add_param($this->text).', '. + 'verfasser_uid='.$this->db_add_param($this->verfasser_uid).', '. + 'bearbeiter_uid='.$this->db_add_param($this->bearbeiter_uid).', '. + 'start='.$this->db_add_param($this->start).', '. + 'ende='.$this->db_add_param($this->ende).', '. + 'erledigt='.$this->db_add_param($this->erledigt,FHC_BOOLEAN).', '. + 'updateamum='.$this->db_add_param($this->updateamum).', '. + 'updatevon='.$this->db_add_param($this->updatevon).' '. + 'WHERE notiz_id='.$this->db_add_param($this->notiz_id,FHC_INTEGER).';'; + } + + if($this->db_query($qry)) + { + if($new) + { + $qry="SELECT currval('seq_notiz_notiz_id') as id;"; + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + { + $this->notiz_id = $row->id; + $this->db_query('COMMIT;'); + return true; + } + else + { + $this->errormsg = 'Fehler beim Lesen der Sequence'; + $this->db_query('ROLLBACK'); + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Lesen der Sequence'; + $this->db_query('ROLLBACK'); + return false; + } + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern des Datensatzes'; + return false; + } + } + + /** + * Speichert die Zuordnung einer Notiz + * + */ + public function saveZuordnung() + { + $qry = "INSERT INTO public.tbl_notizzuordnung(notiz_id, projekt_kurzbz, projektphase_id, projekttask_id, + uid, person_id, prestudent_id, bestellung_id, lehreinheit_id, anrechnung_id) VALUES(". + $this->db_add_param($this->notiz_id, FHC_INTEGER).','. + $this->db_add_param($this->projekt_kurzbz).','. + $this->db_add_param($this->projektphase_id, FHC_INTEGER).','. + $this->db_add_param($this->projekttask_id, FHC_INTEGER).','. + $this->db_add_param($this->uid).','. + $this->db_add_param($this->person_id, FHC_INTEGER).','. + $this->db_add_param($this->prestudent_id, FHC_INTEGER).','. + $this->db_add_param($this->bestellung_id, FHC_INTEGER).','. + $this->db_add_param($this->lehreinheit_id, FHC_INTEGER).','. + $this->db_add_param($this->anrechnung_id, FHC_INTEGER).');'; + + if($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern der Daten'; + return false; + } + } + + /** + * Speichert ein Dokument zur Notiz + * @param int $dms_id + * @return boolean + */ + public function saveDokument($dms_id) + { + $qry = "INSERT INTO public.tbl_notiz_dokument(notiz_id, dms_id) VALUES(". + $this->db_add_param($this->notiz_id, FHC_INTEGER).','. + $this->db_add_param($dms_id, FHC_INTEGER).');'; + + if($this->db_query($qry)) + { + return true; + } + else + { + $this->errormsg = 'Fehler beim Speichern der Daten'; + return false; + } + } + + /** + * + * Laedt die Notizen + * @param $erledigt + * @param $projekt_kurzbz + * @param $projektphase_id + * @param $projekttask_id + * @param $uid + * @param $person_id + * @param $prestudent_id + * @param $bestellung_id + * @param $user + * @param $lehreinheit_id + * @param $anrechnung_id + * @return boolean + */ + public function getNotiz( + $erledigt=null, + $projekt_kurzbz=null, + $projektphase_id=null, + $projekttask_id=null, + $uid=null, + $person_id=null, + $prestudent_id=null, + $bestellung_id=null, + $user=null, + $lehreinheit_id=null, + $stundenplandev_id=null, + $anrechnung_id=null, + $titel=null) + { + $qry = "SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE 1=1"; + + if(!is_null($erledigt)) + { + if($erledigt) + $qry.=" AND erledigt=true"; + else + $qry.=" AND erledigt=false"; + } + if($projekt_kurzbz!='') + $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); + if($projektphase_id!='') + $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); + if($projekttask_id!='') + $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); + if($uid!='') + $qry.=" AND uid=".$this->db_add_param($uid); + if($person_id!='') + $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); + if($prestudent_id!='') + $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); + if($bestellung_id!='') + $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); + if($user!='') + $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; + if($lehreinheit_id!='') + $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); + if($anrechnung_id!='') + $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); + if($titel!='') + $qry.=" AND titel=".$this->db_add_param($titel); + + $qry.=' ORDER BY start, ende, titel'; + + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $obj = new notiz(); + + $obj->notiz_id=$row->notiz_id; + $obj->titel=$row->titel; + $obj->text=$row->text; + $obj->verfasser_uid=$row->verfasser_uid; + $obj->bearbeiter_uid=$row->bearbeiter_uid; + $obj->start=$row->start; + $obj->ende=$row->ende; + $obj->erledigt=$this->db_parse_bool($row->erledigt); + $obj->insertamum=$row->insertamum; + $obj->insertvon=$row->insertvon; + $obj->updateamum=$row->updateamum; + $obj->updatevon=$row->updatevon; + $obj->getDokumente($row->notiz_id); + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * + * Laedt die Notizen vom Bewerbungstool + * @param integer $person_id + * @param integer $prestudent_id + * @param string $order Sorting order. Default: "notiz_id" + * @return boolean + */ + public function getBewerbungstoolNotizen($person_id, $prestudent_id = null, $order = 'notiz_id') + { + $qry = "SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE (insertvon = 'online' OR insertvon = 'online_notiz') + AND person_id = ".$this->db_add_param($person_id, FHC_INTEGER); + if ($prestudent_id != '') + { + $qry .= " AND prestudent_id = ".$this->db_add_param($prestudent_id, FHC_INTEGER); + } + + $qry .= " ORDER BY ".$order; + + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $obj = new notiz(); + + $obj->notiz_id=$row->notiz_id; + $obj->titel=$row->titel; + $obj->text=$row->text; + $obj->verfasser_uid=$row->verfasser_uid; + $obj->bearbeiter_uid=$row->bearbeiter_uid; + $obj->start=$row->start; + $obj->ende=$row->ende; + $obj->erledigt=$this->db_parse_bool($row->erledigt); + $obj->insertamum=$row->insertamum; + $obj->insertvon=$row->insertvon; + $obj->updateamum=$row->updateamum; + $obj->updatevon=$row->updatevon; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + + /** + * TEMPORARY: kurzfristig wird für das Onlinebewerbungstool die Ausbildung + * (Name und Adresse der besuchten Schule) in eine Notiz mit + * insertvon = online_ausbildung gespeichert. + * Wird auf UDF umgebaut! + * + * Laedt die Notizen zur Ausbilund vom Bewerbungstool + * @param $person_id int + * @return boolean + */ + public function getBewerbungstoolNotizenAusbildung($person_id) + { + $qry = 'SELECT + * + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE person_id = ' . $this->db_add_param($person_id, FHC_INTEGER) . + ' AND insertvon = ' . $this->db_add_param('online_ausbildung') . + ' ORDER BY notiz_id'; + + if($result = $this->db_query($qry)) + { + while($row = $this->db_fetch_object($result)) + { + $obj = new notiz(); + + $obj->notiz_id=$row->notiz_id; + $obj->titel=$row->titel; + $obj->text=$row->text; + $obj->verfasser_uid=$row->verfasser_uid; + $obj->bearbeiter_uid=$row->bearbeiter_uid; + $obj->start=$row->start; + $obj->ende=$row->ende; + $obj->erledigt=$this->db_parse_bool($row->erledigt); + $obj->insertamum=$row->insertamum; + $obj->insertvon=$row->insertvon; + $obj->updateamum=$row->updateamum; + $obj->updatevon=$row->updatevon; + + $this->result[] = $obj; + } + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + + + /** + + * + + * Laedt die Notizen + * @param $erledigt + * @param $projekt_kurzbz + * @param $projektphase_id + * @param $projekttask_id + * @param $uid + * @param $person_id + * @param $prestudent_id + * @param $bestellung_id + * @param $user + * @param $lehreinheit_id + * @param $anrechnung_id + * @return boolean + */ + public function getAnzahlNotizen($erledigt=null, $projekt_kurzbz=null, $projektphase_id=null, $projekttask_id=null, $uid=null, $person_id=null, $prestudent_id=null, $bestellung_id=null, $user=null, $lehreinheit_id=null, $anrechnung_id=null) + { + $qry = "SELECT + count(*) as anzahl + FROM + public.tbl_notiz + LEFT JOIN public.tbl_notizzuordnung USING(notiz_id) + WHERE 1=1"; + + if(!is_null($erledigt)) + { + if($erledigt) + $qry.=" AND erledigt=true"; + else + $qry.=" AND erledigt=false"; + } + if($projekt_kurzbz!='') + $qry.=" AND projekt_kurzbz=".$this->db_add_param($projekt_kurzbz); + if($projektphase_id!='') + $qry.=" AND projektphase_id=".$this->db_add_param($projektphase_id, FHC_INTEGER); + if($projekttask_id!='') + $qry.=" AND projekttask_id=".$this->db_add_param($projekttask_id, FHC_INTEGER); + if($uid!='') + $qry.=" AND uid=".$this->db_add_param($uid); + if($person_id!='') + $qry.=" AND person_id=".$this->db_add_param($person_id, FHC_INTEGER); + if($prestudent_id!='') + $qry.=" AND prestudent_id=".$this->db_add_param($prestudent_id, FHC_INTEGER); + if($bestellung_id!='') + $qry.=" AND bestellung_id=".$this->db_add_param($bestellung_id, FHC_INTEGER); + if($user!='') + $qry.=" AND (verfasser_uid=".$this->db_add_param($user)." OR bearbeiter_uid=".$this->db_add_param($user).")"; + if($lehreinheit_id!='') + $qry.=" AND lehreinheit_id=".$this->db_add_param($lehreinheit_id, FHC_INTEGER); + if($anrechnung_id!='') + $qry.=" AND anrechnung_id=".$this->db_add_param($anrechnung_id, FHC_INTEGER); + + if($result = $this->db_query($qry)) + { + if($row = $this->db_fetch_object($result)) + return $row->anzahl; + else + { + $this->errormsg='Fehler beim Laden der Daten'; + return false; + } + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Laedt die Dokumente der Notiz + * @return boolean + */ + public function getDokumente($notiz_id) + { + $qry = "SELECT dms_id FROM public.tbl_notiz_dokument WHERE notiz_id=".$this->db_add_param($notiz_id, FHC_INTEGER); + + if($this->db_query($qry)) + { + while($row = $this->db_fetch_object()) + { + $this->dokumente[] = $row->dms_id; + } + + return true; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } + + /** + * Prueft ob das Dokument an einer Notiz haengt + * @param $dms_id DMS id des Dokuments. + * @return boolean true wenn das Dokument an einer Notiz hängt, sonst false. + */ + public function isNotizDokument($dms_id) + { + $qry = "SELECT * FROM public.tbl_notiz_dokument WHERE dms_id=".$this->db_add_param($dms_id, FHC_INTEGER); + + if($result = $this->db_query($qry)) + { + if($this->db_num_rows($result)>0) + return true; + else + return false; + } + else + { + $this->errormsg = 'Fehler beim Laden der Daten'; + return false; + } + } +} From e9705e69e732ee01168cad7ca0d3548cca2c552b Mon Sep 17 00:00:00 2001 From: manu Date: Tue, 13 Jul 2021 14:36:41 +0200 Subject: [PATCH 85/95] =?UTF-8?q?ZGV-Felder=20f=C3=BCr=20alle=20aktuellen?= =?UTF-8?q?=20Bewerbungen=20mit=20Inhouse-ZGV=20=C3=BCberschreiben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/prestudent.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index 0fe4a06e6..eb8767883 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2305,7 +2305,7 @@ class prestudent extends person $db = new basis_db(); $arrayleereManations = array(); - //all prestudent_ids mit leerer ZGV_Nation und Status Interessent + //all prestudent_ids mit Status Interessent $qry = "SELECT * FROM @@ -2314,8 +2314,6 @@ class prestudent extends person public.tbl_studiengang USING (studiengang_kz) WHERE person_id = ".$this->db_add_param($person_id)." - AND - zgvmanation is NULL AND typ ='m' And From e3a7fc2f0c2c50ae4a27385f8031d154447f5ea4 Mon Sep 17 00:00:00 2001 From: cris-technikum Date: Wed, 14 Jul 2021 17:52:22 +0200 Subject: [PATCH 86/95] Added CC parameter to sendSanchoMail function Signed-off-by: cris-technikum --- include/sancho.inc.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/include/sancho.inc.php b/include/sancho.inc.php index b52a7fb28..5fc6fcdab 100644 --- a/include/sancho.inc.php +++ b/include/sancho.inc.php @@ -33,10 +33,12 @@ const DEFAULT_SANCHO_FOOTER_IMG = 'sancho_footer_DEFAULT.jpg'; * @param string $to Email-adress. * @param string $subject Subject of mail. * @param string $headerImg Filename of the specific Sancho header image. + * @param string $footerImg * @param string $replyTo default Email-adress for reply. + * @param string | array $cc * @return boolean True, if succeeded. */ -function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerImg = DEFAULT_SANCHO_HEADER_IMG, $footerImg = DEFAULT_SANCHO_FOOTER_IMG, $replyTo = '') +function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerImg = DEFAULT_SANCHO_HEADER_IMG, $footerImg = DEFAULT_SANCHO_FOOTER_IMG, $replyTo = '', $cc = '') { $from = 'sancho@'. DOMAIN; $sanchoHeader_img = dirname(__FILE__). '/../skin/images/sancho/'. $headerImg; @@ -69,6 +71,10 @@ function sendSanchoMail($vorlage_kurzbz, $vorlage_data, $to, $subject, $headerIm // * Set reply-to if (isset($replyTo) && $replyTo != '') $mail->setReplyTo($replyTo); + + // * Set cc + if (isset($cc) && $cc != '') + $mail->setCCRecievers($cc); // * embed the html content $mail->setHTMLContent($body); From 05a06de109373d8fefe2407cb1e86df8fddb3b6c Mon Sep 17 00:00:00 2001 From: manu Date: Thu, 15 Jul 2021 09:10:35 +0200 Subject: [PATCH 87/95] =?UTF-8?q?alle=20prestudents=20im=20Status=20Intere?= =?UTF-8?q?ssent=20mit=20leerem=20zgvmatum=20=C3=BCberschreiben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/prestudent.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index eb8767883..fcafd36b8 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2316,6 +2316,8 @@ class prestudent extends person person_id = ".$this->db_add_param($person_id)." AND typ ='m' + AND + zgvmadatum IS NULL And get_rolle_prestudent(prestudent_id, null) = 'Interessent';"; From 143053b893f320efc9818ebac2b2c9cb023b5d91 Mon Sep 17 00:00:00 2001 From: manu Date: Tue, 20 Jul 2021 13:53:38 +0200 Subject: [PATCH 88/95] =?UTF-8?q?Bewerbungstool:=20alle=20Masterbewerbunge?= =?UTF-8?q?n=20mit=20Status=20Interessent=20mit=20ZGV-Ort=20=C3=BCberschre?= =?UTF-8?q?iben?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/prestudent.class.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/prestudent.class.php b/include/prestudent.class.php index fcafd36b8..eb8767883 100644 --- a/include/prestudent.class.php +++ b/include/prestudent.class.php @@ -2316,8 +2316,6 @@ class prestudent extends person person_id = ".$this->db_add_param($person_id)." AND typ ='m' - AND - zgvmadatum IS NULL And get_rolle_prestudent(prestudent_id, null) = 'Interessent';"; From e4aa42ad586049f6ab882c4dfbcdb08c0e4b32b7 Mon Sep 17 00:00:00 2001 From: Paolo Date: Wed, 21 Jul 2021 10:39:52 +0200 Subject: [PATCH 89/95] models/CL/Messages_model->getVorlage now filters out the _not_ active templates --- application/models/CL/Messages_model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/CL/Messages_model.php b/application/models/CL/Messages_model.php index 9ffd12cf6..4975af382 100644 --- a/application/models/CL/Messages_model.php +++ b/application/models/CL/Messages_model.php @@ -612,9 +612,9 @@ class Messages_model extends CI_Model if (!isEmptyString($vorlage_kurzbz)) { $this->load->model('system/Vorlagestudiengang_model', 'VorlagestudiengangModel'); - $this->VorlagestudiengangModel->addOrder('version','DESC'); + $this->VorlagestudiengangModel->addOrder('version', 'DESC'); - $getVorlage = $this->VorlagestudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz)); + $getVorlage = $this->VorlagestudiengangModel->loadWhere(array('vorlage_kurzbz' => $vorlage_kurzbz, 'aktiv' => true)); } return $getVorlage; From c2527e1b137669464b3f4cd7fc293fbf403722b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Thu, 22 Jul 2021 15:03:27 +0200 Subject: [PATCH 90/95] Updated FHComplete Domain --- cis/index.html | 2 +- cis/index_login.php | 2 +- content/fasoverlay.js.php | 2 +- content/tempus.js.php | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cis/index.html b/cis/index.html index 792be7e10..2a3809f6f 100644 --- a/cis/index.html +++ b/cis/index.html @@ -25,7 +25,7 @@ -
Powered by FH Complete
+
Powered by FH Complete


diff --git a/cis/index_login.php b/cis/index_login.php index 4c4d75f93..74c87f649 100644 --- a/cis/index_login.php +++ b/cis/index_login.php @@ -69,7 +69,7 @@ if(isset($_GET['login'])) -
Powered by FH Complete
+
Powered by FH Complete


diff --git a/content/fasoverlay.js.php b/content/fasoverlay.js.php index f7a30158f..9504285ce 100644 --- a/content/fasoverlay.js.php +++ b/content/fasoverlay.js.php @@ -1539,7 +1539,7 @@ function OpenAboutDialog() // **** function OpenManual() { - window.open('https://wiki.fhcomplete.org/doku.php?','_blank'); + window.open('https://wiki.fhcomplete.info/','_blank'); } // **** diff --git a/content/tempus.js.php b/content/tempus.js.php index e4dad5e43..5a734ebf3 100644 --- a/content/tempus.js.php +++ b/content/tempus.js.php @@ -473,7 +473,7 @@ function SyncLVPlan() // **** function OpenManualTempus() { - window.open('https://wiki.fhcomplete.org/doku.php?id=tempus:allgemeines','Manual'); + window.open('https://wiki.fhcomplete.info/doku.php?id=tempus:allgemeines','Manual'); } // **** From 6267a1bc37f8ed2c7db4dd507d9b125ad283a5eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 23 Jul 2021 13:06:15 +0200 Subject: [PATCH 91/95] =?UTF-8?q?-=20Hautpberuf=20wird=20im=20CIS=20Profil?= =?UTF-8?q?=20angezeigt=20f=C3=BCr=20den=20Mitarbeiter=20-=20Fehler=20beho?= =?UTF-8?q?ben=20wodurch=20die=20letzte=20Verwendung=20nicht=20korrekt=20e?= =?UTF-8?q?rmittelt=20wurde=20wenn=20das=20Ende=20Datum=20leer=20ist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/profile/index.php | 17 +++++++++++++++++ include/bisverwendung.class.php | 8 +++++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/cis/private/profile/index.php b/cis/private/profile/index.php index dd39cf301..80062a932 100644 --- a/cis/private/profile/index.php +++ b/cis/private/profile/index.php @@ -44,6 +44,7 @@ require_once('../../../include/addon.class.php'); require_once('../../../include/gruppe.class.php'); require_once('../../../include/adresse.class.php'); require_once('../../../include/benutzerberechtigung.class.php'); +require_once('../../../include/bisverwendung.class.php'); $sprache = getSprache(); $p = new phrasen($sprache); @@ -271,6 +272,22 @@ if (!$ansicht) } +if (!$ansicht) +{ + if ($is_employee) + { + $verwendung = new bisverwendung(); + if($verwendung->getLastVerwendung($uid)) + { + if (!$verwendung->hauptberuflich) + { + echo 'Hauptberuf: '. $verwendung->hauptberuf; + } + } + echo "

"; + } +} + if (!$ansicht) { $adresse = new adresse(); diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index 799cfc93e..07f2a74de 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -524,12 +524,13 @@ class bisverwendung extends basis_db { //laden des Datensatzes $qry = "SELECT - * + *, tbl_hauptberuf.bezeichnung as hauptberuf FROM bis.tbl_bisverwendung + LEFT JOIN bis.tbl_hauptberuf USING(hauptberufcode) WHERE mitarbeiter_uid=".$this->db_add_param($uid)." - ORDER BY ende DESC NULLS LAST,beginn DESC NULLS LAST LIMIT 1;"; + ORDER BY ende DESC NULLS FIRST,beginn DESC NULLS LAST LIMIT 1;"; if($this->db_query($qry)) { @@ -543,6 +544,7 @@ class bisverwendung extends basis_db $this->mitarbeiter_uid = $row->mitarbeiter_uid; $this->hauptberufcode = $row->hauptberufcode; $this->hauptberuflich = $this->db_parse_bool($row->hauptberuflich); + $this->hauptberuf = $row->hauptberuf; $this->habilitation = $this->db_parse_bool($row->habilitation); $this->beginn = $row->beginn; $this->ende = $row->ende; @@ -582,7 +584,7 @@ class bisverwendung extends basis_db (beginn<=now() OR beginn IS NULL) AND (ende>=now() OR ende IS NULL) - ORDER BY ende DESC NULLS LAST,beginn DESC NULLS LAST LIMIT 1;"; + ORDER BY ende DESC NULLS FIRST,beginn DESC NULLS LAST LIMIT 1;"; if($this->db_query($qry)) { From 023994b12cb8dfc4f9e4d894b29c5b300e774ecb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 23 Jul 2021 13:07:23 +0200 Subject: [PATCH 92/95] =?UTF-8?q?PHP=20Error=20behoben=20wenn=20Lehrauftr?= =?UTF-8?q?=C3=A4ge=20f=C3=BCr=20einzelne=20Studieng=C3=A4nge=20erstellt?= =?UTF-8?q?=20werden?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rdf/lehrauftrag_annehmen.xml.php | 90 ++++++++++++++++---------------- 1 file changed, 44 insertions(+), 46 deletions(-) diff --git a/rdf/lehrauftrag_annehmen.xml.php b/rdf/lehrauftrag_annehmen.xml.php index c0f691fe3..990701901 100644 --- a/rdf/lehrauftrag_annehmen.xml.php +++ b/rdf/lehrauftrag_annehmen.xml.php @@ -275,29 +275,29 @@ function drawLehrauftrag($uid) FROM campus.vw_lehreinheit JOIN lehre.tbl_lehreinheitmitarbeiter lema USING (lehreinheit_id, mitarbeiter_uid) - JOIN lehre.tbl_vertrag_vertragsstatus vvst USING (vertrag_id) + JOIN lehre.tbl_vertrag_vertragsstatus vvst USING (vertrag_id) WHERE mitarbeiter_uid=".$db->db_add_param($uid)." AND studiensemester_kurzbz=".$db->db_add_param($ss). " - AND lema.vertrag_id IS NOT NULL - AND vertragsstatus_kurzbz = 'akzeptiert'"; + AND lema.vertrag_id IS NOT NULL + AND vertragsstatus_kurzbz = 'akzeptiert'"; if ($studiengang_kz != '') //$studiengang_kz!='0' && - { - $qry .= " AND lv_studiengang_kz=".$db->db_add_param($studiengang_kz); - } + { + $qry .= " AND lv_studiengang_kz=".$db->db_add_param($studiengang_kz); + } elseif (!empty($xsl_oe_kurzbz)) - { - if ($xsl_oe_kurzbz == 'etw') - { - $qry .= " AND lv_studiengang_kz > 0"; - } + { + if ($xsl_oe_kurzbz == 'etw') + { + $qry .= " AND lv_studiengang_kz > 0"; + } - if ($xsl_oe_kurzbz == 'lehrgang') - { - $qry .= " AND lv_studiengang_kz <= 0"; - } - } + if ($xsl_oe_kurzbz == 'lehrgang') + { + $qry .= " AND lv_studiengang_kz <= 0"; + } + } $qry .= " ORDER BY lv_orgform_kurzbz, lv_bezeichnung, lehreinheit_id"; $lv = array(); @@ -390,8 +390,8 @@ function drawLehrauftrag($uid) $gesamtstunden = $gesamtstunden + $stunden; } } - $qry = 'SELECT - pa.projektarbeit_id, + $qry = 'SELECT + pa.projektarbeit_id, pb.faktor, pb.stunden, pb.stundensatz, @@ -401,37 +401,37 @@ function drawLehrauftrag($uid) student.studiengang_kz, projekttyp_kurzbz, lv.oe_kurzbz, - vertragsstatus_kurzbz + vertragsstatus_kurzbz FROM lehre.tbl_projektbetreuer pb - JOIN lehre.tbl_projektarbeit pa USING (projektarbeit_id) - JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id) - JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id) - JOIN PUBLIC.tbl_organisationseinheit oe USING (oe_kurzbz) - JOIN public.tbl_benutzer benutzer ON pb.person_id = benutzer.person_id - JOIN campus.vw_student student ON pa.student_uid = student.uid - LEFT JOIN lehre.tbl_vertrag vertrag USING (vertrag_id) - LEFT JOIN lehre.tbl_vertrag_vertragsstatus vvst USING (vertrag_id) + JOIN lehre.tbl_projektarbeit pa USING (projektarbeit_id) + JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id) + JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id) + JOIN PUBLIC.tbl_organisationseinheit oe USING (oe_kurzbz) + JOIN public.tbl_benutzer benutzer ON pb.person_id = benutzer.person_id + JOIN campus.vw_student student ON pa.student_uid = student.uid + LEFT JOIN lehre.tbl_vertrag vertrag USING (vertrag_id) + LEFT JOIN lehre.tbl_vertrag_vertragsstatus vvst USING (vertrag_id) WHERE pb.vertrag_id IS NOT NULL - AND vvst.vertragsstatus_kurzbz = \'akzeptiert\' - AND benutzer.uid = '.$db->db_add_param($uid).' - AND le.studiensemester_kurzbz = '.$db->db_add_param($ss); + AND vvst.vertragsstatus_kurzbz = \'akzeptiert\' + AND benutzer.uid = '.$db->db_add_param($uid).' + AND le.studiensemester_kurzbz = '.$db->db_add_param($ss); if ($studiengang_kz != '') - { - $qry .= " AND tbl_lehrveranstaltung.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER); - } - elseif (!empty($xsl_oe_kurzbz)) - { - if ($xsl_oe_kurzbz == 'etw') - { - $qry .= " AND lv.studiengang_kz > 0"; - } + { + $qry .= " AND lv.studiengang_kz=".$db->db_add_param($studiengang_kz, FHC_INTEGER); + } + elseif (!empty($xsl_oe_kurzbz)) + { + if ($xsl_oe_kurzbz == 'etw') + { + $qry .= " AND lv.studiengang_kz > 0"; + } - if ($xsl_oe_kurzbz == 'lehrgang') - { - $qry .= " AND lv.studiengang_kz <= 0"; - } - } + if ($xsl_oe_kurzbz == 'lehrgang') + { + $qry .= " AND lv.studiengang_kz <= 0"; + } + } if ($result = $db->db_query($qry)) { @@ -471,8 +471,6 @@ function drawLehrauftrag($uid) } } - - foreach ($lv as $lv_row) { $xml .= ' From c8cfc49af93dbbd6a6ab48bbad32913954269c97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 23 Jul 2021 13:59:21 +0200 Subject: [PATCH 93/95] =?UTF-8?q?Mailempf=C3=A4nger=20bei=20Urlaubsfreigab?= =?UTF-8?q?email=20korrigiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/private/profile/urlaubsfreigabe.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cis/private/profile/urlaubsfreigabe.php b/cis/private/profile/urlaubsfreigabe.php index 384a3415d..f71d7adda 100644 --- a/cis/private/profile/urlaubsfreigabe.php +++ b/cis/private/profile/urlaubsfreigabe.php @@ -154,10 +154,10 @@ if (isset($_GET['action']) && $_GET['action'] == 'freigabe') } //Bestätigungsmail an Mitarbeiter*in - $to = $uid. '@'.DOMAIN; + $to = $zeitsperre->mitarbeiter_uid. '@'.DOMAIN; $person = new person(); $fullNameVG = $person->getFullNameFromBenutzer($user); - $fullNameMA = $person->getFullNameFromBenutzer($uid); + $fullNameMA = $person->getFullNameFromBenutzer($zeitsperre->mitarbeiter_uid); $from = 'noreply@'.DOMAIN; $subject = $p->t('urlaubstool/urlaubsfreigabe'). date("d.m.Y", strtotime($zeitsperre->vondatum)). " ". $p->t('urlaubstool/bis'). " ". date("d.m.Y", strtotime($zeitsperre->bisdatum)); @@ -166,7 +166,7 @@ if (isset($_GET['action']) && $_GET['action'] == 'freigabe') $p->t('urlaubstool/bis')." ".date("d.m.Y", strtotime($zeitsperre->bisdatum)); $text .= $p->t('urlaubstool/urlaubBis', array($fullNameVG)); $text .= "\n". "\n". $p->t('urlaubstool/sieKoennenDiesenUnterFolgenderAdresseEinsehen'); - $text .= "\n". APP_ROOT. 'cis/private/profile/urlaubstool.php?uid='. $uid; + $text .= "\n". APP_ROOT. 'cis/private/profile/urlaubstool.php'; $mail = new mail($to, $from, $subject, $text); @@ -228,7 +228,7 @@ function draw_monat($monat) if ($vertretung->uid != '') echo ' (Vertretung: '.$vertretung->nachname.')'; if($row->freigabeamum=='') - echo " zeitsperre_id&year=$year&uid=$row->mitarbeiter_uid' class='Item'>Freigabe"; + echo " zeitsperre_id&year=$year&uid=$uid' class='Item'>Freigabe"; echo ""; echo '
'; } From c8919f2878858b5e27ab630cc4259d11f333d658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 23 Jul 2021 15:17:43 +0200 Subject: [PATCH 94/95] =?UTF-8?q?Benotungstool=20zeigt=20den=20Namen=20sta?= =?UTF-8?q?tt=20der=20UID=20bei=20der=20Anlage=20von=20Nachpr=C3=BCfungste?= =?UTF-8?q?rminen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lehre/benotungstool/lvgesamtnoteverwalten.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php index 713b93dc5..407502178 100644 --- a/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php +++ b/cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php @@ -12,10 +12,13 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. - * Authors: Christian Paminger , + * + * Authors: + * Christian Paminger , * Andreas Oesterreicher and * Rudolf Hangl < rudolf.hangl@technikum-wien.at > * Gerald Simane-Sequens < gerald.simane-sequens@technikum-wien.at > + * Manuela Thamer */ require_once ('../../../../config/cis.config.inc.php'); require_once ('../../../../config/global.config.inc.php'); @@ -306,6 +309,8 @@ foreach ($noten_obj->result as $row) { if(typeof(typ)=='undefined') typ = 'Termin2'; + var nn = document.getElementById(uid+"_nn").innerHTML; + var vn = document.getElementById(uid+"_vn").innerHTML; var str = "
"; str += ""; @@ -314,7 +319,7 @@ foreach ($noten_obj->result as $row) anlegendiv.style.top = y+"px"; var x = getOffset('x'); x = x+300; anlegendiv.style.left = x+"px"; - str += ""; + str += ""; str += ""; str += " - - '; + + '; // Bereits eingetragene Note ermitteln if ($lvgesamtnote = new lvgesamtnote($lvid, $uid, $stsem)) From cb855e786471703a8052804a7de9d9b57264bb8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Wed, 28 Jul 2021 19:05:48 +0200 Subject: [PATCH 95/95] =?UTF-8?q?Zeitaufzeichnungspflichtig=20Pr=C3=BCfung?= =?UTF-8?q?=20auf=20Zeitraum=20erweitert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/bisverwendung.class.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/bisverwendung.class.php b/include/bisverwendung.class.php index bbe5c37dc..598edcac1 100644 --- a/include/bisverwendung.class.php +++ b/include/bisverwendung.class.php @@ -817,16 +817,22 @@ class bisverwendung extends basis_db } } - public function inZeitaufzeichnungspflichtigPeriod($date) + public function inZeitaufzeichnungspflichtigPeriod($PeriodStartDate, $PeriodEndDate) { - $dateToCheck = date('Y-m-d', strtotime($date)); + $PeriodStartDateISO = date('Y-m-d', strtotime($PeriodStartDate)); + $PeriodEndDateISO = date('Y-m-d', strtotime($PeriodEndDate)); + $beginn = date('Y-m-d', strtotime($this->beginn)); $end = date('Y-m-d', strtotime($this->ende)); $zp = $this->zeitaufzeichnungspflichtig; if ($zp) { - if (($dateToCheck >= $beginn) && (($dateToCheck <= $end) OR is_null($this->ende))) + if ( + (($PeriodStartDateISO >= $beginn) && (($PeriodStartDateISO <= $end) || is_null($this->ende))) + || + (($PeriodEndDateISO >= $beginn) && (($PeriodEndDateISO <= $end) || is_null($this->ende))) + ) { return true; }
X
t('benotungstool/pruefungAnlegenFuer');?> "+uid+":
t('benotungstool/pruefungAnlegenFuer');?> "+nn+" "+vn+":
t('global/datum');?>:"; str += ""; @@ -1166,8 +1171,8 @@ if (defined("CIS_GESAMTNOTE_PRUEFUNG_MOODLE_LE_NOTE") && CIS_GESAMTNOTE_PRUEFUNG $htmlstring .= '
' . $db->convert_html_chars($uid) . '' . $db->convert_html_chars($data['nachname']) . '' . $db->convert_html_chars($data['vorname']) . '' . $db->convert_html_chars($data['nachname']) . '' . $db->convert_html_chars($data['vorname']) . '