From 4f46476f877ec9c851446383b4c037d117cfc846 Mon Sep 17 00:00:00 2001 From: cris-technikum Date: Mon, 6 Sep 2021 12:56:43 +0200 Subject: [PATCH] Fixed: Now entitlement checked for all STGL. Also added hasData checks. Before only the first returning STGL was checked for entitlement. Also added hasData checks to avoid using getData on NULL values. Signed-off-by: cris-technikum --- .../anrechnung/ApproveAnrechnungDetail.php | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php index d76c0d79b..209ad75b9 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php @@ -412,28 +412,31 @@ class approveAnrechnungDetail extends Auth_Controller { $result = $this->AnrechnungModel->load($anrechnung_id); - if(!$result = getData($result)[0]) + if(!hasData($result)) { show_error('Failed loading Anrechnung'); } - + $result = $this->LehrveranstaltungModel->loadWhere(array( - 'lehrveranstaltung_id' => $result->lehrveranstaltung_id + 'lehrveranstaltung_id' => getData($result)[0]->lehrveranstaltung_id )); - if(!$result = getData($result)[0]) + if(!hasData($result)) { show_error('Failed loading Lehrveranstaltung'); } // Get STGL - $result = $this->StudiengangModel->getLeitung($result->studiengang_kz); - - if($result = getData($result)[0]) + $result = $this->StudiengangModel->getLeitung(getData($result)[0]->studiengang_kz); + + if (hasData($result)) { - if ($result->uid == $this->_uid) + foreach (getData($result) as $stgl) { - return; + if ($stgl->uid == $this->_uid) + { + return; + } } }