diff --git a/application/controllers/components/stv/Prestudent.php b/application/controllers/components/stv/Prestudent.php
index 40c5d32f6..855d53a56 100644
--- a/application/controllers/components/stv/Prestudent.php
+++ b/application/controllers/components/stv/Prestudent.php
@@ -157,9 +157,19 @@ class Prestudent extends FHC_Controller
{
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
}
-
$this->outputJson(getData($result) ?: []);
+ }
+ public function getHistoryPrestudent($prestudent_id)
+ {
+ $this->load->model('crm/Prestudent_model', 'PrestudentModel');
+
+ $result = $this->PrestudentModel->getHistoryPrestudent($prestudent_id);
+ if (isError($result))
+ {
+ $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
+ }
+ $this->outputJson(getData($result) ?: []);
}
public function getBezeichnungZgv()
diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php
index 55c06dc21..a8dab8a6a 100644
--- a/application/models/crm/Prestudent_model.php
+++ b/application/models/crm/Prestudent_model.php
@@ -701,7 +701,7 @@ class Prestudent_model extends DB_Model
}
/**
- * Gets history of all prestudents, person given
+ * Gets history of all prestudents, person_id given
* @param int $person_id
* @return object
*/
@@ -726,4 +726,48 @@ class Prestudent_model extends DB_Model
return $this->execQuery($query, array($person_id));
}
+
+ /**
+ * Gets history of prestudent, prestudent_id given
+ * @param int $prestudent_id
+ * @return object
+ */
+ public function getHistoryPrestudent($prestudent_id)
+ {
+ $query = "
+ SELECT
+ ps.status_kurzbz,
+ ps.studiensemester_kurzbz,
+ ps.ausbildungssemester,
+ CASE WHEN ps.status_kurzbz = 'Student' THEN CONCAT(lv.semester, lv.verband, lv.gruppe) END AS lehrverband,
+ ps.datum,
+ TO_CHAR(ps.datum::timestamp, 'DD.MM.YYYY') AS format_datum,
+ sp.bezeichnung,
+ ps.bestaetigtam,
+ TO_CHAR(ps.bestaetigtam::timestamp, 'DD.MM.YYYY') AS format_bestaetigtam,
+ ps.bewerbung_abgeschicktamum,
+ TO_CHAR(ps.bewerbung_abgeschicktamum::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS format_bewerbung_abgeschicktamum,
+ stg.statusgrund_kurzbz,
+ ps.orgform_kurzbz,
+ ps.prestudent_id,
+ sp.studienplan_id,
+ ps.anmerkung,
+ ps.bestaetigtvon,
+ ps.insertamum,
+ ps.insertvon,
+ ps.updateamum,
+ ps.updatevon
+ FROM public.tbl_prestudentstatus ps
+ JOIN public.tbl_student st USING (prestudent_id)
+ JOIN public.tbl_studentlehrverband lv ON (st.student_uid = lv.student_uid)
+ JOIN public.tbl_studiengang sg ON (lv.studiengang_kz = sg.studiengang_kz)
+ LEFT JOIN lehre.tbl_studienplan sp USING (studienplan_id)
+ LEFT JOIN public.tbl_status_grund stg USING (statusgrund_id)
+ WHERE prestudent_id = ?
+ and lv.studiensemester_kurzbz = ps.studiensemester_kurzbz
+ ORDER BY datum DESC
+ ";
+
+ return $this->execQuery($query, array($prestudent_id));
+ }
}
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js
index b7a616db9..394a6de27 100644
--- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js
+++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js
@@ -2,7 +2,7 @@ import {CoreRESTClient} from '../../../../RESTClient.js';
import FormForm from '../../../Form/Form.js';
import FormInput from '../../../Form/Input.js';
import TblHistory from "./Prestudent/History.js";
-/*import TblStatus from "./Prestudent/Status.js";*/
+import TblStatus from "./Prestudent/Status.js";
export default {
components: {
@@ -10,7 +10,7 @@ export default {
FormForm,
FormInput,
TblHistory,
-/* TblStatus*/
+ TblStatus
},
inject: {
lists: {
@@ -541,18 +541,26 @@ export default {
-