diff --git a/application/controllers/api/frontend/v1/stv/Status.php b/application/controllers/api/frontend/v1/stv/Status.php index 83096630c..86a52e1bf 100644 --- a/application/controllers/api/frontend/v1/stv/Status.php +++ b/application/controllers/api/frontend/v1/stv/Status.php @@ -32,9 +32,16 @@ class Status extends FHCAPI_Controller public function getHistoryPrestudent($prestudent_id) { + $this->load->model('system/Sprache_model', 'SpracheModel'); + $this->SpracheModel->addSelect('index'); + $result = $this->SpracheModel->loadWhere(array('sprache' => getUserLanguage())); + + // Return language index + $lang = hasData($result) ? getData($result)[0]->index : 1; + $this->load->model('crm/Prestudent_model', 'PrestudentModel'); - $result = $this->PrestudentModel->getHistoryPrestudent($prestudent_id); + $result = $this->PrestudentModel->getHistoryPrestudent($prestudent_id, $lang); if (isError($result)) { $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 109abafe3..7280fd9fb 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -718,6 +718,7 @@ class Prestudent_model extends DB_Model ORDER BY prestudent_id, datum desc, insertamum desc ) ps USING(prestudent_id) JOIN public.tbl_status USING(status_kurzbz) + LEFT JOIN public.tbl_status_grund g USING (statusgrund_id) JOIN public.tbl_studiengang sg USING(studiengang_kz) LEFT JOIN lehre.tbl_studienplan sp USING (studienplan_id) LEFT JOIN public.tbl_student s USING (prestudent_id) @@ -732,7 +733,7 @@ class Prestudent_model extends DB_Model * @param int $prestudent_id * @return object */ - public function getHistoryPrestudent($prestudent_id) + public function getHistoryPrestudent($prestudent_id, $index_lang) { $query = " SELECT @@ -761,7 +762,8 @@ class Prestudent_model extends DB_Model ps.insertvon, ps.updateamum, TO_CHAR(ps.updateamum::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS format_updateamum, - ps.updatevon + ps.updatevon, + stg.beschreibung[?] as statusgrund_beschreibung FROM public.tbl_prestudentstatus ps LEFT JOIN @@ -781,6 +783,6 @@ class Prestudent_model extends DB_Model ORDER BY datum DESC "; - return $this->execQuery($query, array($prestudent_id)); + return $this->execQuery($query, array($index_lang, $prestudent_id)); } } diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js index 1fe619160..9a0da98d2 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js @@ -125,8 +125,7 @@ export default{ {title: "Studienplan", field: "bezeichnung"}, {title: "BestÃĪtigtAm", field: "format_bestaetigtam"}, {title: "AbgeschicktAm", field: "format_bewerbung_abgeschicktamum", visible:false}, - {title: "Statusgrund", field: "statusgrund_kurzbz"}, - {title: "Bezeichnung", field: "bezeichnung_mehrsprachig[0]"}, + {title: "Statusgrund", field: "statusgrund_beschreibung"}, {title: "Organisationsform", field: "orgform_kurzbz", visible: false}, {title: "PrestudentInId", field: "prestudent_id", visible: false}, {title: "StudienplanId", field: "studienplan_id", visible: false},