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 {
-
-
+ +
+ Status + +
+ +
+ + -
+ +
--> -
+
Gesamthistorie
-
+ diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/Status.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/Status.js index e69de29bb..777a94e9e 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/Status.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/Status.js @@ -0,0 +1,164 @@ +import {CoreFilterCmpt} from "../../../../filter/Filter.js"; +import {CoreRESTClient} from "../../../../../RESTClient"; + +export default{ + components: { + CoreFilterCmpt + }, + props: { + prestudent_id: String + }, + data() { + return { + tabulatorOptions: { + ajaxURL: CoreRESTClient._generateRouterURI('components/stv/Prestudent/getHistoryPrestudent/' + this.prestudent_id), + //autoColumns: true, + columns:[ + {title:"Kurzbz", field:"status_kurzbz"}, + {title:"StSem", field:"studiensemester_kurzbz"}, + {title:"Sem", field:"ausbildungssemester"}, + {title:"Lehrverband", field:"lehrverband"}, + {title:"Datum", field:"format_datum"}, + {title:"Studienplan", field:"bezeichnung"}, + {title:"BestätigtAm", field:"format_bestaetigtam"}, + {title:"AbgeschicktAm", field:"format_bewerbung_abgeschicktamum"}, + {title:"Statusgrund", field:"statusgrund_kurzbz"}, + {title:"Organisationsform", field:"ps.orgform_kurzbz"}, + {title:"PrestudentInId", field:"prestudent_id"}, + {title:"StudienplanId", field:"studienplan_id"}, + {title:"Anmerkung", field:"anmerkung"}, + {title:"BestätigtVon", field:"bestaetigtvon"}, + {title:"InsertAmUm", field:"insertamum"}, + {title:"InsertVon", field:"insertvon"}, + {title:"UpdateAmUm", field:"updateamum"}, + {title:"UpdateVon", field:"updatevon"}, + ], + layout: 'fitDataFill', + layoutColumnsOnNewData: false, + height: 'auto', + selectable: false, + rowClickMenu:[ + { + label:"Bearbeiten", + action:function(e, row){ + console.log("bearbeiten: " + row.getData().status_kurzbz + ' ' + row.getData().prestudent_id); + } + }, + { + separator:true, + }, + { + disabled:true, + label:"Status bestätigen", + action:function(e, column){ + column.move("col"); + } + }, + { + separator:true, + }, + { + disabled:true, + label:"Neuen Status hinzufügen", + action:function(e, column){ + column.move("col"); + } + }, + { + separator:true, + }, + { + disabled:true, + label:"Entfernen", + action:function(e, column){ + column.move("col"); + } + }, + { + separator:true, + }, + { + disabled:true, + label:"Status vorrücken", + action:function(e, column){ + column.move("col"); + } + }, + { + separator:true, + }, + { + label:" Select Row", + action:function(e, row){ + row.select(); + } + }, + ], +/* rowContextMenu:[ + { + label:"Bearbeiten", + action:function(e, column){ + console.log("bearbeiten" + column); + column.hide(); + } + }, + { + separator:true, + }, + { + disabled:true, + label:"Status bestätigen", + action:function(e, column){ + column.move("col"); + } + }, + { + separator:true, + }, + { + disabled:true, + label:"Neuen Status hinzufügen", + action:function(e, column){ + column.move("col"); + } + }, + { + separator:true, + }, + { + disabled:true, + label:"Entfernen", + action:function(e, column){ + column.move("col"); + } + }, + { + separator:true, + }, + { + disabled:true, + label:"Status vorrücken", + action:function(e, column){ + column.move("col"); + } + }, + ]*/ + }, + } + }, + template: ` +
+ + +
` +} \ No newline at end of file