Component Gesamthistorie

This commit is contained in:
ma0068
2024-02-12 15:11:00 +01:00
parent 824423f3ea
commit f4197f090b
5 changed files with 110 additions and 13 deletions
@@ -43,6 +43,8 @@ class Prestudent extends FHC_Controller
$this->load->library('form_validation'); $this->load->library('form_validation');
$this->load->model('crm/Prestudent_model', 'PrestudentModel'); $this->load->model('crm/Prestudent_model', 'PrestudentModel');
//Todo(manu) Validierungen
/* $result = $this->PrestudentModel->loadWhere(['prestudent_id' =>$prestudent_id]); /* $result = $this->PrestudentModel->loadWhere(['prestudent_id' =>$prestudent_id]);
if (isError($result)) { if (isError($result)) {
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR); $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() public function getBezeichnungZgv()
{ {
$this->load->model('codex/Zgv_model', 'ZgvModel'); $this->load->model('codex/Zgv_model', 'ZgvModel');
@@ -700,4 +700,30 @@ class Prestudent_model extends DB_Model
return $this->execQuery($query, array($prestudent_id)); 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));
}
} }
@@ -1,12 +1,16 @@
import {CoreRESTClient} from '../../../../RESTClient.js'; import {CoreRESTClient} from '../../../../RESTClient.js';
import FormForm from '../../../Form/Form.js'; import FormForm from '../../../Form/Form.js';
import FormInput from '../../../Form/Input.js'; import FormInput from '../../../Form/Input.js';
import TblHistory from "./Prestudent/History.js";
/*import TblStatus from "./Prestudent/Status.js";*/
export default { export default {
components: { components: {
CoreRESTClient, CoreRESTClient,
FormForm, FormForm,
FormInput FormInput,
TblHistory,
/* TblStatus*/
}, },
inject: { inject: {
lists: { lists: {
@@ -42,7 +46,7 @@ export default {
listFoerderrelevant: [], listFoerderrelevant: [],
initialFormData: {}, initialFormData: {},
deltaArray: [], deltaArray: [],
actionUpdate: false actionUpdate: false,
}; };
}, },
computed: { computed: {
@@ -112,6 +116,13 @@ export default {
}, },
created() { created() {
this.loadPrestudent(); 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 //initiale Daten nach dem Laden
//this.initialFormData = {...this.data}; //this.initialFormData = {...this.data};
CoreRESTClient CoreRESTClient
@@ -410,6 +421,7 @@ export default {
type="text" type="text"
v-model="data.aufnahmeschluessel" v-model="data.aufnahmeschluessel"
name="aufnahmeschluessel" name="aufnahmeschluessel"
disabled
> >
</form-input> </form-input>
@@ -529,18 +541,19 @@ export default {
</form-form> </form-form>
<br> <br>
<div class="row mb-3">
{{hasPrestudentPermission}} <div class="col-6">
<!-- <hr> <legend>Status</legend>
Data: {{data}} <!-- <TblStatus :prestudent_id="modelValue.prestudent_id"></TblStatus> -->
<hr>--> </div>
<div class="col-6">
<legend>Gesamthistorie</legend>
<TblHistory :person_id="modelValue.person_id"></TblHistory>
</div>
</div>
<!-- <hr>
DeltaArray: {{deltaArray}}
<br>
to update: {{actionUpdate}}
<hr>
InitialData: {{initialFormData}}-->
</div> </div>
@@ -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: `
<div class="stv-list h-100 pt-3">
<core-filter-cmpt
ref="table"
:tabulator-options="tabulatorOptions"
table-only
:side-menu="false"
>
</core-filter-cmpt>
</div>`
}