diff --git a/application/controllers/components/stv/Prestudent.php b/application/controllers/components/stv/Prestudent.php index 1c456db10..40c5d32f6 100644 --- a/application/controllers/components/stv/Prestudent.php +++ b/application/controllers/components/stv/Prestudent.php @@ -43,6 +43,8 @@ class Prestudent extends FHC_Controller $this->load->library('form_validation'); $this->load->model('crm/Prestudent_model', 'PrestudentModel'); + //Todo(manu) Validierungen + /* $result = $this->PrestudentModel->loadWhere(['prestudent_id' =>$prestudent_id]); if (isError($result)) { $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); @@ -146,6 +148,20 @@ class Prestudent extends FHC_Controller } + public function getHistoryPrestudents($person_id) + { + $this->load->model('crm/Prestudent_model', 'PrestudentModel'); + + $result = $this->PrestudentModel->getHistoryPrestudents($person_id); + if (isError($result)) + { + $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); + } + + $this->outputJson(getData($result) ?: []); + + } + public function getBezeichnungZgv() { $this->load->model('codex/Zgv_model', 'ZgvModel'); diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php index 7b24b8769..55c06dc21 100644 --- a/application/models/crm/Prestudent_model.php +++ b/application/models/crm/Prestudent_model.php @@ -700,4 +700,30 @@ class Prestudent_model extends DB_Model return $this->execQuery($query, array($prestudent_id)); } + /** + * Gets history of all prestudents, person given + * @param int $person_id + * @return object + */ + public function getHistoryPrestudents($person_id) + { + $query = " + SELECT ps.studiensemester_kurzbz, p.priorisierung, p.studiengang_kz, sg.kurzbzlang, sg.orgform_kurzbz, ps.status_kurzbz, s.student_uid, sp.bezeichnung, ps.ausbildungssemester, + CONCAT(ps.status_kurzbz, ' (', ps.ausbildungssemester, '. Semester)') as status + FROM public.tbl_prestudent p + JOIN ( + SELECT DISTINCT ON(prestudent_id) * + FROM public.tbl_prestudentstatus + WHERE prestudent_id IN (SELECT prestudent_id FROM public.tbl_prestudent WHERE person_id = ?) + ORDER BY prestudent_id, datum desc, insertamum desc + ) ps USING(prestudent_id) + JOIN public.tbl_status USING(status_kurzbz) + 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) + ORDER BY p.priorisierung + "; + + return $this->execQuery($query, array($person_id)); + } } diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js index 4043e2aa5..b7a616db9 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent.js @@ -1,12 +1,16 @@ 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";*/ export default { components: { CoreRESTClient, FormForm, - FormInput + FormInput, + TblHistory, +/* TblStatus*/ }, inject: { lists: { @@ -42,7 +46,7 @@ export default { listFoerderrelevant: [], initialFormData: {}, deltaArray: [], - actionUpdate: false + actionUpdate: false, }; }, computed: { @@ -112,6 +116,13 @@ export default { }, created() { this.loadPrestudent(); +/* CoreRESTClient + .get('components/stv/Prestudent/getHistoryPrestudents/'+ this.modelValue.person_id) + .then(result => CoreRESTClient.getData(result.data) || []) + .then(result => { + this.historyPrestudents = result; + }) + .catch(this.$fhcAlert.handleSystemError);*/ //initiale Daten nach dem Laden //this.initialFormData = {...this.data}; CoreRESTClient @@ -410,6 +421,7 @@ export default { type="text" v-model="data.aufnahmeschluessel" name="aufnahmeschluessel" + disabled > @@ -529,18 +541,19 @@ export default {
- - {{hasPrestudentPermission}} - +
+
+ Status + +
+ +
+ Gesamthistorie + +
+ +
- diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/History.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/History.js new file mode 100644 index 000000000..fd280fd5a --- /dev/null +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/History.js @@ -0,0 +1,42 @@ +import {CoreFilterCmpt} from "../../../../filter/Filter.js"; +import {CoreRESTClient} from "../../../../../RESTClient"; + +export default{ + components: { + CoreFilterCmpt + }, + props: { + person_id: String + }, + data() { + return { + tabulatorOptions: { + ajaxURL: CoreRESTClient._generateRouterURI('components/stv/Prestudent/getHistoryPrestudents/' + this.person_id), + //autoColumns: true, + columns:[ + {title:"StSem", field:"studiensemester_kurzbz"}, + {title:"Prio", field:"priorisierung"}, + {title:"Stg", field:"kurzbzlang"}, + {title:"Orgform", field:"orgform_kurzbz"}, + {title:"Studienplan", field:"bezeichnung"}, + {title:"UID", field:"student_uid"}, + {title:"Status", field:"status"} + ], + layout: 'fitDataFill', + layoutColumnsOnNewData: false, + height: 'auto', + selectable: false, + }, + } + }, + template: ` +
+ + +
` +} \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/Status.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/Status.js new file mode 100644 index 000000000..e69de29bb