From e548e17776de33a62a06204077372e00c1a4e64c Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Wed, 31 Jul 2024 15:09:09 +0200 Subject: [PATCH] Status insert/edit: Orgform in Mischform Stg --- .../api/frontend/v1/stv/Prestudent.php | 27 ++++++++++++++++--- .../Details/Status/Modal.js | 22 ++++++++++++++- 2 files changed, 45 insertions(+), 4 deletions(-) diff --git a/application/controllers/api/frontend/v1/stv/Prestudent.php b/application/controllers/api/frontend/v1/stv/Prestudent.php index c423a61b8..d75ad5fbc 100644 --- a/application/controllers/api/frontend/v1/stv/Prestudent.php +++ b/application/controllers/api/frontend/v1/stv/Prestudent.php @@ -19,7 +19,8 @@ class Prestudent extends FHCAPI_Controller 'getAufmerksamdurch' => self::PERM_LOGGED, 'getBerufstaetigkeit' => self::PERM_LOGGED, 'getTypenStg' => self::PERM_LOGGED, - 'getStudienplaene' => self::PERM_LOGGED + 'getStudienplaene' => self::PERM_LOGGED, + 'getStudiengang' => self::PERM_LOGGED ]); // Load Libraries @@ -266,8 +267,6 @@ class Prestudent extends FHCAPI_Controller public function getStudienplaene($prestudent_id) { - if (!is_int((int)$prestudent_id) || (int)$prestudent_id . '' != $prestudent_id) - show_404(); $this->load->model('organisation/Studienplan_model', 'StudienplanModel'); $result = $this->StudienplanModel->getStudienplaeneByPrestudents($prestudent_id); @@ -275,4 +274,26 @@ class Prestudent extends FHCAPI_Controller return $this->terminateWithSuccess($data); } + + /** + * Gets details for the Studiengang of the Prestudent + * + * @param integer $prestudent_id + * + * @return stdClass + */ + public function getStudiengang($prestudent_id) + { + $this->load->model('crm/Prestudent_model', 'PrestudentModel'); + + $this->PrestudentModel->addSelect('stg.*'); + + $this->PrestudentModel->addJoin('public.tbl_studiengang stg', 'studiengang_kz'); + + $result = $this->PrestudentModel->load($prestudent_id); + + $stg = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess(current($stg)); + } } diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js b/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js index d97d15225..5a77c7348 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Status/Modal.js @@ -44,6 +44,7 @@ export default{ prestudent: {}, originalDatum: null, statusNew: true, + mischform: false, statusId: {}, formData: {}, studienplaene: [], @@ -171,7 +172,9 @@ export default{ return this.$fhcApi .get('api/frontend/v1/stv/prestudent/getStudienplaene/' + prestudent.prestudent_id) - .then(result => this.studienplaene = result.data); + .then(result => this.studienplaene = result.data) + .then(() => this.$fhcApi.get('api/frontend/v1/stv/prestudent/getStudiengang/' + prestudent.prestudent_id)) + .then(result => this.mischform = result.data.mischform); } }, created() { @@ -263,6 +266,23 @@ export default{ {{ number }} + + +