From 60e12e1ab7926b5dceacd28d67899532de732f87 Mon Sep 17 00:00:00 2001 From: Johann Hoffmann Date: Wed, 12 Feb 2025 14:04:23 +0100 Subject: [PATCH] dont load any studiengang related infos for mitarbeiter --- application/controllers/api/frontend/v1/Studgang.php | 8 +++++++- application/models/organisation/Studiengang_model.php | 6 +----- public/js/apps/Dashboard/Fhc.js | 5 ----- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/application/controllers/api/frontend/v1/Studgang.php b/application/controllers/api/frontend/v1/Studgang.php index 0e4eb3205..63579e3a6 100644 --- a/application/controllers/api/frontend/v1/Studgang.php +++ b/application/controllers/api/frontend/v1/Studgang.php @@ -31,6 +31,7 @@ class Studgang extends FHCAPI_Controller ]); $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); + $this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel'); // Loads phrases system $this->loadPhrases([ @@ -43,7 +44,12 @@ class Studgang extends FHCAPI_Controller // Public methods public function getStudiengangInfo(){ - // fetches the Studiengang Information which is used next the the news + $isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID()); + if($isMitarbeiter) { + $this->terminateWithSuccess(); + } + + // fetches the Studiengang Information which is used next to the news $studiengangInfo = $this->StudiengangModel->getStudiengangInfoForNews(); $studiengangInfo= $this->getDataOrTerminateWithError($studiengangInfo); $this->terminateWithSuccess($studiengangInfo); diff --git a/application/models/organisation/Studiengang_model.php b/application/models/organisation/Studiengang_model.php index 066210e0b..7ea8a901c 100644 --- a/application/models/organisation/Studiengang_model.php +++ b/application/models/organisation/Studiengang_model.php @@ -656,6 +656,7 @@ class Studiengang_model extends DB_Model $this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel'); $this->load->model('person/Person_model', 'PersonModel'); + $this->load->model('crm/Student_model', 'StudentModel'); $addEmailProperty= function(&$benutzerfunktionen){ if(count($benutzerfunktionen) && defined('DOMAIN')) @@ -691,11 +692,6 @@ class Studiengang_model extends DB_Model if (isError($student)) return error($student); if (getData($student)) { - //TODO: if a mitarbeiter requests this site, empty data should be returned - if(count($student) == 0) - { - return new stdClass(); - } $student = current(getData($student)); $studiengang_kz = $student->studiengang_kz; $semester = $student->semester; diff --git a/public/js/apps/Dashboard/Fhc.js b/public/js/apps/Dashboard/Fhc.js index 6a3f8c66d..703563283 100644 --- a/public/js/apps/Dashboard/Fhc.js +++ b/public/js/apps/Dashboard/Fhc.js @@ -131,11 +131,6 @@ const app = Vue.createApp({ }, }); -router.beforeEach((to,from) => { - console.log('to', to) - console.log('from', from) -}) - // kind of a bandaid for bad css on some pages to avoid horizontal scroll setScrollbarWidth(); app.use(router);