From 60fc774ade523c461e6e6a717148d001316b2f33 Mon Sep 17 00:00:00 2001 From: cgfhtw Date: Thu, 25 Jul 2024 13:57:00 +0200 Subject: [PATCH] Multistatus cleanup --- .../Details/Prestudent/MultiStatus.js | 300 +----------------- 1 file changed, 9 insertions(+), 291 deletions(-) diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js index 0c1cb6e60..317b58878 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js @@ -1,17 +1,13 @@ import {CoreFilterCmpt} from "../../../../filter/Filter.js"; import BsModal from "../../../../Bootstrap/Modal.js"; -import FormForm from '../../../../Form/Form.js'; import FormInput from '../../../../Form/Input.js'; -import FormValidation from '../../../../Form/Validation.js'; import StatusModal from '../Status/Modal.js'; export default{ components: { CoreFilterCmpt, BsModal, - FormForm, FormInput, - FormValidation, StatusModal }, inject: { @@ -22,54 +18,20 @@ export default{ from: 'hasPermissionToSkipStatusCheck', default: false }, - hasPrestudentPermission: { - from: 'hasPrestudentPermission', - default: false - }, - hasPrestudentstatusPermission: { - from: 'hasPrestudentstatusPermission', - default: false - }, - hasAssistenzPermission: { - from: 'hasAssistenzPermission', - default: false - }, - hasAdminPermission: { - from: 'hasAdminPermission', - default: false - }, - hasAssistenzPermissionForStgs: { - from: 'hasAssistenzPermissionForStgs', - default: false - }, - hasSchreibrechtAss: { - from: 'hasSchreibrechtAss', - default: false - }, - hasPermissionRtAufsicht: { - from: 'hasPermissionRtAufsicht', - default: false - }, - lists: { - from: 'lists' - }, $reloadList: { from: '$reloadList', required: true } }, computed: { - prestudentIds(){ + prestudentIds() { if (this.modelValue.prestudent_id) { return [this.modelValue.prestudent_id]; } return this.modelValue.map(e => e.prestudent_id); }, - paramIds(){ - return Array.isArray(this.prestudentIds) ? this.prestudentIds.join(',') : this.prestudentIds; - }, - updateData(){ + updateData() { const dataArray = []; if (this.modelValue.prestudent_id) { const newObj = { @@ -98,22 +60,6 @@ export default{ return dataArray; } }, - gruende() { - return this.listStatusgruende.filter(grund => grund.status_kurzbz == this.statusData.status_kurzbz); - }, - arrayStg(){ - let stgInteger = this.hasAssistenzPermissionForStgs.map(item => { - return parseInt(item); - }); - return stgInteger; - }, - hasPermissionCurrentStg(){ - return this.arrayStg.includes(this.studiengang_kz); - }, - isStatusBeforeStudent(){ - let isStatusStudent = ['Student', 'Absolvent', 'Diplomand']; - return !isStatusStudent.includes(this.statusData.status_kurzbz); - }, showToolbarStudent() { if (Array.isArray(this.modelValue)) { if (!this.modelValue.length) @@ -233,7 +179,6 @@ export default{ modelValue: Object, }, data() { - return { tabulatorOptions: { ajaxURL: 'api/frontend/v1/stv/Status/getHistoryPrestudent/' + this.modelValue.prestudent_id, @@ -384,16 +329,9 @@ export default{ } ], statusData: {}, - maxSem: Array.from({ length: 11 }, (_, index) => index), - listStudienplaene: [], - aufnahmestufen: {1: 1, 2: 2, 3: 3}, - listStatusgruende: [], statusId: {}, - gruendeLength: {}, dataMeldestichtag: null, - stichtag: {}, isLastStatus: {}, - hasPermissionThisStg: {}, actionButton: {}, actionStatusText: {}, actionSem: null, @@ -417,7 +355,7 @@ export default{ }, deep: true }, - modelValue(){ + modelValue() { if (this.$refs.table) { if (this.$refs.table.tableBuilt) this.$refs.table.tabulator.setData('api/frontend/v1/stv/Status/getHistoryPrestudent/' + this.modelValue.prestudent_id); @@ -429,32 +367,9 @@ export default{ methods: { actionNewStatus() { this.$refs.test.open(this.modelValue); - /*this.statusNew = true; - this.resetModal(); - this.statusData.status_kurzbz = 'Interessent'; - this.statusData.studiensemester_kurzbz = this.defaultSemester; - this.statusData.ausbildungssemester = 1; - this.statusData.datum = this.getDefaultDate(); - this.statusData.bestaetigtam = this.getDefaultDate(); - this.statusData.name = this.modelValue.vorname + ' ' + this.modelValue.nachname; - this.$refs.statusData.clearValidation(); - this.$refs.statusModal.show();*/ }, actionEditStatus(status, stdsem, ausbildungssemester) { this.$refs.test.open(this.modelValue, status, stdsem, ausbildungssemester); - /*this.statusNew = false; - this.statusId = { - 'prestudent_id': this.modelValue.prestudent_id, - 'status_kurzbz': status, - 'studiensemester_kurzbz': stdsem, - 'ausbildungssemester': ausbildungssemester - }; - this.loadStatus(this.statusId).then(() => { - if(this.statusData) { - this.$refs.statusData.clearValidation(); - this.$refs.statusModal.show(); - } - });*/ }, actionDeleteStatus(status, stdsem, ausbildungssemester){ this.statusId = { @@ -742,24 +657,9 @@ export default{ else { this.$reloadList(); } - this.hideModal('statusModal'); this.resetModal(); }); }, - // Manually inserts a new Status with use of the statusModal - insertStatus() { - this.$refs.statusData - .post( - 'api/frontend/v1/stv/status/insertStatus/' + this.modelValue.prestudent_id, - this.statusData - ) - .then(result => { - this.reload(); - this.$reloadList(); - this.$refs.statusModal.hide(); - }) - .catch(this.$fhcAlert.handleSystemError); - }, changeStatus(prestudentIds){ this.resetChangeModals(); //Array.isArray(prestudentIds) ? this.modelValue.prestudent_id : [prestudentIds]; @@ -831,7 +731,6 @@ export default{ else { this.$reloadList(); } - this.hideModal('statusModal'); this.resetModal(); }); }, @@ -881,25 +780,6 @@ export default{ this.$reloadList(); }); }, - editStatus(){ - return this.$fhcApi.post('api/frontend/v1/stv/status/updateStatus/' + - this.statusId.prestudent_id + '/' + - this.statusId.status_kurzbz + '/' + - this.statusId.studiensemester_kurzbz + '/' + - this.statusId.ausbildungssemester, - this.statusData) - .then( - result => { - this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); - this.hideModal('statusModal'); - this.resetModal(); - }) - .catch(this.$fhcAlert.handleSystemError) - .finally(() => { - window.scrollTo(0, 0); - this.reload(); - }); - }, checkIfLastStatus(){ return this.$fhcApi .get('api/frontend/v1/stv/status/isLastStatus/' + this.modelValue.prestudent_id) @@ -924,7 +804,7 @@ export default{ }) .catch(this.$fhcAlert.handleSystemError); }, -/* checkIfBewerber(prestudentIds){ + /*checkIfBewerber(prestudentIds){ if(!prestudentIds) prestudentIds = [this.modelValue.prestudent_id]; @@ -965,7 +845,7 @@ export default{ this.$reloadList(); } -/!* return this.$fhcApi + /!*return this.$fhcApi .get('api/frontend/v1/stv/status/hasStatusBewerber/' + prestudent_id) .then( result => { @@ -986,14 +866,15 @@ export default{ }) .catch(this.$fhcAlert.handleSystemError); }, - reload(){ - this.$refs.table.reloadTable(); //bei multiactions not working + reload() { + if (this.$refs.table) + this.$refs.table.reloadTable(); }, hideModal(modalRef){ this.$refs[modalRef].hide(); this.statusNew = true; }, - resetModal(){ + resetModal() { this.statusData = {}; this.statusId = {}; this.actionButton = {}; @@ -1022,20 +903,6 @@ export default{ }, }, created(){ - this.$fhcApi - .get('api/frontend/v1/stv/prestudent/getStudienplaene/' + encodeURIComponent(this.paramIds)) - .then(result => result.data) - .then(result => { - this.listStudienplaene = result; - }) - .catch(this.$fhcAlert.handleSystemError); - this.$fhcApi - .get('api/frontend/v1/stv/status/getStatusgruende/') - .then(result => result.data) - .then(result => { - this.listStatusgruende = result; - }) - .catch(this.$fhcAlert.handleSystemError); this.$fhcApi .get('api/frontend/v1/stv/status/getLastBismeldestichtag/') .then(result => { @@ -1056,155 +923,6 @@ export default{
- - - - - - -

- {{$p.t('bismeldestichtag', 'info_MeldestichtagStatusgrund')}} -

-

- {{$p.t('bismeldestichtag', 'info_MeldestichtagStatusgrundSemester')}} -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - -