From f82315cfe748aaa25bdf1241eddf6aa9969df3aa Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 13 Oct 2021 10:46:05 +0200 Subject: [PATCH 01/25] ermoeglicht das einloggen wenn 2 Reihungstests am selben Tag sind --- cis/testtool/login.php | 5 +++-- include/reihungstest.class.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cis/testtool/login.php b/cis/testtool/login.php index a738c0a88..f10d4928a 100644 --- a/cis/testtool/login.php +++ b/cis/testtool/login.php @@ -132,7 +132,7 @@ if (isset($_REQUEST['prestudent'])) } else { - if ($rt->getReihungstestPersonDatum($ps->prestudent_id, date('Y-m-d'))) + if ($rt->getReihungstestPersonDatum($ps->prestudent_id, $ps->studiengang_kz, date('Y-m-d'))) { // TODO Was ist wenn da mehrere Zurueckkommen?! if (isset($rt->result[0])) @@ -149,6 +149,7 @@ if (isset($_REQUEST['prestudent'])) } if ($reihungstest_id != '' && $rt->load($reihungstest_id)) { + if ($rt->freigeschaltet) { // regenerate Session ID after Login @@ -699,7 +700,7 @@ else // LOGIN Site (vor Login) else $selected=''; echo ' - \n'; + \n'; } // An der FHTW gibt es 3 Testuser für den Camus International if (CAMPUS_NAME == 'FH Technikum Wien') diff --git a/include/reihungstest.class.php b/include/reihungstest.class.php index f5cd72b4a..138c6996e 100644 --- a/include/reihungstest.class.php +++ b/include/reihungstest.class.php @@ -1245,7 +1245,7 @@ class reihungstest extends basis_db * @param date $datum Datum an dem der Reihugnstest stattfindet. * @return boolean true wenn erfolgreich geladen, false im Fehlerfall */ - public function getReihungstestPersonDatum($prestudent_id, $datum) + public function getReihungstestPersonDatum($prestudent_id, $studiengang_kz,$datum) { $qry = "SELECT tbl_rt_person.* @@ -1255,6 +1255,7 @@ class reihungstest extends basis_db JOIN public.tbl_reihungstest ON(tbl_reihungstest.reihungstest_id=tbl_rt_person.rt_id) WHERE tbl_prestudent.prestudent_id = ".$this->db_add_param($prestudent_id)." + AND tbl_reihungstest.studiengang_kz = ". $this->db_add_param($studiengang_kz) ." AND tbl_reihungstest.datum=".$this->db_add_param($datum); if ($result = $this->db_query($qry)) { From 6596a442adacbc353fe8003812fea5c2f85e0939 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 11 Nov 2021 12:10:35 +0100 Subject: [PATCH 02/25] eine logout seite hinzugefuegt - reihungstest --- cis/testtool/login.php | 2 +- cis/testtool/logout.html | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) create mode 100644 cis/testtool/logout.html diff --git a/cis/testtool/login.php b/cis/testtool/login.php index a738c0a88..df4874a4c 100644 --- a/cis/testtool/login.php +++ b/cis/testtool/login.php @@ -55,7 +55,7 @@ if (isset($_GET['logout']) && $_GET['logout'] == true) echo ' diff --git a/cis/testtool/logout.html b/cis/testtool/logout.html new file mode 100644 index 000000000..ac5074f88 --- /dev/null +++ b/cis/testtool/logout.html @@ -0,0 +1,11 @@ + + + + TestTool - FH Technikum Wien + + + + + Danke für die Teilnahme am Reihungstest. Klicken Sie hier, um zurück zur Startseite zu gelangen. + + From bb29dca8468d501c3ef0d3c5f5f7afaf19992752 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 15 Dec 2021 15:55:16 +0100 Subject: [PATCH 03/25] text angepasst nach dem logout --- cis/testtool/logout.html | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/cis/testtool/logout.html b/cis/testtool/logout.html index ac5074f88..e350b4bca 100644 --- a/cis/testtool/logout.html +++ b/cis/testtool/logout.html @@ -3,9 +3,29 @@ TestTool - FH Technikum Wien + - Danke für die Teilnahme am Reihungstest. Klicken Sie hier, um zurück zur Startseite zu gelangen. +
+
+
+
+

Vielen Dank für die Teilnahme an unserem Aufnahmeverfahren.

+

+ Die zuständige Assistenz wird sich in den nächsten Tagen bei Ihnen melden. +

+ Zurück zur Startseite +
+
+

Thank you for participating in our admission procedure.

+

+ The assistant in charge will contact you in the next few days. +

+ Back to startpage +
+
+
+
From 66ba68965696030c3d7f70123bdb9f55416c2b24 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 16 Dec 2021 13:46:09 +0100 Subject: [PATCH 04/25] nicht im neuen tab oeffnen --- cis/testtool/logout.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cis/testtool/logout.html b/cis/testtool/logout.html index e350b4bca..58a0b191f 100644 --- a/cis/testtool/logout.html +++ b/cis/testtool/logout.html @@ -15,14 +15,14 @@

Die zuständige Assistenz wird sich in den nächsten Tagen bei Ihnen melden.

- Zurück zur Startseite + Zurück zur Startseite

Thank you for participating in our admission procedure.



The assistant in charge will contact you in the next few days.

- Back to startpage + Back to startpage
From e0bc6198d021e9898df78aed8a87a8d1ea35d12b Mon Sep 17 00:00:00 2001 From: ma0048 Date: Mon, 20 Dec 2021 13:04:06 +0100 Subject: [PATCH 05/25] Name statt uid bei der "wird bearbeitet von" Meldung --- .../controllers/system/infocenter/InfoCenter.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index a69a43220..d2a058318 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -1708,9 +1708,15 @@ class InfoCenter extends Auth_Controller if (isset($locked->retval[0]->uid)) { - $lockedby = $locked->retval[0]->uid; - if ($lockedby !== $this->_uid) + if ($locked->retval[0]->uid !== $this->_uid) + { $lockedbyother = true; + + if (!$lockedby = getData($this->PersonModel->getFullName($locked->retval[0]->uid))) + { + show_error('Failed retrieving person'); + } + } } $stammdaten = $this->PersonModel->getPersonStammdaten($person_id, true); From 2d46d80b5f62c3075283d69971c5317e1f84894d Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 22 Dec 2021 16:26:45 +0100 Subject: [PATCH 06/25] meldung wird nun auch angezeigt wenn es die selbe person id ist --- application/models/person/Person_model.php | 37 ++++++++++++++++------ 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index ec5522674..37d6fb9ff 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -268,16 +268,35 @@ class Person_model extends DB_Model public function checkDuplicate($person_id) { - $qry = "SELECT sp.person_id - FROM public.tbl_person p - LEFT JOIN public.tbl_person sp ON p.vorname = sp.vorname - AND p.nachname = sp.nachname - AND p.gebdatum = sp.gebdatum - JOIN public.tbl_prestudent ps ON sp.person_id = ps.person_id - JOIN public.tbl_prestudentstatus pss ON ps.prestudent_id = pss.prestudent_id - WHERE p.person_id = ? AND sp.person_id != ? AND pss.status_kurzbz = ?"; + $qry = "SELECT p.person_id + FROM public.tbl_person p + JOIN public.tbl_prestudent USING (person_id) + JOIN public.tbl_prestudentstatus USING (prestudent_id) + WHERE status_kurzbz = 'Abbrecher' + AND person_id IN (SELECT p2.person_id + FROM public.tbl_person p + JOIN public.tbl_person p2 + ON p.vorname = p2.vorname + AND p.nachname = p2.nachname + AND p.gebdatum = p2.gebdatum + WHERE p.person_id = ? + )"; + $person = $this->execQuery($qry, array($person_id)); - return $this->execQuery($qry, array($person_id, $person_id, 'Abbrecher')); + if (hasData($person)) + { + $qry = "SELECT p2.person_id + FROM public.tbl_person p + JOIN public.tbl_person p2 + ON p.vorname = p2.vorname + AND p.nachname = p2.nachname + AND p.gebdatum = p2.gebdatum + WHERE p.person_id = ?"; + + return $this->execQuery($qry, array($person_id)); + } + + return $person; } } From 4d223145d9bee02359c9fb0dcb6bd8b914bace3c Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 22 Dec 2021 16:32:00 +0100 Subject: [PATCH 07/25] if angepasst --- .../controllers/system/infocenter/InfoCenter.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index d2a058318..1d142d615 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -1708,14 +1708,14 @@ class InfoCenter extends Auth_Controller if (isset($locked->retval[0]->uid)) { + if (!$lockedby = getData($this->PersonModel->getFullName($locked->retval[0]->uid))) + { + show_error('Failed retrieving person'); + } + if ($locked->retval[0]->uid !== $this->_uid) { $lockedbyother = true; - - if (!$lockedby = getData($this->PersonModel->getFullName($locked->retval[0]->uid))) - { - show_error('Failed retrieving person'); - } } } From c36d0358a9da63a6a1965edf1dabd91e1971343d Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 13 Jan 2022 15:16:34 +0100 Subject: [PATCH 08/25] check duplicate auch studiengang wird nun beruecksichtigt --- application/models/person/Person_model.php | 74 +++++++++++++++------- system/phrasesupdate.php | 4 +- 2 files changed, 52 insertions(+), 26 deletions(-) diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 37d6fb9ff..25aa0414b 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -268,35 +268,61 @@ class Person_model extends DB_Model public function checkDuplicate($person_id) { - $qry = "SELECT p.person_id - FROM public.tbl_person p - JOIN public.tbl_prestudent USING (person_id) - JOIN public.tbl_prestudentstatus USING (prestudent_id) - WHERE status_kurzbz = 'Abbrecher' - AND person_id IN (SELECT p2.person_id + $qry = "SELECT person_id + FROM public.tbl_prestudent p + JOIN + ( + SELECT DISTINCT ON(prestudent_id) * + FROM public.tbl_prestudentstatus + WHERE prestudent_id IN + ( + SELECT prestudent_id + FROM public.tbl_prestudent + WHERE person_id IN + ( + SELECT p2.person_id FROM public.tbl_person p JOIN public.tbl_person p2 ON p.vorname = p2.vorname AND p.nachname = p2.nachname AND p.gebdatum = p2.gebdatum - WHERE p.person_id = ? - )"; + AND p.person_id = ? + ) + ) + ORDER BY prestudent_id, datum DESC, insertamum DESC + ) ps USING(prestudent_id) + JOIN public.tbl_status USING(status_kurzbz) + WHERE status_kurzbz = 'Interessent' + AND studiengang_kz IN + ( + SELECT studiengang_kz + FROM public.tbl_prestudent p + JOIN + ( + SELECT DISTINCT ON(prestudent_id) * + FROM public.tbl_prestudentstatus + WHERE prestudent_id IN + ( + SELECT prestudent_id + FROM public.tbl_prestudent + WHERE person_id IN + ( + SELECT p2.person_id + FROM public.tbl_person p + JOIN public.tbl_person p2 + ON p.vorname = p2.vorname + AND p.nachname = p2.nachname + AND p.gebdatum = p2.gebdatum + AND p.person_id = ? + ) + ) + ORDER BY prestudent_id, datum DESC, insertamum DESC + ) ps USING(prestudent_id) + JOIN public.tbl_status USING(status_kurzbz) + WHERE status_kurzbz = 'Abbrecher' + ) + "; - $person = $this->execQuery($qry, array($person_id)); - - if (hasData($person)) - { - $qry = "SELECT p2.person_id - FROM public.tbl_person p - JOIN public.tbl_person p2 - ON p.vorname = p2.vorname - AND p.nachname = p2.nachname - AND p.gebdatum = p2.gebdatum - WHERE p.person_id = ?"; - - return $this->execQuery($qry, array($person_id)); - } - - return $person; + return $this->execQuery($qry, array($person_id, $person_id)); } } diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index b3518c79f..87908293f 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -896,13 +896,13 @@ $phrases = array( 'phrases' => array( array( 'sprache' => 'German', - 'text' => 'BewerberIn bereits vorhanden', + 'text' => 'BewerberIn möglicherweise vorhanden', 'description' => '', 'insertvon' => 'system' ), array( 'sprache' => 'English', - 'text' => 'Applicant already available', + 'text' => 'Applicant maybe available', 'description' => '', 'insertvon' => 'system' ) From f8d01b08664a61fdbffe4985e0543189a9a9d19e Mon Sep 17 00:00:00 2001 From: ma0048 Date: Thu, 27 Jan 2022 10:41:41 +0100 Subject: [PATCH 09/25] rt login fixed bei zwei rts --- cis/testtool/login.php | 5 ++--- include/reihungstest.class.php | 20 +++++++++----------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/cis/testtool/login.php b/cis/testtool/login.php index f10d4928a..a738c0a88 100644 --- a/cis/testtool/login.php +++ b/cis/testtool/login.php @@ -132,7 +132,7 @@ if (isset($_REQUEST['prestudent'])) } else { - if ($rt->getReihungstestPersonDatum($ps->prestudent_id, $ps->studiengang_kz, date('Y-m-d'))) + if ($rt->getReihungstestPersonDatum($ps->prestudent_id, date('Y-m-d'))) { // TODO Was ist wenn da mehrere Zurueckkommen?! if (isset($rt->result[0])) @@ -149,7 +149,6 @@ if (isset($_REQUEST['prestudent'])) } if ($reihungstest_id != '' && $rt->load($reihungstest_id)) { - if ($rt->freigeschaltet) { // regenerate Session ID after Login @@ -700,7 +699,7 @@ else // LOGIN Site (vor Login) else $selected=''; echo ' - \n'; + \n'; } // An der FHTW gibt es 3 Testuser für den Camus International if (CAMPUS_NAME == 'FH Technikum Wien') diff --git a/include/reihungstest.class.php b/include/reihungstest.class.php index 138c6996e..005801048 100644 --- a/include/reihungstest.class.php +++ b/include/reihungstest.class.php @@ -1245,18 +1245,16 @@ class reihungstest extends basis_db * @param date $datum Datum an dem der Reihugnstest stattfindet. * @return boolean true wenn erfolgreich geladen, false im Fehlerfall */ - public function getReihungstestPersonDatum($prestudent_id, $studiengang_kz,$datum) + public function getReihungstestPersonDatum($prestudent_id, $datum) { - $qry = "SELECT - tbl_rt_person.* - FROM - public.tbl_rt_person - JOIN public.tbl_prestudent USING(person_id) - JOIN public.tbl_reihungstest ON(tbl_reihungstest.reihungstest_id=tbl_rt_person.rt_id) - WHERE - tbl_prestudent.prestudent_id = ".$this->db_add_param($prestudent_id)." - AND tbl_reihungstest.studiengang_kz = ". $this->db_add_param($studiengang_kz) ." - AND tbl_reihungstest.datum=".$this->db_add_param($datum); + $qry = "SELECT rt_person.* + FROM tbl_prestudent ps + JOIN tbl_prestudentstatus pss ON ps.prestudent_id = pss.prestudent_id + JOIN tbl_rt_person rt_person ON pss.studienplan_id = rt_person.studienplan_id AND ps.person_id = rt_person.person_id + JOIN tbl_reihungstest rt ON rt_person.rt_id = rt.reihungstest_id + WHERE ps.prestudent_id = ".$this->db_add_param($prestudent_id)." + AND rt.datum=".$this->db_add_param($datum); + if ($result = $this->db_query($qry)) { while ($row = $this->db_fetch_object($result)) From 6b5df6d6ca7d3352f136fb3803b136948494aaba Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 9 Feb 2022 13:48:54 +0100 Subject: [PATCH 10/25] fixed login for testtool --- include/reihungstest.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/reihungstest.class.php b/include/reihungstest.class.php index 005801048..0140816ab 100644 --- a/include/reihungstest.class.php +++ b/include/reihungstest.class.php @@ -1250,9 +1250,11 @@ class reihungstest extends basis_db $qry = "SELECT rt_person.* FROM tbl_prestudent ps JOIN tbl_prestudentstatus pss ON ps.prestudent_id = pss.prestudent_id - JOIN tbl_rt_person rt_person ON pss.studienplan_id = rt_person.studienplan_id AND ps.person_id = rt_person.person_id + JOIN tbl_rt_person rt_person ON ps.person_id = rt_person.person_id JOIN tbl_reihungstest rt ON rt_person.rt_id = rt.reihungstest_id + JOIN tbl_rt_studienplan rtstp ON rt.reihungstest_id = rtstp.reihungstest_id WHERE ps.prestudent_id = ".$this->db_add_param($prestudent_id)." + AND rtstp.studienplan_id = pss.studienplan_id AND rt.datum=".$this->db_add_param($datum); if ($result = $this->db_query($qry)) From a2a307aadeafa0a9a7f00b0d2d9b2f95df56bf67 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 21 Feb 2022 16:43:44 +0100 Subject: [PATCH 11/25] Changed permission to allow stgl assistance reading Uebersicht- and Detailseite --- .../anrechnung/ApproveAnrechnungDetail.php | 27 +++++++++++++------ .../ApproveAnrechnungUebersicht.php | 4 +-- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php index 8e1b601aa..e98b09bdb 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php @@ -22,8 +22,8 @@ class approveAnrechnungDetail extends Auth_Controller // Set required permissions parent::__construct( array( - 'index' => 'lehre/anrechnung_genehmigen:rw', - 'download' => 'lehre/anrechnung_genehmigen:rw', + 'index' => 'lehre/anrechnung_genehmigen:r', + 'download' => 'lehre/anrechnung_genehmigen:r', 'approve' => 'lehre/anrechnung_genehmigen:rw', 'reject' => 'lehre/anrechnung_genehmigen:rw', 'requestRecommendation' => 'lehre/anrechnung_genehmigen:rw', @@ -421,13 +421,10 @@ class approveAnrechnungDetail extends Auth_Controller 'lehrveranstaltung_id' => getData($result)[0]->lehrveranstaltung_id )); - if(!hasData($result)) - { - show_error('Failed loading Lehrveranstaltung'); - } + $studiengang_kz = getData($result)[0]->studiengang_kz; - // Get STGL - $result = $this->StudiengangModel->getLeitung(getData($result)[0]->studiengang_kz); + // Check if user is STGL + $result = $this->StudiengangModel->getLeitung($studiengang_kz); if (hasData($result)) { @@ -440,6 +437,20 @@ class approveAnrechnungDetail extends Auth_Controller } } + // Check if user is Assistance + $result = $this->StudiengangModel->getAssistance($studiengang_kz); + + if (hasData($result)) + { + foreach (getData($result) as $assistance) + { + if ($assistance->uid == $this->_uid) + { + return; + } + } + } + show_error('You are not entitled to read this Anrechnung'); } diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 25c802caf..311828144 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -19,8 +19,8 @@ class approveAnrechnungUebersicht extends Auth_Controller // Set required permissions parent::__construct( array( - 'index' => 'lehre/anrechnung_genehmigen:rw', - 'download' => 'lehre/anrechnung_genehmigen:rw', + 'index' => 'lehre/anrechnung_genehmigen:r', + 'download' => 'lehre/anrechnung_genehmigen:r', 'approve' => 'lehre/anrechnung_genehmigen:rw', 'reject' => 'lehre/anrechnung_genehmigen:rw', 'requestRecommendation' => 'lehre/anrechnung_genehmigen:rw' From d57a62dbe383e157e729eaa6cd6c2c128f805700 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 21 Feb 2022 16:49:03 +0100 Subject: [PATCH 12/25] Adapted method getLeitung in Studiengang Model to accept studiengang array --- .../models/organisation/Studiengang_model.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 6358ca81e..d928f4e61 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -450,8 +450,9 @@ class Studiengang_model extends DB_Model } /** - * Get Studiengangsleitung - * @param null $studiengang_kz + * Get Studiengangsleitung/en of Studiengang/Studiengaenge. + * + * @param null $studiengang_kz Numeric or Array * @return array */ public function getLeitung($studiengang_kz = null) @@ -469,13 +470,17 @@ class Studiengang_model extends DB_Model AND ( datum_bis >= NOW() OR datum_bis IS NULL ) '; } - elseif (is_numeric($studiengang_kz)) + elseif (is_numeric($studiengang_kz) || is_array($studiengang_kz)) { + if (is_array($studiengang_kz)) + { + $studiengang_kz = implode(', ', $studiengang_kz); + } $condition = ' funktion_kurzbz = \'Leitung\' AND ( datum_von <= NOW() OR datum_von IS NULL ) AND ( datum_bis >= NOW() OR datum_bis IS NULL ) - AND studiengang_kz = ' . $this->db->escape($studiengang_kz) + AND studiengang_kz IN (' . $this->db->escape($studiengang_kz). ')'; ; } From d2055f759e71fb8bf144b612697c762516411ca5 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 21 Feb 2022 16:52:13 +0100 Subject: [PATCH 13/25] Added method getAssistance in Studiengang Model --- .../models/organisation/Studiengang_model.php | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index d928f4e61..a27d07f8b 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -487,6 +487,45 @@ class Studiengang_model extends DB_Model return $this->loadWhere($condition); } + /** + * Get Assistance/s of Studiengang/Studiengaenge. + * + * @param null $studiengang_kz String or Array + * @return array + */ + public function getAssistance($studiengang_kz = null) + { + $this->addSelect('uid, studiengang_kz, oe_kurzbz, vorname, nachname, email'); + $this->addJoin('public.tbl_benutzerfunktion', 'oe_kurzbz'); + $this->addJoin('public.tbl_benutzer', 'uid'); + $this->addJoin('public.tbl_person', 'person_id'); + + if (is_null($studiengang_kz)) + { + $condition = ' + funktion_kurzbz = \'Leitung\' + AND ( datum_von <= NOW() OR datum_von IS NULL ) + AND ( datum_bis >= NOW() OR datum_bis IS NULL ) + '; + } + elseif (is_numeric($studiengang_kz) || is_array($studiengang_kz)) + { + if (is_array($studiengang_kz)) + { + $studiengang_kz = implode(', ', $studiengang_kz); + } + + $condition = ' + funktion_kurzbz = \'ass\' + AND ( datum_von <= NOW() OR datum_von IS NULL ) + AND ( datum_bis >= NOW() OR datum_bis IS NULL ) + AND studiengang_kz IN (' . $this->db->escape($studiengang_kz). ')' + ; + } + + return $this->loadWhere($condition); + } + public function getStudiengaengeWithOrgForm($typ, $semester) { $query = "SELECT DISTINCT (UPPER(sg.typ || sg.kurzbz || ':' || sp.orgform_kurzbz)) AS Studiengang From b1f171aee2390befad72b15eff9bcbcb2a17f8b6 Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 21 Feb 2022 16:53:30 +0100 Subject: [PATCH 14/25] Changed permission function to allow stgl assistance download on Uebersicht- and Detailseite --- .../anrechnung/ApproveAnrechnungDetail.php | 38 +++++++++++++------ .../ApproveAnrechnungUebersicht.php | 20 +++++++++- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php index e98b09bdb..b818546fc 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php @@ -471,21 +471,35 @@ class approveAnrechnungDetail extends Auth_Controller 'lehrveranstaltung_id' => $result->lehrveranstaltung_id )); - if(!$result = getData($result)[0]) - { - show_error('Failed loading Lehrveranstaltung'); - } + $studiengang_kz = getData($result)[0]->studiengang_kz; // Get STGL - $result = $this->StudiengangModel->getLeitung($result->studiengang_kz); + $result = $this->StudiengangModel->getLeitung($studiengang_kz); - if($result = getData($result)[0]) - { - if ($result->uid == $this->_uid) - { - return; - } - } + if (hasData($result)) + { + foreach (getData($result) as $stgl) + { + if ($stgl->uid == $this->_uid) + { + return; + } + } + } + + // Check if user is Assistance + $result = $this->StudiengangModel->getAssistance($studiengang_kz); + + if (hasData($result)) + { + foreach (getData($result) as $assistance) + { + if ($assistance->uid == $this->_uid) + { + return; + } + } + } show_error('You are not entitled to read this document'); } diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 311828144..c667c9d33 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -281,9 +281,11 @@ class approveAnrechnungUebersicht extends Auth_Controller { show_error('Failed loading Lehrveranstaltung'); } + + $studiengang_kz = $result->studiengang_kz; - // Get STGL - $result = $this->StudiengangModel->getLeitung($result->studiengang_kz); + // Check if user is STGL + $result = $this->StudiengangModel->getLeitung($studiengang_kz); if (hasData($result)) { @@ -295,6 +297,20 @@ class approveAnrechnungUebersicht extends Auth_Controller } } } + + // Check if user is Assistance + $result = $this->StudiengangModel->getAssistance($studiengang_kz); + + if (hasData($result)) + { + foreach (getData($result) as $assistance) + { + if ($assistance->uid == $this->_uid) + { + return; + } + } + } show_error('You are not entitled to read this document'); } From 9abc018e086c44a8369223ebbd5242b9598db87f Mon Sep 17 00:00:00 2001 From: Cris Date: Mon, 21 Feb 2022 17:19:02 +0100 Subject: [PATCH 15/25] Removed db->escape when using getLeitung/getAssistance method ...it throws an error since query was adapted to accept array and anyway, is not necessary anymore. --- application/models/organisation/Studiengang_model.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index a27d07f8b..299b24d86 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -480,7 +480,7 @@ class Studiengang_model extends DB_Model funktion_kurzbz = \'Leitung\' AND ( datum_von <= NOW() OR datum_von IS NULL ) AND ( datum_bis >= NOW() OR datum_bis IS NULL ) - AND studiengang_kz IN (' . $this->db->escape($studiengang_kz). ')'; + AND studiengang_kz IN (' . $studiengang_kz. ')'; ; } @@ -519,7 +519,7 @@ class Studiengang_model extends DB_Model funktion_kurzbz = \'ass\' AND ( datum_von <= NOW() OR datum_von IS NULL ) AND ( datum_bis >= NOW() OR datum_bis IS NULL ) - AND studiengang_kz IN (' . $this->db->escape($studiengang_kz). ')' + AND studiengang_kz IN (' . $studiengang_kz. ')' ; } From 841247aa067529ceeac529f03b26df9798cbc19c Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 22 Feb 2022 12:23:12 +0100 Subject: [PATCH 16/25] download von identitaetsnachweis hinzugefuegt onholddate als default spalte hinzugefuegt --- .../system/infocenter/infocenterData.php | 4 +++ .../infocenter/infocenterFreigegebenData.php | 27 +++++++++++++++++-- system/filtersupdate.php | 6 +++-- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php index d867c8613..f3849d622 100644 --- a/application/views/system/infocenter/infocenterData.php +++ b/application/views/system/infocenter/infocenterData.php @@ -414,6 +414,10 @@ { $datasetRaw->{'OnholdDate'} = '-'; } + else + { + $datasetRaw->{'OnholdDate'} = date_format(date_create($datasetRaw->{'OnholdDate'}), 'Y-m-d H:i'); + } if ($datasetRaw->{'StgAbgeschickt'} == null) { diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php index 39b1e3cca..92f062b62 100644 --- a/application/views/system/infocenter/infocenterFreigegebenData.php +++ b/application/views/system/infocenter/infocenterFreigegebenData.php @@ -11,6 +11,7 @@ $STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\''; $STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\''; $ORG_NAME = '\'InfoCenter\''; + $IDENTITY = '\'identity\''; $query = ' SELECT @@ -245,7 +246,15 @@ $query = ' LIMIT 1 ) LIMIT 1 - ) AS "InfoCenterMitarbeiter" + ) AS "InfoCenterMitarbeiter", + ( + SELECT akte.akte_id + FROM public.tbl_akte akte + JOIN public.tbl_dokument USING (dokument_kurzbz) + WHERE akte.person_id = p.person_id + AND dokument_kurzbz = '. $IDENTITY .' + LIMIT 1 + ) AS "AktenId" FROM public.tbl_person p LEFT JOIN ( SELECT tpl.person_id, @@ -317,7 +326,8 @@ $query = ' 'Reihungstest date', 'ZGV Nation BA', 'ZGV Nation MA', - 'InfoCenter Mitarbeiter' + 'InfoCenter Mitarbeiter', + 'Identitätsnachweis' ), 'formatRow' => function($datasetRaw) { @@ -425,6 +435,19 @@ $query = ' $datasetRaw->{'InfoCenterMitarbeiter'} = 'Ja'; } + if ($datasetRaw->{'AktenId'} !== null) + { + $datasetRaw->{'AktenId'} = sprintf( + 'Identitätsnachweis', + $datasetRaw->{'AktenId'} + ); + } + else + { + $datasetRaw->{'AktenId'} = '-'; + } + + return $datasetRaw; }, 'markRow' => function($datasetRaw) { diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 1a1717339..812dd9493 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -40,7 +40,8 @@ $filters = array( {"name": "LastActionType"}, {"name": "User/Operator"}, {"name": "InfoCenterMitarbeiter"}, - {"name": "LockUser"} + {"name": "LockUser"}, + {"name": "OnholdDate"} ], "filters": [ { @@ -320,7 +321,8 @@ $filters = array( {"name": "Statusgrund"}, {"name": "Studiensemester"}, {"name": "ReihungstestApplied"}, - {"name": "ReihungstestDate"} + {"name": "ReihungstestDate"}, + {"name": "AktenId"} ], "filters": [ { From 22b0e9f941971ef028016f674de9a6053efa7335 Mon Sep 17 00:00:00 2001 From: ma0048 Date: Tue, 22 Feb 2022 12:25:39 +0100 Subject: [PATCH 17/25] name in die mails hinzugefuegt --- .../system/infocenter/InfoCenter.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index a69a43220..143fb8444 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -560,8 +560,10 @@ class InfoCenter extends Auth_Controller /** * Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang */ - private function sendZgvMail($mail, $typ){ + private function sendZgvMail($mail, $typ, $person){ $data = array( + 'vorname' => $person->vorname, + 'nachname' => $person->nachname, 'link' => site_url('system/infocenter/ZGVUeberpruefung') ); @@ -657,6 +659,16 @@ class InfoCenter extends Auth_Controller if (isEmptyString($prestudent_id) || isEmptyString($person_id)) $this->terminateWithJsonError('Prestudentid OR/AND Personid missing'); + $person = $this->PersonModel->load($person_id); + + if (isError($person)) + $this->terminateWithJsonError(getError($person)); + + if (!hasData($person)) + $this->terminateWithJsonError('Person existiert nicht.'); + + $person = getData($person)[0]; + $zgv = $this->ZGVPruefungStatusModel->getZgvStatusByPrestudent($prestudent_id); $data = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); @@ -688,7 +700,7 @@ class InfoCenter extends Auth_Controller $this->_log($person_id, 'updatezgv', array($zgv[0]->zgvpruefung_id, 'pruefung_stg')); if (isSuccess($insert)) - $this->sendZgvMail($mail, $typ); + $this->sendZgvMail($mail, $typ, $person); elseif (isError($insert)) $this->terminateWithJsonError('Fehler beim Speichern'); }else @@ -714,7 +726,7 @@ class InfoCenter extends Auth_Controller $this->_log($person_id, 'newzgv', array($zgvpruefung_id)); if (isSuccess($result)) - $this->sendZgvMail($mail, $typ); + $this->sendZgvMail($mail, $typ, $person); elseif (isError($result)) $this->terminateWithJsonError('Fehler beim Speichern'); } From 339f82291c60f77a26c507a58c6b68c4dbb30b13 Mon Sep 17 00:00:00 2001 From: Cris Date: Tue, 22 Feb 2022 16:26:33 +0100 Subject: [PATCH 18/25] Disabled edit elements / create Anrechnung in GUI if user has readonly access / no permission to create Anrechnung --- .../anrechnung/ApproveAnrechnungDetail.php | 7 +++- .../ApproveAnrechnungUebersicht.php | 16 +++++++-- application/libraries/AnrechnungLib.php | 1 + .../anrechnung/approveAnrechnungDetail.php | 5 +-- .../approveAnrechnungUebersicht.php | 7 ++-- .../anrechnung/approveAnrechnungDetail.js | 34 ++++++++++++++++++ .../anrechnung/approveAnrechnungUebersicht.js | 36 +++++++++++++++++++ system/phrasesupdate.php | 22 +++++++++++- 8 files changed, 118 insertions(+), 10 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php index b818546fc..5a3c4ba27 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php @@ -99,11 +99,16 @@ class approveAnrechnungDetail extends Auth_Controller // Get Genehmigung data $genehmigungData = $this->anrechnunglib->getGenehmigungData($anrechnung_id); + $hasReadOnlyAccess = + $this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $antragData->studiengang_kz) + && !$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 'suid', $antragData->studiengang_kz); + $viewData = array( 'antragData' => $antragData, 'anrechnungData' => $anrechnungData, 'empfehlungData' => $empfehlungData, - 'genehmigungData' => $genehmigungData + 'genehmigungData' => $genehmigungData, + 'hasReadOnlyAccess' => $hasReadOnlyAccess ); $this->load->view('lehre/anrechnung/approveAnrechnungDetail.php', $viewData); diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index c667c9d33..2030f9923 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -5,7 +5,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); class approveAnrechnungUebersicht extends Auth_Controller { const BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN = 'lehre/anrechnung_genehmigen'; - + const BERECHTIGUNG_ANRECHNUNG_ANLEGEN = 'lehre/anrechnung_anlegen'; + const REVIEW_ANRECHNUNG_URI = '/lehre/anrechnung/ReviewAnrechnungUebersicht'; const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; @@ -76,10 +77,19 @@ class approveAnrechnungUebersicht extends Auth_Controller { show_error(getError($studiengang_kz_arr)); } - + + $hasReadOnlyAccess = + $this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's') + && !$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 'suid'); + + // This permission is checked here to disable create Anrechnung button, if permission is not given + $hasCreateAnrechnungAccess = $this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_ANLEGEN, 's'); + $viewData = array( 'studiensemester_selected' => $studiensemester_kurzbz, - 'studiengaenge_entitled' => $studiengang_kz_arr + 'studiengaenge_entitled' => $studiengang_kz_arr, + 'hasReadOnlyAccess' => $hasReadOnlyAccess, + 'hasCreateAnrechnungAccess' => $hasCreateAnrechnungAccess ); $this->load->view('lehre/anrechnung/approveAnrechnungUebersicht.php', $viewData); diff --git a/application/libraries/AnrechnungLib.php b/application/libraries/AnrechnungLib.php index 3bec62dce..ee197ab05 100644 --- a/application/libraries/AnrechnungLib.php +++ b/application/libraries/AnrechnungLib.php @@ -89,6 +89,7 @@ class AnrechnungLib $antrag_data->vorname = $person->vorname; $antrag_data->nachname = $person->nachname; $antrag_data->matrikelnr = $student->matrikelnr; + $antrag_data->studiengang_kz = $studiengang->studiengang_kz; $antrag_data->stg_bezeichnung = $studiengang->bezeichnung; $antrag_data->lektoren = $lv_lektoren_arr; $antrag_data->zgv = $latest_zgv_bezeichnung; diff --git a/application/views/lehre/anrechnung/approveAnrechnungDetail.php b/application/views/lehre/anrechnung/approveAnrechnungDetail.php index 4603708f4..cd38fd9ac 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungDetail.php +++ b/application/views/lehre/anrechnung/approveAnrechnungDetail.php @@ -25,7 +25,8 @@ $this->load->view( 'bitteBegruendungAngeben', 'empfehlungWurdeAngefordert', 'anrechnungenWurdenGenehmigt', - 'anrechnungenWurdenAbgelehnt' + 'anrechnungenWurdenAbgelehnt', + 'nurLeseberechtigung' ), 'person' => array( 'student', @@ -72,7 +73,7 @@ $this->load->view( -
+
diff --git a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php index 850affeea..308f702a3 100644 --- a/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php +++ b/application/views/lehre/anrechnung/approveAnrechnungUebersicht.php @@ -48,7 +48,8 @@ $this->load->view( 'empfehlungWurdeAngefordert', 'empfehlungWurdeAngefordertAusnahmeWoKeineLektoren', 'anrechnungenWurdenGenehmigt', - 'anrechnungenWurdenAbgelehnt' + 'anrechnungenWurdenAbgelehnt', + 'nurLeseberechtigung' ), 'person' => array( 'student', @@ -101,7 +102,7 @@ $this->load->view(
-
+
widgetlib->widget( @@ -226,7 +227,7 @@ $this->load->view( class='fa fa-times'>
- ' target='_blank'> + ' target='_blank'> p->t('global', 'antragAnlegen'); ?>
diff --git a/public/js/lehre/anrechnung/approveAnrechnungDetail.js b/public/js/lehre/anrechnung/approveAnrechnungDetail.js index c2c2899ee..c5c0519f3 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungDetail.js +++ b/public/js/lehre/anrechnung/approveAnrechnungDetail.js @@ -10,6 +10,7 @@ $(function(){ const genehmigung_panel = $('#approveAnrechnungDetail-genehmigung-panel'); const begruendung_panel = $('#approveAnrechnungDetail-begruendung-panel'); + const hasReadOnlyAccess = $('#approveAnrechnungDetail-generell').data('readonly'); // Pruefen ob Promise unterstuetzt wird // Tabulator funktioniert nicht mit IE @@ -21,6 +22,11 @@ $(function(){ return; } + if (hasReadOnlyAccess) + { + approveAnrechnungDetail.disableEditElements(); + } + // Set status alert color approveAnrechnungDetail.setStatusAlertColor(); @@ -417,6 +423,34 @@ var approveAnrechnungDetail = { } ); }, + disableEditElements: function() + { + // Disable: + // ...button Empfehlung anfordern + $('#approveAnrechnungDetail-request-recommendation') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Empfehlung zuruecknehmen + $('#approveAnrechnungDetail-withdraw-request-recommedation') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Genehmigen + $('#approveAnrechnungDetail-approve-anrechnung-ask') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Ablehnen + $('#approveAnrechnungDetail-reject-anrechnung-ask') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Genehmigung zurücknehmen + $('#approveAnrechnungDetail-withdraw-anrechnung-approvement') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ... form Empfehlungsnotiz + $('#form-empfehlungNotiz :input') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + }, copyIntoTextarea: function(elem){ // Find closest textarea diff --git a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js index ff3235e52..fe78217b9 100644 --- a/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js +++ b/public/js/lehre/anrechnung/approveAnrechnungUebersicht.js @@ -148,6 +148,8 @@ $(function(){ const genehmigung_panel = $('#approveAnrechnungUebersicht-genehmigung-panel'); const begruendung_panel = $('#approveAnrechnungUebersicht-begruendung-panel'); + const hasReadOnlyAccess = $('#formApproveAnrechnungUebersicht').data('readonly'); + const hasCreateAnrechnungAccess = $('#formApproveAnrechnungUebersicht').data('createaccess'); // Pruefen ob Promise unterstuetzt wird // Tabulator funktioniert nicht mit IE @@ -165,6 +167,16 @@ $(function(){ $('#tableWidgetTabulator').tabulator('redraw', true); }); + if (hasReadOnlyAccess) + { + approveAnrechnung.disableEditElements(); + } + + if (!hasCreateAnrechnungAccess) + { + approveAnrechnung.disableCreateAnrechnungButton(); + } + // Set status alert color approveAnrechnung.setStatusAlertColor(); @@ -517,6 +529,30 @@ var approveAnrechnung = { $('#requestAnrechnung-status_kurzbz').closest('div').addClass('alert-warning'); } }, + disableEditElements: function() + { + // Disable: + // ...button Empfehlung anfordern + $('#approveAnrechnungUebersicht-request-recommendation') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Ablehnen + $('#approveAnrechnungUebersicht-reject-anrechnungen-ask') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + // ...button Genehmigen + $('#approveAnrechnungUebersicht-approve-anrechnungen-ask') + .prop('disabled', true) + .attr('title', FHC_PhrasesLib.t("ui", "nurLeseberechtigung")); + + }, + disableCreateAnrechnungButton: function() + { + // Disable button Antrag anlegen + $('#approveAnrechnungUebersicht-create-anrechnung') + .removeAttr('href') + .css({'color': 'grey', 'pointer-events': 'none'}); // property disabled does not work for link + }, copyIntoTextarea: function(elem){ // Find closest textarea diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index 1baffa93b..f96b0eb0c 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -13694,7 +13694,27 @@ array( 'insertvon' => 'system' ) ) - ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'nurLeseberechtigung', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => "Nur Leseberechtigung", + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => "Read-Only Access", + 'description' => '', + 'insertvon' => 'system' + ) + ) + ) ); From 09954c479ca08f9d92e8d01781d5c46558050929 Mon Sep 17 00:00:00 2001 From: Cris Date: Wed, 23 Feb 2022 09:45:45 +0100 Subject: [PATCH 19/25] Changed: Now checking by permission and not by benutzerfunktion Before, permission for page access and download was checked by benutzerfunktion. This did not allow access by user with corresponding permissions, like admins. Therfore changed to check by permission only. --- .../anrechnung/ApproveAnrechnungDetail.php | 64 +++---------------- .../ApproveAnrechnungUebersicht.php | 32 ++-------- 2 files changed, 12 insertions(+), 84 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php index 5a3c4ba27..28edf4824 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php @@ -81,7 +81,7 @@ class approveAnrechnungDetail extends Auth_Controller } // Check if user is entitled to read the Anrechnung - self::_checkIfEntitledToReadAnrechnung($anrechnung_id); + $this->_checkIfEntitledToReadAnrechnung($anrechnung_id); // Get Anrechung data $anrechnungData = $this->anrechnunglib->getAnrechnungData($anrechnung_id); @@ -390,7 +390,7 @@ class approveAnrechnungDetail extends Auth_Controller } // Check if user is entitled to read dms doc - self::_checkIfEntitledToReadDMSDoc($dms_id); + $this->_checkIfEntitledToReadDMSDoc($dms_id); // Set filename to be used on downlaod $filename = $this->anrechnunglib->setFilenameOnDownload($dms_id); @@ -428,35 +428,11 @@ class approveAnrechnungDetail extends Auth_Controller $studiengang_kz = getData($result)[0]->studiengang_kz; - // Check if user is STGL - $result = $this->StudiengangModel->getLeitung($studiengang_kz); - - if (hasData($result)) - { - foreach (getData($result) as $stgl) - { - if ($stgl->uid == $this->_uid) - { - return; - } - } - } - - // Check if user is Assistance - $result = $this->StudiengangModel->getAssistance($studiengang_kz); - - if (hasData($result)) + // Check if user is entitled + if (!$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $studiengang_kz)) { - foreach (getData($result) as $assistance) - { - if ($assistance->uid == $this->_uid) - { - return; - } - } + show_error('You are not entitled to read this page'); } - - show_error('You are not entitled to read this Anrechnung'); } /** @@ -478,35 +454,11 @@ class approveAnrechnungDetail extends Auth_Controller $studiengang_kz = getData($result)[0]->studiengang_kz; - // Get STGL - $result = $this->StudiengangModel->getLeitung($studiengang_kz); - - if (hasData($result)) + // Check if user is entitled + if (!$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $studiengang_kz)) { - foreach (getData($result) as $stgl) - { - if ($stgl->uid == $this->_uid) - { - return; - } - } + show_error('You are not entitled to read this document'); } - - // Check if user is Assistance - $result = $this->StudiengangModel->getAssistance($studiengang_kz); - - if (hasData($result)) - { - foreach (getData($result) as $assistance) - { - if ($assistance->uid == $this->_uid) - { - return; - } - } - } - - show_error('You are not entitled to read this document'); } /** diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index 2030f9923..053988848 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -249,7 +249,7 @@ class approveAnrechnungUebersicht extends Auth_Controller } // Check if user is entitled to read dms doc - self::_checkIfEntitledToReadDMSDoc($dms_id); + $this->_checkIfEntitledToReadDMSDoc($dms_id); // Set filename to be used on downlaod $filename = $this->anrechnunglib->setFilenameOnDownload($dms_id); @@ -294,35 +294,11 @@ class approveAnrechnungUebersicht extends Auth_Controller $studiengang_kz = $result->studiengang_kz; - // Check if user is STGL - $result = $this->StudiengangModel->getLeitung($studiengang_kz); - - if (hasData($result)) - { - foreach (getData($result) as $stgl) - { - if ($stgl->uid == $this->_uid) - { - return; - } - } - } - - // Check if user is Assistance - $result = $this->StudiengangModel->getAssistance($studiengang_kz); - - if (hasData($result)) + // Check if user is entitled + if (!$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's', $studiengang_kz)) { - foreach (getData($result) as $assistance) - { - if ($assistance->uid == $this->_uid) - { - return; - } - } + show_error('You are not entitled to read this document'); } - - show_error('You are not entitled to read this document'); } /** From a4c80b7969aaedc32aa05bf0a4ae4f372ef5c90d Mon Sep 17 00:00:00 2001 From: ma0048 Date: Wed, 23 Feb 2022 15:00:14 +0100 Subject: [PATCH 20/25] reihenfolge der spalten angepasst --- system/filtersupdate.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/system/filtersupdate.php b/system/filtersupdate.php index 812dd9493..92053cb56 100644 --- a/system/filtersupdate.php +++ b/system/filtersupdate.php @@ -35,7 +35,6 @@ $filters = array( {"name": "ZGVNation"}, {"name": "ZGVMNation"}, {"name": "StgAbgeschickt"}, - {"name": "Studiensemester"}, {"name": "LastAction"}, {"name": "LastActionType"}, {"name": "User/Operator"}, @@ -312,6 +311,7 @@ $filters = array( "columns": [ {"name": "Vorname"}, {"name": "Nachname"}, + {"name": "AktenId"}, {"name": "StgAbgeschickt"}, {"name": "LastAction"}, {"name": "LastActionType"}, @@ -321,8 +321,7 @@ $filters = array( {"name": "Statusgrund"}, {"name": "Studiensemester"}, {"name": "ReihungstestApplied"}, - {"name": "ReihungstestDate"}, - {"name": "AktenId"} + {"name": "ReihungstestDate"} ], "filters": [ { From 95c7f083d4ef89df0dd60b280ad0475d77ea53af Mon Sep 17 00:00:00 2001 From: Manfred Date: Wed, 23 Feb 2022 16:17:13 +0100 Subject: [PATCH 21/25] CSV-Export aus dem Reporting mit Komma statt Punkt --- include/statistik.class.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/statistik.class.php b/include/statistik.class.php index 3075250b5..eab9f930d 100644 --- a/include/statistik.class.php +++ b/include/statistik.class.php @@ -553,6 +553,12 @@ class statistik extends basis_db { $name = $this->db_field_name($this->data,$spalte); $this->html.= ''.$this->convert_html_chars($row->$name).''; + // Umwandeln von Punkt in Komma bei Float-Werten + if (is_numeric($row->$name)) + { + if (strpos($row->$name,'.') != false) + $row->$name = number_format($row->$name,2,",",""); + } $this->csv.= '"'.$row->$name.'",'; } From f47f952b0a57e01ab90e990efb32b323f8ade2c8 Mon Sep 17 00:00:00 2001 From: Manfred Date: Wed, 23 Feb 2022 16:20:29 +0100 Subject: [PATCH 22/25] =?UTF-8?q?Get-Param=20norefresh=20f=C3=BCr=20Inform?= =?UTF-8?q?ationsbildschirm=20unterdr=C3=BCckt=20refresh?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cis/infoterminal/informationsbildschirm.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cis/infoterminal/informationsbildschirm.php b/cis/infoterminal/informationsbildschirm.php index bd3abbe50..caf174846 100644 --- a/cis/infoterminal/informationsbildschirm.php +++ b/cis/infoterminal/informationsbildschirm.php @@ -37,6 +37,11 @@ else $ip = $_SERVER["REMOTE_ADDR"]; } +if(isset($_GET['norefresh'])) + $norefresh = true; +else + $norefresh = false; + $infoscreen = new infoscreen(); $i=-1; $refreshzeit = 40; // Default Refreshzeit @@ -90,9 +95,12 @@ if(isset($infoscreen_content) && isset($infoscreen_content[$aktuellerContentIdx] echo ' - - - + '; + if (!$norefresh) + { + echo ''; + } +echo ' '; //Skript fuer den automatischen bildlauf From e402c8cdf965382af462b69476ee0adf82b3aa7a Mon Sep 17 00:00:00 2001 From: Manfred Date: Wed, 23 Feb 2022 16:22:30 +0100 Subject: [PATCH 23/25] Filter Widget in Tablesorter und Row-Count --- .../benutzerberechtigung_uebersicht.php | 58 +++++++++++-------- 1 file changed, 33 insertions(+), 25 deletions(-) diff --git a/vilesci/stammdaten/benutzerberechtigung_uebersicht.php b/vilesci/stammdaten/benutzerberechtigung_uebersicht.php index 8ab988963..655ce058e 100644 --- a/vilesci/stammdaten/benutzerberechtigung_uebersicht.php +++ b/vilesci/stammdaten/benutzerberechtigung_uebersicht.php @@ -86,9 +86,22 @@ $(document).ready(function() $("#t3").tablesorter( { sortList: [[1,0],[2,0],[3,0]], - widgets: ["zebra"], + widgets: ["zebra", "filter", "stickyHeaders"], headers: {8:{sorter:false}}, - emptyTo: "emptyMax" + emptyTo: "emptyMax", + widgetOptions : { filter_functions: + { + // Add select menu to this column + 6 : { + "Ja" : function(e, n, f, i, $r, c, data) { return /Ja/.test(e); }, + "Nein" : function(e, n, f, i, $r, c, data) { return /Nein/.test(e); } + }, + 7 : { + "Aktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonGreen" ); }, + "Inaktiv" : function(e, n, f, i, $r, c, data) { return $r.find("div").hasClass( "buttonRed" ) || $r.find("div").hasClass( "buttonYellow" ); } + } + } + } }); $("#t4").tablesorter( { @@ -528,8 +541,22 @@ if($rolle_kurzbz != '') if(isset($rollen->result) && count($rollen->result) != 0) { + // Anzahl uniquer UIDs ermitteln + $berechtigungen_array_uids = sizeof(array_column($rollen->result, null, 'uid')); + + $htmlstr .= "

".$berechtigung_kurzbz."

\n"; + $htmlstr .= "
".count($rollen->result)." Einträge
"; + $htmlstr .= "
".$berechtigungen_array_uids." UIDs
"; $htmlstr .= "\n"; - $htmlstr .= ""; + $htmlstr .= " + + + + + + + + "; $htmlstr .= "\n"; foreach($rollen->result as $row) @@ -541,35 +568,16 @@ if($rolle_kurzbz != '') if ($row->ende!='' && strtotime($row->ende) < $heute) { - $color1 = '#f79c9c'; - $color2 = '#cc0202'; + $status = '
'; } elseif ($row->start!='' && strtotime($row->start) > $heute) { - $color1 = '#faf7b9'; - $color2 = '#cfde00'; + $status = '
'; } else { - $color1 = '#d1fab9'; - $color2 = '#00de00'; + $status = '
'; } - $status='
'; $htmlstr .= ' '; $htmlstr .= ' '; From 4a509fa9d041328ce9191688ed2b873ade153d26 Mon Sep 17 00:00:00 2001 From: Manfred Date: Wed, 23 Feb 2022 16:29:46 +0100 Subject: [PATCH 24/25] =?UTF-8?q?Aktueller=20Status=20wird=20aus=20den=20?= =?UTF-8?q?=C3=BCbergebenen=20Studiensemester=20ermittelt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rdf/studienblatt.xml.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rdf/studienblatt.xml.php b/rdf/studienblatt.xml.php index 83a2fcc9c..f0caadeb8 100644 --- a/rdf/studienblatt.xml.php +++ b/rdf/studienblatt.xml.php @@ -158,7 +158,7 @@ foreach($uid_arr as $uid) echo "\t\tregelstudiendauer!=0?$studienplan->ects_stpl/$studienplan->regelstudiendauer:0)."]]>"; echo "\t\t"; - $status_aktuell = ($prestudent->getLastStatus($student->prestudent_id,null,null))?$prestudent->status_kurzbz:''; + $status_aktuell = ($prestudent->getLastStatus($student->prestudent_id,$studiensemester,null))?$prestudent->status_kurzbz:''; $abbrecher = false; $absolvent = false; From 18731ede47f7f5fb03d09df8de6fc3f013057f1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20=C3=96sterreicher?= Date: Fri, 25 Feb 2022 11:59:38 +0100 Subject: [PATCH 25/25] Laden von Studiengangsleitungen angepasst, Error Handling bei fehenden Studiengangsleitungen --- .../anrechnung/ReviewAnrechnungDetail.php | 31 +++-- .../anrechnung/ReviewAnrechnungUebersicht.php | 115 ++++++++++-------- .../models/organisation/Studiengang_model.php | 53 ++------ 3 files changed, 92 insertions(+), 107 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php index 78175f4e6..7981f0ac8 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungDetail.php @@ -79,7 +79,7 @@ class reviewAnrechnungDetail extends Auth_Controller // Get Anrechung data $anrechnungData = $this->anrechnunglib->getAnrechnungData($anrechnung_id); - + // Get Antrag data $antragData = $this->anrechnunglib->getAntragData( $anrechnungData->prestudent_id, @@ -110,7 +110,7 @@ class reviewAnrechnungDetail extends Auth_Controller { return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - + // Get lectors person data if (!$person = getData($this->PersonModel->getByUID($this->_uid))[0]) { @@ -218,10 +218,10 @@ class reviewAnrechnungDetail extends Auth_Controller // Check if user is entitled to read dms doc self::_checkIfEntitledToReadDMSDoc($dms_id); - + // Set filename to be used on downlaod $filename = $this->anrechnunglib->setFilenameOnDownload($dms_id); - + // Download file $this->dmslib->download($dms_id, $filename); } @@ -320,7 +320,12 @@ class reviewAnrechnungDetail extends Auth_Controller foreach ($studiengang_kz_arr as $studiengang_kz) { // Get STGL mail address, if available, otherwise get assistance mail address - list ($to, $vorname) = $this->_getSTGLMailAddress($studiengang_kz); + $stgmail = $this->_getSTGLMailAddress($studiengang_kz); + + if(isSuccess($stgmail) && hasData($stgmail)) + list ($to, $vorname) = getData($stgmail)[0]; + else + show_error ('Failed retrieving DegreeProgram Mail'); // Get full name of lector $this->load->model('person/Person_model', 'PersonModel'); @@ -361,24 +366,28 @@ class reviewAnrechnungDetail extends Auth_Controller $result = $this->StudiengangModel->getLeitung($stg_kz); // Get STGL mail address, if available - if (hasData($result)) + if (isSuccess($result) && hasData($result)) { - return array( + return success(array( $result->retval[0]->uid. '@'. DOMAIN, $result->retval[0]->vorname - ); + )); } // ...otherwise get assistance mail address else { $result = $this->StudiengangModel->load($stg_kz); - if (hasData($result)) + if (isSuccess($result) && hasData($result)) { - return array( + return success(array( $result->retval[0]->email, '' - ); + )); + } + else + { + return error('Keine E-Mail für diesen Stg gefunden'); } } } diff --git a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php index cd0b7afaf..e5475d0d0 100644 --- a/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ReviewAnrechnungUebersicht.php @@ -5,15 +5,15 @@ if (! defined('BASEPATH')) exit('No direct script access allowed'); class reviewAnrechnungUebersicht extends Auth_Controller { const BERECHTIGUNG_ANRECHNUNG_EMPFEHLEN = 'lehre/anrechnung_empfehlen'; - + const APPROVE_ANRECHNUNG_URI = '/lehre/anrechnung/ApproveAnrechnungUebersicht'; - + const ANRECHNUNGSTATUS_PROGRESSED_BY_STGL = 'inProgressDP'; const ANRECHNUNGSTATUS_PROGRESSED_BY_KF = 'inProgressKF'; const ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR = 'inProgressLektor'; const ANRECHNUNGSTATUS_APPROVED = 'approved'; const ANRECHNUNGSTATUS_REJECTED = 'rejected'; - + public function __construct() { // Set required permissions @@ -25,24 +25,24 @@ class reviewAnrechnungUebersicht extends Auth_Controller 'dontRecommend' => 'lehre/anrechnung_empfehlen:rw' ) ); - + // Load models $this->load->model('education/Anrechnung_model', 'AnrechnungModel'); $this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel'); $this->load->model('content/DmsVersion_model', 'DmsVersionModel'); $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); - + // Load libraries $this->load->library('WidgetLib'); $this->load->library('PermissionLib'); $this->load->library('AnrechnungLib'); $this->load->library('DmsLib'); - + // Load helpers $this->load->helper('form'); $this->load->helper('url'); $this->load->helper('hlp_sancho_helper'); - + // Load language phrases $this->loadPhrases( array( @@ -54,12 +54,12 @@ class reviewAnrechnungUebersicht extends Auth_Controller 'table' ) ); - + $this->_setAuthUID(); - + $this->setControllerId(); } - + public function index() { // Get study semester @@ -70,14 +70,14 @@ class reviewAnrechnungUebersicht extends Auth_Controller $result = $this->StudiensemesterModel->getNearest(); $studiensemester_kurzbz = getData($result)[0]->studiensemester_kurzbz; } - + $viewData = array( 'studiensemester_selected' => $studiensemester_kurzbz ); - + $this->load->view('lehre/anrechnung/reviewAnrechnungUebersicht.php', $viewData); } - + /** * Recommend Anrechnungen. */ @@ -103,7 +103,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller ); } } - + // Output json to ajax if (isset($json) && !isEmptyArray($json)) { @@ -123,19 +123,19 @@ class reviewAnrechnungUebersicht extends Auth_Controller return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt')); } } - + /** * Dont recommend Anrechnungen. */ public function dontRecommend() { $data = $this->input->post('data'); - + if(isEmptyArray($data)) { return $this->outputJsonError('Fehler beim Übertragen der Daten.'); } - + foreach ($data as $item) { // Approve Anrechnung @@ -149,7 +149,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller ); } } - + // Output json to ajax if (isset($json) && !isEmptyArray($json)) { @@ -158,7 +158,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller { show_error('Failed sending emails'); } - + return $this->outputJsonSuccess($json); } else @@ -166,7 +166,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt')); } } - + /** * Download and open uploaded document (Nachweisdokument). */ @@ -178,28 +178,28 @@ class reviewAnrechnungUebersicht extends Auth_Controller { show_error('Wrong parameter'); } - + // Check if user is entitled to read dms doc self::_checkIfEntitledToReadDMSDoc($dms_id); - + // Set filename to be used on downlaod $filename = $this->anrechnunglib->setFilenameOnDownload($dms_id); - + // Download file $this->dmslib->download($dms_id, $filename); } - - + + /** * Retrieve the UID of the logged user and checks if it is valid */ private function _setAuthUID() { $this->_uid = getAuthUID(); - + if (!$this->_uid) show_error('User authentification failed'); } - + /** * Check if user is entitled to read dms doc * @param $dms_id @@ -207,15 +207,15 @@ class reviewAnrechnungUebersicht extends Auth_Controller private function _checkIfEntitledToReadDMSDoc($dms_id) { $result = $this->AnrechnungModel->loadWhere(array('dms_id' => $dms_id)); - + if(!$result = getData($result)[0]) { show_error('Failed retrieving Anrechnung'); } - + $result = $this->LehrveranstaltungModel ->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id); - + if($result = getData($result)) { $entitled_lector_arr = array_column($result, 'uid'); @@ -225,10 +225,10 @@ class reviewAnrechnungUebersicht extends Auth_Controller return; } } - + show_error('You are not entitled to read this document'); } - + /** * Send mails to STGL (if not present then to STGL assistance) * @param $mail_params @@ -239,36 +239,41 @@ class reviewAnrechnungUebersicht extends Auth_Controller { // Get studiengaenge $studiengang_kz_arr = array(); - + foreach ($mail_params as $item) { $this->AnrechnungModel->addSelect('studiengang_kz'); $this->AnrechnungModel->addJoin('public.tbl_prestudent', 'prestudent_id'); - + $studiengang_kz_arr[]= $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->studiengang_kz; } - + $studiengang_kz_arr = array_unique($studiengang_kz_arr); - + // Send mail to STGL of each studiengang foreach ($studiengang_kz_arr as $studiengang_kz) { // Get STGL mail address, if available, otherwise get assistance mail address - list ($to, $vorname) = $this->_getSTGLMailAddress($studiengang_kz); - + $stgmail = $this->_getSTGLMailAddress($studiengang_kz); + + if(isSuccess($stgmail) && hasData($stgmail)) + list ($to, $vorname) = getData($stgmail)[0]; + else + show_error ('Failed retrieving DegreeProgram Mail'); + // Get full name of lector $this->load->model('person/Person_model', 'PersonModel'); if (!$lector_name = getData($this->PersonModel->getFullName($this->_uid))) { show_error ('Failed retrieving person'); } - + // Link to Antrag genehmigen $url = CIS_ROOT. 'cis/index.php?menu='. CIS_ROOT. 'cis/menu.php?content_id=&content='. CIS_ROOT. index_page(). self::APPROVE_ANRECHNUNG_URI; - + // Prepare mail content $body_fields = array( 'vorname' => $vorname, @@ -276,7 +281,7 @@ class reviewAnrechnungUebersicht extends Auth_Controller 'empfehlung' => $empfehlung ? 'positive' : 'negative', 'link' => anchor($url, 'Anrechnungsanträge Übersicht') ); - + sendSanchoMail( 'AnrechnungEmpfehlungAbgeben', $body_fields, @@ -284,37 +289,41 @@ class reviewAnrechnungUebersicht extends Auth_Controller 'Anerkennung nachgewiesener Kenntnisse: Empfehlung wurde abgegeben' ); } - + return true; } - + // Get STGL mail address, if available, otherwise get assistance mail address private function _getSTGLMailAddress($stg_kz) { $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); $result = $this->StudiengangModel->getLeitung($stg_kz); - + // Get STGL mail address, if available - if (hasData($result)) + if (isSuccess($result) && hasData($result)) { - return array( + return success(array( $result->retval[0]->uid. '@'. DOMAIN, $result->retval[0]->vorname - ); + )); } // ...otherwise get assistance mail address else { $result = $this->StudiengangModel->load($stg_kz); - - if (hasData($result)) + + if (isSuccess($result) && hasData($result)) { - return array( + return success(array( $result->retval[0]->email, '' - ); + )); + } + else + { + return error('Keine E-Mail für diesen Stg gefunden'); } } } - -} \ No newline at end of file + +} diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 299b24d86..e2b3bdfb7 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -448,10 +448,10 @@ class Studiengang_model extends DB_Model return $this->execQuery($query, array($typ)); } - + /** * Get Studiengangsleitung/en of Studiengang/Studiengaenge. - * + * * @param null $studiengang_kz Numeric or Array * @return array */ @@ -461,7 +461,12 @@ class Studiengang_model extends DB_Model $this->addJoin('public.tbl_benutzerfunktion', 'oe_kurzbz'); $this->addJoin('public.tbl_benutzer', 'uid'); $this->addJoin('public.tbl_person', 'person_id'); - + + if (!is_numeric($studiengang_kz) && !is_array($studiengang_kz)) + { + return error('Studiengangskennzahl ungültig'); + } + if (is_null($studiengang_kz)) { $condition = ' @@ -474,6 +479,7 @@ class Studiengang_model extends DB_Model { if (is_array($studiengang_kz)) { + $studiengang_kz = array_map(array($this,'escape'), $studiengang_kz); $studiengang_kz = implode(', ', $studiengang_kz); } $condition = ' @@ -483,49 +489,10 @@ class Studiengang_model extends DB_Model AND studiengang_kz IN (' . $studiengang_kz. ')'; ; } - + return $this->loadWhere($condition); } - /** - * Get Assistance/s of Studiengang/Studiengaenge. - * - * @param null $studiengang_kz String or Array - * @return array - */ - public function getAssistance($studiengang_kz = null) - { - $this->addSelect('uid, studiengang_kz, oe_kurzbz, vorname, nachname, email'); - $this->addJoin('public.tbl_benutzerfunktion', 'oe_kurzbz'); - $this->addJoin('public.tbl_benutzer', 'uid'); - $this->addJoin('public.tbl_person', 'person_id'); - - if (is_null($studiengang_kz)) - { - $condition = ' - funktion_kurzbz = \'Leitung\' - AND ( datum_von <= NOW() OR datum_von IS NULL ) - AND ( datum_bis >= NOW() OR datum_bis IS NULL ) - '; - } - elseif (is_numeric($studiengang_kz) || is_array($studiengang_kz)) - { - if (is_array($studiengang_kz)) - { - $studiengang_kz = implode(', ', $studiengang_kz); - } - - $condition = ' - funktion_kurzbz = \'ass\' - AND ( datum_von <= NOW() OR datum_von IS NULL ) - AND ( datum_bis >= NOW() OR datum_bis IS NULL ) - AND studiengang_kz IN (' . $studiengang_kz. ')' - ; - } - - return $this->loadWhere($condition); - } - public function getStudiengaengeWithOrgForm($typ, $semester) { $query = "SELECT DISTINCT (UPPER(sg.typ || sg.kurzbz || ':' || sp.orgform_kurzbz)) AS Studiengang
RolleFunktionNachnameVornameUIDArtBenutzer AktivStatusAktionRolleFunktionNachnameVornameUIDArtBenutzer AktivStatusAktion
'.$row->rolle_kurzbz.'