mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Component Gesamthistorie
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
>
|
||||
</form-input>
|
||||
|
||||
@@ -529,18 +541,19 @@ export default {
|
||||
</form-form>
|
||||
|
||||
<br>
|
||||
|
||||
{{hasPrestudentPermission}}
|
||||
<!-- <hr>
|
||||
Data: {{data}}
|
||||
<hr>-->
|
||||
<div class="row mb-3">
|
||||
<div class="col-6">
|
||||
<legend>Status</legend>
|
||||
<!-- <TblStatus :prestudent_id="modelValue.prestudent_id"></TblStatus> -->
|
||||
</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>
|
||||
|
||||
@@ -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>`
|
||||
}
|
||||
Reference in New Issue
Block a user