diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index efb465146..d90054fae 100755 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -20,9 +20,9 @@ class Profil extends Auth_Controller 'foto_sperre_function' => ['student/anrechnung_beantragen:r', 'user:r'], 'getView' => ['student/anrechnung_beantragen:r', 'user:r'], 'View' => ['student/anrechnung_beantragen:r', 'user:r'], + 'isMitarbeiter' => ['student/anrechnung_beantragen:r', 'user:r'], + 'isStudent' => ['student/anrechnung_beantragen:r', 'user:r'], - - ]); @@ -613,4 +613,24 @@ class Profil extends Auth_Controller return $zutrittskarte_ausgegebenam; } + //? foreward declaration of the function isStudent in Student_model.php + public function isStudent($uid){ + $result = $this->StudentModel->isStudent($uid); + if(!isSuccess($result)){ + show_error("error when calling Student_model function isStudent with uid ".$uid); + } + $result = getData($result); + echo json_encode($result); + } + + //? foreward declaration of the function isMitarbeiter in Mitarbeiter_model.php + public function isMitarbeiter($uid){ + $result = $this->MitarbeiterModel->isMitarbeiter($uid); + if(!isSuccess($result)){ + show_error("error when calling Mitarbeiter_model function isMitarbeiter with uid ".$uid); + } + $result = getData($result); + echo json_encode($result); + } + } diff --git a/public/js/apps/api/userdata.js b/public/js/apps/api/userdata.js index c44b2af98..02b82dde8 100755 --- a/public/js/apps/api/userdata.js +++ b/public/js/apps/api/userdata.js @@ -22,4 +22,18 @@ export default { `cis.php/Cis/Profil/foto_sperre_function/${value}`; return axios.get(url); }, + + isStudent: function (uid) { + const url = + FHC_JS_DATA_STORAGE_OBJECT.app_root + + `cis.php/Cis/Profil/isStudent/${uid}`; + return axios.get(url); + }, + + isMitarbeiter: function (uid) { + const url = + FHC_JS_DATA_STORAGE_OBJECT.app_root + + `cis.php/Cis/Profil/isMitarbeiter/${uid}`; + return axios.get(url); + }, }; diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index a17c9a235..3a8a9684f 100755 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -273,7 +273,7 @@ export default {