From 2ab01132b1a069390abc360bb359fc4dc12bf89f Mon Sep 17 00:00:00 2001 From: ma0068 Date: Thu, 24 Apr 2025 16:30:50 +0200 Subject: [PATCH] show List Admission Dates --- .../api/frontend/v1/stv/Aufnahmetermine.php | 243 +----------------- application/models/crm/Reihungstest_model.php | 39 +++ public/js/api/factory/stv/admissionDates.js | 4 +- public/js/api/stv/admissionDates.js | 0 .../Aufnahmetermine/Aufnahmetermine.js | 31 ++- system/phrasesupdate.php | 20 ++ 6 files changed, 92 insertions(+), 245 deletions(-) delete mode 100644 public/js/api/stv/admissionDates.js diff --git a/application/controllers/api/frontend/v1/stv/Aufnahmetermine.php b/application/controllers/api/frontend/v1/stv/Aufnahmetermine.php index 519e8125d..3a0be3d40 100644 --- a/application/controllers/api/frontend/v1/stv/Aufnahmetermine.php +++ b/application/controllers/api/frontend/v1/stv/Aufnahmetermine.php @@ -27,20 +27,12 @@ class Aufnahmetermine extends FHCAPI_Controller ]); // Load models - $this->load->model('codex/Bisio_model', 'BisioModel'); + $this->load->model('crm/Reihungstest_model', 'ReihungstestModel'); } - public function getAufnahmetermine($student_uid) + public function getAufnahmetermine($person_id) { - $this->BisioModel->addSelect("*"); - $this->BisioModel->addJoin('bis.tbl_mobilitaetsprogramm mp', 'ON (mp.mobilitaetsprogramm_code = bis.tbl_bisio.mobilitaetsprogramm_code)', 'LEFT'); - $this->BisioModel->addJoin('lehre.tbl_lehreinheit le', 'ON (le.lehreinheit_id = bis.tbl_bisio.lehreinheit_id)','LEFT'); - $this->BisioModel->addOrder('von', 'DESC'); - $this->BisioModel->addOrder('bis', 'DESC'); - $this->BisioModel->addOrder('aufnahmetermin_id', 'DESC'); - $result = $this->BisioModel->loadWhere( - array('student_uid' => $student_uid) - ); + $result = $this->ReihungstestModel->getReihungstestPerson($person_id); $data = $this->getDataOrTerminateWithError($result); @@ -274,233 +266,4 @@ class Aufnahmetermine extends FHCAPI_Controller $this->terminateWithSuccess($data); } - public function getLVList($studiengang_kz) - { - $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); - - $result = $this->LehrveranstaltungModel->getLvsByStudiengangkz($studiengang_kz); - - $data = $this->getDataOrTerminateWithError($result); - - $this->terminateWithSuccess($data); - } - - public function getAllLehreinheiten() - { - $lv_id = $this->input->post('lv_id'); - $studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz'); - - $this->load->model('education/Lehreinheit_model', 'LehreinheitModel'); - - $result = $this->LehreinheitModel->getLesFromLvIds($lv_id, $studiensemester_kurzbz); - - $data = $this->getDataOrTerminateWithError($result); - - $this->terminateWithSuccess($data); - } - - public function getLvsandLesByStudent($student_uid) - { - $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); - - $result = $this->LehrveranstaltungModel->getLvsByStudent($student_uid); - - $data = $this->getDataOrTerminateWithError($result); - - $lv_ids = array(); - $allData = array(); - - foreach ($data as $lehrveranstaltung) { - $lv_ids[] = $lehrveranstaltung->lehrveranstaltung_id; - } - - $this->load->model('education/Lehreinheit_model', 'LehreinheitModel'); - - foreach ($lv_ids as $id) - { - $result = $this->LehreinheitModel->getLesFromLvIds($id); - $data = $this->getDataOrTerminateWithError($result); - - if (is_array($data)) { - $allData = array_merge($allData, $data); - } - } - - return $this->terminateWithSuccess($allData); - } - - public function getPurposes($aufnahmetermin_id) - { - $aufnahmetermin_id = (int)$aufnahmetermin_id; - - $this->load->model('codex/Bisiozweck_model', 'BisiozweckModel'); - - $this->BisiozweckModel->addSelect("*"); - $this->BisiozweckModel->addJoin('bis.tbl_zweck zw', 'ON (zw.zweck_code = bis.tbl_bisio_zweck.zweck_code)'); - - $result = $this->BisiozweckModel->loadWhere( - array('aufnahmetermin_id' => $aufnahmetermin_id) - ); - - $data = $this->getDataOrTerminateWithError($result); - - $this->terminateWithSuccess($data); - } - - public function getSupports($aufnahmetermin_id) - { - $aufnahmetermin_id = (int)$aufnahmetermin_id; - - $this->load->model('codex/Bisioaufenthaltfoerderung_model', 'BisioaufenthaltfoerderungModel'); - - $this->BisioaufenthaltfoerderungModel->addSelect("*"); - $this->BisioaufenthaltfoerderungModel->addJoin('bis.tbl_aufenthaltfoerderung af', 'ON (af.aufenthaltfoerderung_code = bis.tbl_bisio_aufenthaltfoerderung.aufenthaltfoerderung_code)'); - - $result = $this->BisioaufenthaltfoerderungModel->loadWhere( - array('aufnahmetermin_id' => $aufnahmetermin_id) - ); - - $data = $this->getDataOrTerminateWithError($result); - - $this->terminateWithSuccess($data); - } - - public function getListPurposes() - { - $this->load->model('codex/Zweck_model', 'ZweckModel'); - - $result = $this->ZweckModel->load(); - - $data = $this->getDataOrTerminateWithError($result); - - $this->terminateWithSuccess($data); - } - - public function getListSupports() - { - $this->load->model('codex/Aufenthaltfoerderung_model', 'AufenthaltfoerderungModel'); - - $result = $this->AufenthaltfoerderungModel->load(); - - $data = $this->getDataOrTerminateWithError($result); - - $this->terminateWithSuccess($data); - } - - public function addAufnahmeterminPurpose($aufnahmetermin_id, $local_purpose = null) - { - $zweck_code = $this->input->post('zweck_code'); - - if($local_purpose){ - $zweck_code = $local_purpose; - } - - $this->load->model('codex/Bisiozweck_model', 'BisiozweckModel'); - if(!$local_purpose) - { - $check = $this->BisiozweckModel->loadWhere( - [ - 'aufnahmetermin_id' => $aufnahmetermin_id, - 'zweck_code' => $zweck_code, - ] - ); - if (hasData($check)) - { - $this->terminateWithError($this->p->t('ui', 'error_entryExisting'), self::ERROR_TYPE_GENERAL); - } - } - - $result = $this->BisiozweckModel->insert( - array( - 'aufnahmetermin_id' => $aufnahmetermin_id, - 'zweck_code' => $zweck_code - ) - ); - - $data = $this->getDataOrTerminateWithError($result); - - if($local_purpose) - { - return $data; - } - - return $this->terminateWithSuccess(current($data)); - } - - public function deleteAufnahmeterminPurpose($aufnahmetermin_id) - { - $zweck_code = $this->input->post('zweck_code'); - - $this->load->model('codex/Bisiozweck_model', 'BisiozweckModel'); - - - $result = $this->BisiozweckModel->delete( - array( - 'aufnahmetermin_id' => $aufnahmetermin_id, - 'zweck_code' => $zweck_code - ) - ); - - $data = $this->getDataOrTerminateWithError($result); - - return $this->terminateWithSuccess(current($data)); - } - - public function addAufnahmeterminSupport($aufnahmetermin_id, $local_support = null) - { - $aufenthaltfoerderung_code = $this->input->post('aufenthaltfoerderung_code'); - - if($local_support){ - $aufenthaltfoerderung_code = $local_support; - } - - $this->load->model('codex/Bisioaufenthaltfoerderung_model', 'BisioaufenthaltfoerderungModel'); - - if(!$local_support) - { - $check = $this->BisioaufenthaltfoerderungModel->loadWhere( - [ - 'aufnahmetermin_id' => $aufnahmetermin_id, - 'aufenthaltfoerderung_code' => $aufenthaltfoerderung_code, - ] - ); - if (hasData($check)) - { - $this->terminateWithError($this->p->t('ui', 'error_entryExisting'), self::ERROR_TYPE_GENERAL); - } - } - - $result = $this->BisioaufenthaltfoerderungModel->insert( - array( - 'aufnahmetermin_id' => $aufnahmetermin_id, - 'aufenthaltfoerderung_code' => $aufenthaltfoerderung_code - ) - ); - - $data = $this->getDataOrTerminateWithError($result); - - if($local_support) - { - return $data; - } - - return $this->terminateWithSuccess(current($data)); - } - - public function deleteAufnahmeterminSupport($aufnahmetermin_id) - { - $aufenthaltfoerderung_code = $this->input->post('aufenthaltfoerderung_code'); - - $this->load->model('codex/Bisioaufenthaltfoerderung_model', 'BisioaufenthaltfoerderungModel'); - - $result = $this->BisioaufenthaltfoerderungModel->delete( - array( - 'aufnahmetermin_id' => $aufnahmetermin_id, - 'aufenthaltfoerderung_code' => $aufenthaltfoerderung_code - ) - ); - $data = $this->getDataOrTerminateWithError($result); - - return $this->terminateWithSuccess(current($data)); - } } diff --git a/application/models/crm/Reihungstest_model.php b/application/models/crm/Reihungstest_model.php index 86ebfd0af..f2732b636 100644 --- a/application/models/crm/Reihungstest_model.php +++ b/application/models/crm/Reihungstest_model.php @@ -511,4 +511,43 @@ class Reihungstest_model extends DB_Model return $this->execQuery($query, array($date, $studiengang_kz)); } + + /** + * Loads all placement tests of a given person + * @param integer $person_id + * @return array Returns object array with data of placement tests + */ + public function getReihungstestPerson($person_id) + { + $query = ' + SELECT + tbl_rt_person.*, + tbl_reihungstest.studiengang_kz, + tbl_reihungstest.anmerkung, + tbl_reihungstest.datum, + tbl_reihungstest.uhrzeit, + tbl_reihungstest.ext_id, + tbl_reihungstest.max_teilnehmer, + tbl_reihungstest.oeffentlich, + tbl_reihungstest.freigeschaltet, + tbl_reihungstest.studiensemester_kurzbz, + tbl_reihungstest.stufe, + tbl_reihungstest.anmeldefrist, + tbl_reihungstest.aufnahmegruppe_kurzbz, + tbl_studiengang.typ, + UPPER(typ::varchar(1) || kurzbz) AS stg_kuerzel, + so.studiengangbezeichnung, + so.studiengangbezeichnung_englisch + FROM + public.tbl_rt_person + JOIN public.tbl_reihungstest ON (rt_id=reihungstest_id) + JOIN public.tbl_studiengang ON tbl_reihungstest.studiengang_kz = tbl_studiengang.studiengang_kz + JOIN lehre.tbl_studienplan sp USING(studienplan_id) + JOIN lehre.tbl_studienordnung so USING(studienordnung_id) + WHERE + tbl_rt_person.person_id = ? + ORDER BY datum, uhrzeit ASC'; + + return $this->execQuery($query, array($person_id)); + } } \ No newline at end of file diff --git a/public/js/api/factory/stv/admissionDates.js b/public/js/api/factory/stv/admissionDates.js index fc96f47be..51a92c331 100644 --- a/public/js/api/factory/stv/admissionDates.js +++ b/public/js/api/factory/stv/admissionDates.js @@ -16,10 +16,10 @@ */ export default { - getAufnahmetermine(prestudent_id) { + getAufnahmetermine(person_id) { return { method: 'get', - url: 'api/frontend/v1/stv/aufnahmetermine/' + prestudent_id + url: 'api/frontend/v1/stv/aufnahmetermine/getAufnahmetermine/' + person_id, }; }, } \ No newline at end of file diff --git a/public/js/api/stv/admissionDates.js b/public/js/api/stv/admissionDates.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js b/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js index 58f440836..7e7e2ae97 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js @@ -27,12 +27,24 @@ export default { tabulatorOptions: { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call( - ApiStvAdmissionDates.getAufnahmetermin(this.student.prestudent_id) + ApiStvAdmissionDates.getAufnahmetermine(this.student.person_id) ), ajaxResponse: (url, params, response) => response.data, columns: [ - {title: "aufnahmetermin_id", field: "aufnahmetermin_id"}, - {title: "prestudent_id", field: "prestudent_id"}, + {title: "rt_id", field: "rt_id"}, + {title: "rt_person_id", field: "rt_person_id"}, + {title: "person_id", field: "person_id"}, + {title: "datum", field: "datum"}, + {title: "stufe", field: "stufe"}, + {title: "studiensemester", field: "studiensemester_kurzbz"}, + {title: "anmerkung", field: "anmerkung", visible: false}, + {title: "anmeldedatum", field: "anmeldedatum", visible: false}, + {title: "punkte", field: "punkte"}, + {title: "teilgenommen", field: "teilgenommen"}, + {title: "ort", field: "ort", visible: false}, + {title: "studienplan", field: "studienplan", visible: false}, + {title: "studienplan_id", field: "studienplan_id", visible: false}, + {title: "stg_kuerzel", field: "stg_kuerzel"}, ], layout: 'fitDataFill', layoutColumnsOnNewData: false, @@ -53,6 +65,19 @@ export default {

Allgemein

+ + +
` } diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index fd54d9f66..bf18f50c8 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -41416,6 +41416,26 @@ and represent the current state of research on the topic. The prescribed citatio ) ) ), + array( + 'app' => 'core', + 'category' => 'lehre', + 'phrase' => 'reihungstest', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Reihungstest', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Placement Test', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), // FHC4 STUDIERENDENVERWALTUNG AUFNAHMETERMINE ENDE --------------------------------------------------------------- );