From 326d4b392319a8e2615d11bd5973fd24bed85471 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Fri, 30 Jan 2026 10:31:38 +0100 Subject: [PATCH] Revert "refactor in computed section: Tabs Betriebsmittel, Abschlusspruefung, Anrechnungen, Aufnahmetermine, Kontakt, Prestudent, Status, bugfix Lehrveranstaltungstermine: sorter for Lektor as string" This reverts commit f2107a377f5b5db4fc2d8e3b666a283248e28466. --- .../Betriebsmittel/Betriebsmittel.js | 43 +- .../Abschlusspruefung/Abschlusspruefung.js | 159 +++-- .../Details/Anrechnungen/Anrechnungen.js | 42 +- .../Aufnahmetermine/Aufnahmetermine.js | 304 +++++---- .../Details/Kontakt/Address.js | 73 +- .../Details/Kontakt/AddressOld.js | 622 ------------------ .../Details/Kontakt/Contact.js | 76 +-- .../ListLehrveranstaltungstermine.js | 126 +--- .../Details/Prestudent/History.js | 28 +- .../Details/Prestudent/MultiStatus.js | 84 ++- 10 files changed, 390 insertions(+), 1167 deletions(-) delete mode 100644 public/js/components/Stv/Studentenverwaltung/Details/Kontakt/AddressOld.js diff --git a/public/js/components/Betriebsmittel/Betriebsmittel.js b/public/js/components/Betriebsmittel/Betriebsmittel.js index 2c88448d3..148d7a83c 100644 --- a/public/js/components/Betriebsmittel/Betriebsmittel.js +++ b/public/js/components/Betriebsmittel/Betriebsmittel.js @@ -43,22 +43,7 @@ export default { }, data() { return { - listBetriebsmitteltyp: [], - formData: { - ausgegebenam : new Date(), - betriebsmitteltyp: 'Zutrittskarte' - }, - statusNew: true, - filteredInventar: [], - layout: 'fitColumns', - layoutColumnsOnNewData: false, - height: '550', - persistenceID: 'core-betriebsmittel' - } - }, - computed: { - tabulatorOptions() { - const options = { + tabulatorOptions: { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call( this.endpoint.getAllBetriebsmittel(this.typeId, this.id, (this.filterByProvidedTypes ? this.betriebsmittelTypes : null)) @@ -130,7 +115,7 @@ export default { '/content/pdfExport.php?xml=betriebsmittelperson.rdf.php&xsl=Uebernahme&id=' + cellData.betriebsmittelperson_id + '&output=pdf'; window.open(linkToPdf, '_blank'); - }); + }); container.append(button); button = document.createElement('button'); @@ -158,13 +143,13 @@ export default { return container; }, frozen: true - } - ], - }; - return options; - }, - tabulatorEvents() { - const events = [ + }], + layout: 'fitColumns', + layoutColumnsOnNewData: false, + height: '550', + persistenceID: 'core-betriebsmittel' + }, + tabulatorEvents: [ { event: 'tableBuilt', handler: async() => { @@ -208,8 +193,14 @@ export default { }); } } - ]; - return events; + ], + listBetriebsmitteltyp: [], + formData: { + ausgegebenam : new Date(), + betriebsmitteltyp: 'Zutrittskarte' + }, + statusNew: true, + filteredInventar: [] } }, watch: { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js b/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js index da938b063..d46e1f299 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js @@ -34,58 +34,40 @@ export default { default: false } }, + computed: { + studentUids() { + if (this.student.uid) + { + return [this.student.uid]; + } + return this.student.map(e => e.uid); + }, + studentKzs(){ + if (this.student.uid) + { + return [this.student.studiengang_kz]; + } + return this.student.map(e => e.studiengang_kz); + }, + stg_kz(){ + return this.studentKzs[0]; + }, + showAllFormats() { + if( this.isBerechtigtDocAndOdt === false + || !Array.isArray(this.isBerechtigtDocAndOdt) ) + { + return false; + } + let retval = this.isBerechtigtDocAndOdt.includes(this.stgInfo.oe_kurzbz); + return retval; + } + }, props: { student: Object }, data() { return { - tabulatorData: [], - lastSelected: null, - formData: { - typStg: null, - pruefungstyp_kurzbz: null, - akadgrad_id: null, - vorsitz: null, - pruefungsantritt_kurzbz: null, - abschlussbeurteilung_kurzbz: null, - datum: null, - sponsion: null, - pruefer1: null, - pruefer2: null, - pruefer3: null, - anmerkung: null, - protokoll: null, - note: null, - link: null - }, - statusNew: true, - arrTypen: [], - arrAntritte: [], - arrBeurteilungen: [], - arrAkadGrad: [], - arrNoten: [], - selectedVorsitz: null, - filteredMitarbeiter: [], - filteredPersons: [], - selectedPruefer1: null, - selectedPruefer2: null, - selectedPruefer3: null, - stgInfo: { typ: '', oe_kurzbz: '' }, - abortController: { - mitarbeiter: null, - persons: null - }, - layout: 'fitDataStretchFrozen', - layoutColumnsOnNewData: false, - height: 'auto', - minHeight: '200', - index: 'abschlusspruefung_id', - persistenceID: 'stv-details-finalexam-2025112401' - } - }, - computed: { - tabulatorOptions() { - const options = { + tabulatorOptions: { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call(ApiStvAbschlusspruefung.getAbschlusspruefung(this.student.uid)), ajaxResponse: (url, params, response) => response.data, @@ -181,11 +163,14 @@ export default { frozen: true }, ], - }; - return options; - }, - tabulatorEvents() { - const events = [ + layout: 'fitDataStretchFrozen', + layoutColumnsOnNewData: false, + height: 'auto', + minHeight: '200', + index: 'abschlusspruefung_id', + persistenceID: 'stv-details-finalexam-2025112401' + }, + tabulatorEvents: [ { event: 'dataLoaded', handler: data => this.tabulatorData = data.map(item => { @@ -240,36 +225,50 @@ export default { cm.getColumnByField('abschlusspruefung_id').component.updateDefinition({ title: this.$p.t('abschlusspruefung', 'abschlusspruefung_id') }); + /* + cm.getColumnByField('actions').component.updateDefinition({ + title: this.$p.t('global', 'aktionen') + }); + */ } } - ]; - return events; - }, - studentUids() { - if (this.student.uid) - { - return [this.student.uid]; - } - return this.student.map(e => e.uid); - }, - studentKzs(){ - if (this.student.uid) - { - return [this.student.studiengang_kz]; - } - return this.student.map(e => e.studiengang_kz); - }, - stg_kz(){ - return this.studentKzs[0]; - }, - showAllFormats() { - if( this.isBerechtigtDocAndOdt === false - || !Array.isArray(this.isBerechtigtDocAndOdt) ) - { - return false; - } - let retval = this.isBerechtigtDocAndOdt.includes(this.stgInfo.oe_kurzbz); - return retval; + ], + tabulatorData: [], + lastSelected: null, + formData: { + typStg: null, + pruefungstyp_kurzbz: null, + akadgrad_id: null, + vorsitz: null, + pruefungsantritt_kurzbz: null, + abschlussbeurteilung_kurzbz: null, + datum: null, + sponsion: null, + pruefer1: null, + pruefer2: null, + pruefer3: null, + anmerkung: null, + protokoll: null, + note: null, + link: null + }, + statusNew: true, + arrTypen: [], + arrAntritte: [], + arrBeurteilungen: [], + arrAkadGrad: [], + arrNoten: [], + selectedVorsitz: null, + filteredMitarbeiter: [], + filteredPersons: [], + selectedPruefer1: null, + selectedPruefer2: null, + selectedPruefer3: null, + stgInfo: { typ: '', oe_kurzbz: '' }, + abortController: { + mitarbeiter: null, + persons: null + }, } }, watch: { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js b/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js index 32224062d..a2029b0b9 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js @@ -31,24 +31,7 @@ export default { }, data() { return { - formData: {}, - listBegruendungen: [], - listNewLehrveranstaltungen: [], - listLektoren: [], - listKompatibleLehrveranstaltungen: [], - statusNew: true, - showNotizen: false, - currentAnrechnung_id: null, - endpoint: ApiNotizPerson, - layout: 'fitDataStretchFrozen', - height: '500', - index: 'anrechnung_id', - persistenceID: 'stv-details-anrechnungen-2025112401' - } - }, - computed: { - tabulatorOptions() { - const options = { + tabulatorOptions: { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call( ApiStvExemptions.getAnrechnungen(this.student.prestudent_id) @@ -124,11 +107,12 @@ export default { frozen: true }, ], - }; - return options; - }, - tabulatorEvents() { - const events = [ + layout: 'fitDataStretchFrozen', + height: '500', + index: 'anrechnung_id', + persistenceID: 'stv-details-anrechnungen-2025112401' + }, + tabulatorEvents: [ { event: 'tableBuilt', handler: async () => { @@ -170,8 +154,16 @@ export default { } } - ]; - return events; + ], + formData: {}, + listBegruendungen: [], + listNewLehrveranstaltungen: [], + listLektoren: [], + listKompatibleLehrveranstaltungen: [], + statusNew: true, + showNotizen: false, + currentAnrechnung_id: null, + endpoint: ApiNotizPerson } }, watch: { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js b/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js index b2ba26a55..d03569df4 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js @@ -36,19 +36,158 @@ export default { }, data() { return { + tabulatorOptions: { + ajaxURL: 'dummy', + ajaxRequestFunc: () => this.$api.call( + ApiStvAdmissionDates.getAufnahmetermine(this.student.person_id) + ), + ajaxResponse: (url, params, response) => response.data, + columns: [ + {title: "rt_id", field: "rt_id", visible: false}, + {title: "rt_person_id", field: "rt_person_id", visible: false}, + {title: "person_id", field: "person_id", visible: false}, + {title: "datum", field: "datum", + formatter: function (cell) { + const dateStr = cell.getValue(); + if (!dateStr) return ""; + + const date = new Date(dateStr); + return date.toLocaleString("de-DE", { + day: "2-digit", + month: "2-digit", + year: "numeric", + }); + } + }, + {title: "stufe", field: "stufe"}, + {title: "studiensemester", field: "studiensemester"}, + {title: "anmerkung", field: "anmerkung", visible: false}, + {title: "anmeldedatum", field: "anmeldedatum", visible: false, + formatter: function (cell) { + const dateStr = cell.getValue(); + if (!dateStr) return ""; + + const date = new Date(dateStr); + return date.toLocaleString("de-DE", { + day: "2-digit", + month: "2-digit", + year: "numeric", + }); + } + }, + {title: "punkte", field: "punkte"}, + { + title: "teilgenommen", field: "teilgenommen", + formatter: "tickCross", + hozAlign: "center", + formatterParams: { + tickElement: '', + crossElement: '' + } + }, + {title: "ort", field: "ort", visible: false}, + {title: "studienplan", field: "studienplan", visible: false}, + {title: "studienplan_id", field: "studienplan_id", visible: false}, + {title: "stg", field: "studiengangkurzbzlang"}, + {title: "Stg", field: "stg_kuerzel"}, + { + title: 'Aktionen', field: 'actions', + minWidth: 150, // Ensures Action-buttons will be always fully displayed + formatter: (cell, formatterParams, onRendered) => { + let container = document.createElement('div'); + container.className = "d-flex gap-2"; + + let button = document.createElement('button'); + button.className = 'btn btn-outline-secondary btn-action'; + button.innerHTML = ''; + button.title = this.$p.t('ui', 'bearbeiten'); + button.addEventListener('click', (event) => + this.actionEditPlacementTest(cell.getData().rt_person_id) + ); + container.append(button); + + button = document.createElement('button'); + button.className = 'btn btn-outline-secondary btn-action'; + button.innerHTML = ''; + button.title = this.$p.t('ui', 'loeschen'); + button.addEventListener('click', () => + this.actionDeletePlacementTest(cell.getData().rt_person_id) + ); + container.append(button); + + return container; + }, + frozen: true + } + ], + layout: 'fitDataStretchFrozen', + layoutColumnsOnNewData: false, + height: 'auto', + minHeight: 200, + index: 'aufnahmetermin_id', + persistenceID: 'stv-details-table_admission-dates-2025112401' + }, + tabulatorEvents: [ + { + event: 'tableBuilt', + handler: async () => { + await this.$p.loadCategory(['admission', 'global', 'person', 'ui', 'projektarbeitsbeurteilung']); + let cm = this.$refs.table.tabulator.columnManager; + + cm.getColumnByField('rt_id').component.updateDefinition({ + title: this.$p.t('ui', 'reihungstest_id') + }); + cm.getColumnByField('rt_person_id').component.updateDefinition({ + title: this.$p.t('ui', 'reihungstest_person_id') + }); + cm.getColumnByField('person_id').component.updateDefinition({ + title: this.$p.t('person', 'person_id') + }); + cm.getColumnByField('datum').component.updateDefinition({ + title: this.$p.t('global', 'datum') + }); + cm.getColumnByField('stufe').component.updateDefinition({ + title: this.$p.t('admission', 'stufe') + }); + cm.getColumnByField('studiensemester').component.updateDefinition({ + title: this.$p.t('lehre', 'studiensemester') + }); + cm.getColumnByField('anmerkung').component.updateDefinition({ + title: this.$p.t('global', 'anmerkung') + }); + cm.getColumnByField('anmeldedatum').component.updateDefinition({ + title: this.$p.t('admission', 'anmeldedatum') + }); + cm.getColumnByField('punkte').component.updateDefinition({ + title: this.$p.t('exam', 'punkte') + }); + cm.getColumnByField('teilgenommen').component.updateDefinition({ + title: this.$p.t('admission', 'teilgenommen') + }); + cm.getColumnByField('ort').component.updateDefinition({ + title: this.$p.t('person', 'ort') + }); + cm.getColumnByField('studienplan').component.updateDefinition({ + title: this.$p.t('lehre', 'studienplan') + }); + cm.getColumnByField('studienplan_id').component.updateDefinition({ + title: this.$p.t('ui', 'studienplan_id') + }); + cm.getColumnByField('studiengangkurzbzlang').component.updateDefinition({ + title: this.$p.t('projektarbeitsbeurteilung', 'studiengang') + }); + cm.getColumnByField('stg_kuerzel').component.updateDefinition({ + title: this.$p.t('admission', 'stg_kurz') + }); + } + } + ], formData: {}, statusNew: true, listPlacementTests: [], listStudyPlans: [], filterOnlyFutureTestsSet: false, - filteredPlacementTests: [], - //data after tabulator data - layout: 'fitDataStretchFrozen', - layoutColumnsOnNewData: false, - height: 'auto', - minHeight: 200, - index: 'aufnahmetermin_id', - persistenceID: 'stv-details-table_admission-dates-2025112401' + filteredPlacementTests: [] } }, methods: { @@ -193,155 +332,6 @@ export default { this.formData = {}; }, }, - computed: { - tabulatorOptions() { - const options = { - ajaxURL: 'dummy', - ajaxRequestFunc: () => this.$api.call( - ApiStvAdmissionDates.getAufnahmetermine(this.student.person_id) - ), - ajaxResponse: (url, params, response) => response.data, - columns: [ - {title: "rt_id", field: "rt_id", visible: false}, - {title: "rt_person_id", field: "rt_person_id", visible: false}, - {title: "person_id", field: "person_id", visible: false}, - {title: "datum", field: "datum", - formatter: function (cell) { - const dateStr = cell.getValue(); - if (!dateStr) return ""; - - const date = new Date(dateStr); - return date.toLocaleString("de-DE", { - day: "2-digit", - month: "2-digit", - year: "numeric", - }); - } - }, - {title: "stufe", field: "stufe"}, - {title: "studiensemester", field: "studiensemester"}, - {title: "anmerkung", field: "anmerkung", visible: false}, - {title: "anmeldedatum", field: "anmeldedatum", visible: false, - formatter: function (cell) { - const dateStr = cell.getValue(); - if (!dateStr) return ""; - - const date = new Date(dateStr); - return date.toLocaleString("de-DE", { - day: "2-digit", - month: "2-digit", - year: "numeric", - }); - } - }, - {title: "punkte", field: "punkte"}, - { - title: "teilgenommen", field: "teilgenommen", - formatter: "tickCross", - hozAlign: "center", - formatterParams: { - tickElement: '', - crossElement: '' - } - }, - {title: "ort", field: "ort", visible: false}, - {title: "studienplan", field: "studienplan", visible: false}, - {title: "studienplan_id", field: "studienplan_id", visible: false}, - {title: "stg", field: "studiengangkurzbzlang"}, - {title: "Stg", field: "stg_kuerzel"}, - { - title: 'Aktionen', field: 'actions', - minWidth: 150, // Ensures Action-buttons will be always fully displayed - formatter: (cell, formatterParams, onRendered) => { - let container = document.createElement('div'); - container.className = "d-flex gap-2"; - - let button = document.createElement('button'); - button.className = 'btn btn-outline-secondary btn-action'; - button.innerHTML = ''; - button.title = this.$p.t('ui', 'bearbeiten'); - button.addEventListener('click', (event) => - this.actionEditPlacementTest(cell.getData().rt_person_id) - ); - container.append(button); - - button = document.createElement('button'); - button.className = 'btn btn-outline-secondary btn-action'; - button.innerHTML = ''; - button.title = this.$p.t('ui', 'loeschen'); - button.addEventListener('click', () => - this.actionDeletePlacementTest(cell.getData().rt_person_id) - ); - container.append(button); - - return container; - }, - frozen: true - } - ], - }; - return options; - }, - tabulatorEvents() { - const events = [ - { - event: 'tableBuilt', - handler: async () => { - await this.$p.loadCategory(['admission', 'global', 'person', 'ui', 'projektarbeitsbeurteilung']); - let cm = this.$refs.table.tabulator.columnManager; - - cm.getColumnByField('rt_id').component.updateDefinition({ - title: this.$p.t('ui', 'reihungstest_id') - }); - cm.getColumnByField('rt_person_id').component.updateDefinition({ - title: this.$p.t('ui', 'reihungstest_person_id') - }); - cm.getColumnByField('person_id').component.updateDefinition({ - title: this.$p.t('person', 'person_id') - }); - cm.getColumnByField('datum').component.updateDefinition({ - title: this.$p.t('global', 'datum') - }); - cm.getColumnByField('stufe').component.updateDefinition({ - title: this.$p.t('admission', 'stufe') - }); - cm.getColumnByField('studiensemester').component.updateDefinition({ - title: this.$p.t('lehre', 'studiensemester') - }); - cm.getColumnByField('anmerkung').component.updateDefinition({ - title: this.$p.t('global', 'anmerkung') - }); - cm.getColumnByField('anmeldedatum').component.updateDefinition({ - title: this.$p.t('admission', 'anmeldedatum') - }); - cm.getColumnByField('punkte').component.updateDefinition({ - title: this.$p.t('exam', 'punkte') - }); - cm.getColumnByField('teilgenommen').component.updateDefinition({ - title: this.$p.t('admission', 'teilgenommen') - }); - cm.getColumnByField('ort').component.updateDefinition({ - title: this.$p.t('person', 'ort') - }); - cm.getColumnByField('studienplan').component.updateDefinition({ - title: this.$p.t('lehre', 'studienplan') - }); - cm.getColumnByField('studienplan_id').component.updateDefinition({ - title: this.$p.t('ui', 'studienplan_id') - }); - cm.getColumnByField('studiengangkurzbzlang').component.updateDefinition({ - title: this.$p.t('projektarbeitsbeurteilung', 'studiengang') - }); - cm.getColumnByField('stg_kuerzel').component.updateDefinition({ - title: this.$p.t('admission', 'stg_kurz') - }); - } - } - ]; - - return events; - } - }, created() { this.$api .call(ApiStvAdmissionDates.getListPlacementTests(this.student.prestudent_id)) diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Address.js b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Address.js index e4174e378..7bb8080e1 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Address.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Address.js @@ -23,36 +23,7 @@ export default{ }, data() { return { - addressData: { - zustelladresse: true, - heimatadresse: true, - rechnungsadresse: false, - typ: 'h', - nation: 'A', - address: {plz: null}, - plz: null, - }, - statusNew: true, - places: [], - suggestions: {}, - nations: [], - adressentypen: [], - firmen: [], - listFirmen: [], - filteredFirmen: [], - selectedFirma: null, - abortController: { - suggestions: null, - places: null - }, - height: 'auto', - index: 'adresse_id', - persistenceID: 'stv-details-kontakt-address' - } - }, - computed:{ - tabulatorOptions() { - const options = { + tabulatorOptions: { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call(ApiStvAddress.get(this.uid)), ajaxResponse: (url, params, response) => response.data, @@ -151,11 +122,11 @@ export default{ frozen: true }, ], - }; - return options; - }, - tabulatorEvents() { - const events = [ + height: 'auto', + index: 'adresse_id', + persistenceID: 'stv-details-kontakt-address' + }, + tabulatorEvents: [ { event: 'tableBuilt', handler: async () => { @@ -213,11 +184,37 @@ export default{ cm.getColumnByField('person_id').component.updateDefinition({ title: this.$p.t('person', 'person_id') }); +/* cm.getColumnByField('actions').component.updateDefinition({ + title: this.$p.t('global', 'aktionen') + });*/ } } - ]; - return events; - }, + ], + addressData: { + zustelladresse: true, + heimatadresse: true, + rechnungsadresse: false, + typ: 'h', + nation: 'A', + address: {plz: null}, + plz: null, + }, + statusNew: true, + places: [], + suggestions: {}, + nations: [], + adressentypen: [], + firmen: [], + listFirmen: [], + filteredFirmen: [], + selectedFirma: null, + abortController: { + suggestions: null, + places: null + }, + } + }, + computed:{ orte() { return this.places.filter(ort => ort.name == this.addressData.gemeinde); }, diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/AddressOld.js b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/AddressOld.js deleted file mode 100644 index 7ed448cfd..000000000 --- a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/AddressOld.js +++ /dev/null @@ -1,622 +0,0 @@ -import {CoreFilterCmpt} from "../../../../filter/Filter.js"; -import PvAutoComplete from "../../../../../../../index.ci.php/public/js/components/primevue/autocomplete/autocomplete.esm.min.js"; -import FhcFormValidation from '../../../../Form/Validation.js'; -import BsModal from "../../../../Bootstrap/Modal.js"; -import FormForm from '../../../../Form/Form.js'; -import FormInput from '../../../../Form/Input.js'; - -import ApiStvAddress from '../../../../../api/factory/stv/kontakt/address.js'; -import ApiStvCompany from '../../../../../api/factory/stv/kontakt/company.js'; - -export default{ - name: 'AddressComponent', - components: { - CoreFilterCmpt, - PvAutoComplete, - FhcFormValidation, - BsModal, - FormForm, - FormInput - }, - props: { - uid: Number - }, - data() { - return { - tabulatorOptions: { - ajaxURL: 'dummy', - ajaxRequestFunc: () => this.$api.call(ApiStvAddress.get(this.uid)), - ajaxResponse: (url, params, response) => response.data, - //autoColumns: true, - columns:[ - {title:"Typ", field:"bezeichnung"}, - {title:"Strasse", field:"strasse"}, - {title:"Plz", field:"plz"}, - {title:"Ort", field:"ort"}, - {title:"Gemeinde", field:"gemeinde"}, - {title:"Nation", field:"nation"}, - { - title:"Heimatadresse", - field:"heimatadresse", - formatter:"tickCross", - hozAlign:"center", - formatterParams: { - tickElement: '', - crossElement: '' - } - }, - { - title:"Zustelladresse", - field:"zustelladresse", - formatter:"tickCross", - hozAlign:"center", - formatterParams: { - tickElement: '', - crossElement: '' - } - }, - {title:"Abweich.Empf", field:"co_name"}, - {title:"Firma", field:"firmenname"}, - {title:"Firma_id", field:"firma_id", visible:false}, - {title:"Adresse_id", field:"adresse_id", visible:false}, - {title:"Person_id", field:"person_id", visible:false}, - {title:"Name", field:"name", visible:false}, - { - title:"letzte Änderung", - field:"lastupdate", - visible: false, - formatter: function (cell) { - const dateStr = cell.getValue(); - if (!dateStr) return ""; - - const date = new Date(dateStr); - return date.toLocaleString("de-DE", { - day: "2-digit", - month: "2-digit", - year: "numeric", - hour: "2-digit", - minute: "2-digit", - second: "2-digit", - hour12: false - }); - } - }, - {title:"Rechnungsadresse", field:"rechnungsadresse", visible:false, - formatter: (cell, formatterParams, onRendered) => { - let output = cell.getValue() ? this.$p.t('ui','ja') : this.$p.t('ui','nein'); - return output; - } - }, - {title:"Anmerkung", field:"anmerkung", visible:false}, - {title: 'Aktionen', field: 'actions', - minWidth: 150, // Ensures Action-buttons will be always fully displayed - formatter: (cell, formatterParams, onRendered) => { - let container = document.createElement('div'); - container.className = "d-flex gap-2"; - - let button = document.createElement('button'); - button.className = 'btn btn-outline-secondary btn-action'; - button.innerHTML = ''; - button.title = this.$p.t('person', 'adresse_edit'); - button.addEventListener('click', (event) => - this.actionEditAdress(cell.getData().adresse_id) - ); - container.append(button); - - button = document.createElement('button'); - button.className = 'btn btn-outline-secondary btn-action'; - button.innerHTML = ''; - button.title = this.$p.t('person', 'adresse_delete'); - - button.addEventListener('click', () => { - if (cell.getData().heimatadresse) - this.$fhcAlert.alertError(this.$p.t('person', 'error_deleteHomeAdress')); - else - this.actionDeleteAdress(cell.getData().adresse_id) - }); - - container.append(button); - - return container; - }, - frozen: true - }, - ], - height: 'auto', - index: 'adresse_id', - persistenceID: 'stv-details-kontakt-address' - }, - tabulatorEvents: [ - { - event: 'tableBuilt', - handler: async () => { - await this.$p.loadCategory(['notiz', 'global', 'person', 'ui']); - let cm = this.$refs.table.tabulator.columnManager; - - cm.getColumnByField('bezeichnung').component.updateDefinition({ - title: this.$p.t('global', 'typ') - }); - cm.getColumnByField('strasse').component.updateDefinition({ - title: this.$p.t('person', 'strasse') - }); - cm.getColumnByField('plz').component.updateDefinition({ - title: this.$p.t('person', 'plz') - }); - cm.getColumnByField('ort').component.updateDefinition({ - title: this.$p.t('person', 'ort') - }); - cm.getColumnByField('gemeinde').component.updateDefinition({ - title: this.$p.t('person', 'gemeinde') - }); - cm.getColumnByField('nation').component.updateDefinition({ - title: this.$p.t('person', 'nation') - }); - cm.getColumnByField('heimatadresse').component.updateDefinition({ - title: this.$p.t('person', 'heimatadresse') - }); - cm.getColumnByField('zustelladresse').component.updateDefinition({ - title: this.$p.t('person', 'zustelladresse') - }); - cm.getColumnByField('co_name').component.updateDefinition({ - title: this.$p.t('person', 'co_name') - }); - cm.getColumnByField('name').component.updateDefinition({ - title: this.$p.t('person', 'firma_zusatz') - }); - cm.getColumnByField('firmenname').component.updateDefinition({ - title: this.$p.t('person', 'firma') - }); - cm.getColumnByField('lastupdate').component.updateDefinition({ - title: this.$p.t('notiz', 'letzte_aenderung') - }); - cm.getColumnByField('rechnungsadresse').component.updateDefinition({ - title: this.$p.t('person', 'rechnungsadresse') - }); - cm.getColumnByField('anmerkung').component.updateDefinition({ - title: this.$p.t('global', 'anmerkung') - }); - cm.getColumnByField('firma_id').component.updateDefinition({ - title: this.$p.t('ui', 'firma_id') - }); - cm.getColumnByField('adresse_id').component.updateDefinition({ - title: this.$p.t('ui', 'adresse_id') - }); - cm.getColumnByField('person_id').component.updateDefinition({ - title: this.$p.t('person', 'person_id') - }); - /* cm.getColumnByField('actions').component.updateDefinition({ - title: this.$p.t('global', 'aktionen') - });*/ - } - } - ], - addressData: { - zustelladresse: true, - heimatadresse: true, - rechnungsadresse: false, - typ: 'h', - nation: 'A', - address: {plz: null}, - plz: null, - }, - statusNew: true, - places: [], - suggestions: {}, - nations: [], - adressentypen: [], - firmen: [], - listFirmen: [], - filteredFirmen: [], - selectedFirma: null, - abortController: { - suggestions: null, - places: null - }, - } - }, - computed:{ - orte() { - return this.places.filter(ort => ort.name == this.addressData.gemeinde); - }, - gemeinden() { - return Object.values(this.places.reduce((res,place) => { - res[place.name] = place; - return res; - }, {})); - } - }, - watch: { - uid() { - this.reload(); - }, - selectedFirma(newVal) { - this.addressData.firma_id = newVal?.firma_id || null; - } - }, - methods:{ - actionNewAdress() { - this.resetModal(); - this.$refs.adressModal.show(); - }, - actionEditAdress(adresse_id) { - this.statusNew = false; - this.loadAdress(adresse_id).then(() => { - if(this.addressData.adresse_id) - { - this.selectedFirma = this.listFirmen.find( - item => item.firma_id === this.addressData.firma_id - ); - - this.addressData.address.plz = this.addressData.plz; - // delete this.addressData.plz; - this.loadPlaces(this.addressData.address.plz); - this.$refs.adressModal.show(); - - } - }); - }, - actionDeleteAdress(adresse_id) { - this.$fhcAlert - .confirmDelete() - .then(result => result - ? adresse_id - : Promise.reject({handled: true})) - .then(this.deleteAddress) - .catch(this.$fhcAlert.handleSystemError); - }, - addNewAddress(addressData) { - this.addressData.plz = this.addressData.address.plz; - return this.$refs.addressData - .call(ApiStvAddress.add(this.uid, this.addressData)) - .then(response => { - this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); - this.hideModal('adressModal'); - this.resetModal(); - }) - .catch(this.$fhcAlert.handleSystemError) - .finally(this.reload); - }, - reload() { - this.$refs.table.reloadTable(); - }, - loadAdress(adresse_id) { - this.statusNew = false; - return this.$api - .call(ApiStvAddress.load(adresse_id)) - .then(result => { - this.addressData = result.data; - this.addressData.address = {}; - this.addressData.address.plz = this.addressData.plz || null; - return result; - }) - .catch(this.$fhcAlert.handleSystemError); - }, - updateAddress(adresse_id) { - this.addressData.plz = this.addressData.address.plz; - return this.$refs.addressData - .call(ApiStvAddress.update(adresse_id, this.addressData)) - .then(response => { - this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); - this.hideModal('adressModal'); - this.resetModal(); - }) - .catch(this.$fhcAlert.handleSystemError) - .finally(this.reload); - }, - deleteAddress(adresse_id) { - return this.$api - .call(ApiStvAddress.delete(adresse_id)) - .then(response => { - this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete')); - }) - .catch(this.$fhcAlert.handleSystemError) - .finally(() => { - window.scrollTo(0, 0); - this.reload(); - }); - }, - loadPlaces() { - if (this.abortController.places) - this.abortController.places.abort(); - if (this.addressData.nation != 'A' || !this.addressData.address.plz) - return; - - this.abortController.places = new AbortController(); - - return this.$api - .call(ApiStvAddress.getPlaces(this.addressData.address.plz)) - .then(result => { - this.places = result.data; - }); - }, - filterFirmen(event) { - const query = event?.query?.toLowerCase()?.trim() || ""; - - this.filteredFirmen = this.listFirmen.filter(item => { - const label = (item.label || "").toLowerCase(); - return label.includes(query); - }); - }, - hideModal(modalRef) { - this.$refs[modalRef].hide(); - }, - resetModal() { - this.addressData = {}; - - this.addressData.strasse = null; - this.addressData.zustelladresse = true; - this.addressData.heimatadresse = true; - this.addressData.rechnungsadresse = false; - this.addressData.co_name = null; - this.addressData.firma_id = null; - this.addressData.name = null; - this.addressData.anmerkung = null; - this.addressData.typ = 'h'; - this.addressData.nation = 'A'; - this.addressData.address = {plz: null}; - this.selectedFirma = null; - - this.statusNew = true; - }, - }, - created() { - this.$api - .call(ApiStvAddress.getNations()) - .then(result => { - this.nations = result.data; - }) - .catch(this.$fhcAlert.handleSystemError); - - this.$api - .call(ApiStvAddress.getTypes()) - .then(result => { - this.adressentypen = result.data; - }) - .catch(this.$fhcAlert.handleSystemError); - - this.$api - .call(ApiStvAddress.getAllFirmen()) - .then(result => { - this.listFirmen = result.data; - }) - .catch(this.$fhcAlert.handleSystemError); - }, - template: ` -
- - - - - - -
- - - -
- -
- - -
- -
- - - -
- -
- - -
- -
- - - - - - -
- -
- - - - - - -
- -
-
- - -
-
- -
-
- - -
-
- -
- - -
- -
-
- - -
-
- -
- - -
- -
- -
- -
- - -
- -
- - -
- -
- - -
- - - -
` -}; - - - diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js index f7fad0dfb..1ff34dc79 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Contact.js @@ -7,7 +7,7 @@ import FormInput from '../../../../Form/Input.js'; import ApiStvContact from '../../../../../api/factory/stv/kontakt/contact.js'; import ApiStvCompany from '../../../../../api/factory/stv/kontakt/company.js'; -export default { +export default{ name: 'ContactComponent', components: { CoreFilterCmpt, @@ -20,42 +20,8 @@ export default { uid: Number }, data() { - return { - lastSelected: null, - contactData: { - zustellung: true, - kontakttyp: 'email', - firma_id: null - }, - statusNew: true, - kontakttypen: [], - firmen: [], - filteredFirmen: [], - filteredOrte: null, - abortController: { - firmen: null, - standorte: null - }, - lastSelected: null, - contactData: { - zustellung: true, - kontakttyp: 'email', - firma_id: null - }, - statusNew: true, - kontakttypen: [], - firmen: [], - filteredFirmen: [], - filteredOrte: null, - abortController: { - firmen: null, - standorte: null - }, - } - }, - computed: { - tabulatorOptions(){ - const options = { + return{ + tabulatorOptions: { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call(ApiStvContact.get(this.uid)), ajaxResponse: (url, params, response) => response.data, @@ -128,11 +94,11 @@ export default { frozen: true }, ], - }; - return options; - }, - tabulatorEvents() { - const events = [ + height: 'auto', + index: 'kontakt_id', + persistenceID: 'stv-details-kontakt-contact' + }, + tabulatorEvents: [ { event: 'tableBuilt', handler: async() => { @@ -173,11 +139,27 @@ export default { cm.getColumnByField('standort_id').component.updateDefinition({ title: this.$p.t('ui', 'standort_id') }); - } - } - ]; - return events; - }, +/* cm.getColumnByField('actions').component.updateDefinition({ + title: this.$p.t('global', 'aktionen') + });*/ + }} + ], + lastSelected: null, + contactData: { + zustellung: true, + kontakttyp: 'email', + firma_id: null + }, + statusNew: true, + kontakttypen: [], + firmen: [], + filteredFirmen: [], + filteredOrte: null, + abortController: { + firmen: null, + standorte: null + }, + } }, watch: { uid() { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine/ListLehrveranstaltungstermine.js b/public/js/components/Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine/ListLehrveranstaltungstermine.js index cd5f8f1f3..20cb95fbd 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine/ListLehrveranstaltungstermine.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine/ListLehrveranstaltungstermine.js @@ -11,6 +11,22 @@ export default { FormInput, FormForm }, + computed: { + downloadLink: function(){ + if(!this.dataSem.start || !this.dataSem.ende || !this.student.uid) return; + let start = new Date(this.dataSem.start); + start = Math.floor(start.getTime()/1000); + let ende = new Date(this.dataSem.ende); + ende = Math.floor(ende.getTime() / 1000); + + let link = + FHC_JS_DATA_STORAGE_OBJECT.app_root + "cis/private/lvplan/stpl_kalender.php?type=student&pers_uid=" + this.student.uid + "&begin=" + start + "&ende= " +ende + "&format=excel"; + return link; + }, + dbStundenplanTable: function (){ + return this.showStundenplanDev ? 'stundenplandev' : 'stundenplan'; + } + }, inject: { currentSemester: { from: 'currentSemester', @@ -28,114 +44,6 @@ export default { showStundenplanDev: false }; }, - computed: { - downloadLink: function(){ - if(!this.dataSem.start || !this.dataSem.ende || !this.student.uid) return; - let start = new Date(this.dataSem.start); - start = Math.floor(start.getTime()/1000); - let ende = new Date(this.dataSem.ende); - ende = Math.floor(ende.getTime() / 1000); - - let link = - FHC_JS_DATA_STORAGE_OBJECT.app_root + "cis/private/lvplan/stpl_kalender.php?type=student&pers_uid=" + this.student.uid + "&begin=" + start + "&ende= " +ende + "&format=excel"; - return link; - }, - dbStundenplanTable: function (){ - return this.showStundenplanDev ? 'stundenplandev' : 'stundenplan'; - }, - /* tabulatorOptions() { - const options = { - ajaxURL: 'dummy', - ajaxRequestFunc: () => this.$api.call( - ApiStvCoursedates.getCourselist({ - student_uid: this.student.uid, - start_date: this.dataSem.start, - end_date: this.dataSem.ende, - group_consecutiveHours: true, - dbStundenplanTable: this.dbStundenplanTable}) - ), - ajaxResponse: (url, params, response) => { - return response.data; - }, - columns: [ - {title: "lv_id", field: "lehrveranstaltung_id", visible: false}, - {title: "lehreinheit_id", field: "lehreinheit_id", visible: false}, - {title: "datum", field: "datum", - formatter: function (cell) { - const dateStr = cell.getValue(); - if (!dateStr) return ""; - - const date = new Date(dateStr); - return date.toLocaleString("de-DE", { - day: "2-digit", - month: "2-digit", - year: "numeric", - hour12: false - }); - }}, - {title: "beginn", field: "beginn"}, - {title: "ende", field: "ende"}, - {title: "farbe", field: "farbe", visible: false}, - {title: "Gruppen", field: "gruppen_kuerzel"}, - {title: "ort", field: "ort_kurzbz"}, - {title: "lektorIn", field: "lektorname", sorter:"string"}, - {title: "Lehrfach", field: "lehrfach_bez"} - ], - rowFormatter: function(row){ - var data = row.getData(); - //highlight background of row if color red in table - if(data.farbe == "A4A7FC"){ - let el = row.getElement(); - row.getElement().classList.add("highlight-row"); - row.getElement().classList.remove("tabulator-row-odd"); - row.getElement().classList.remove("tabulator-row-even"); - } - } - }; - return options; - }, - tabulatorEvents() { - const events = [ - { - event: 'tableBuilt', - handler: async() => { - await this.$p.loadCategory(['global', 'ui', 'lehre']); - - let cm = this.$refs.table.tabulator.columnManager; - - cm.getColumnByField('lehrveranstaltung_id').component.updateDefinition({ - title: this.$p.t('lehre', 'lehrveranstaltung_id') - }); - cm.getColumnByField('lehreinheit_id').component.updateDefinition({ - title: this.$p.t('global', 'lehreinheit_id') - }); - cm.getColumnByField('datum').component.updateDefinition({ - title: this.$p.t('global', 'datum') - }); - cm.getColumnByField('beginn').component.updateDefinition({ - title: this.$p.t('ui', 'dateFrom') - }); - cm.getColumnByField('ende').component.updateDefinition({ - title: this.$p.t('ui', 'dateTo') - }); - cm.getColumnByField('gruppen_kuerzel').component.updateDefinition({ - title: this.$p.t('global', 'gruppen') - }); - cm.getColumnByField('ort_kurzbz').component.updateDefinition({ - title: this.$p.t('global', 'ortLocation') - }); - cm.getColumnByField('lektorname').component.updateDefinition({ - title: this.$p.t('lehre', 'lektor') - }); - cm.getColumnByField('lehrfach_bez').component.updateDefinition({ - title: this.$p.t('global', 'lehrfach') - }); - } - - }]; - return events; - },*/ - }, methods: { initTabulatorOptions(){ this.tabulatorOptions = { @@ -172,7 +80,7 @@ export default { {title: "farbe", field: "farbe", visible: false}, {title: "Gruppen", field: "gruppen_kuerzel"}, {title: "ort", field: "ort_kurzbz"}, - {title: "lektorIn", field: "lektorname", sorter:"string"}, + {title: "lektorIn", field: "lektorname"}, {title: "Lehrfach", field: "lehrfach_bez"} ], rowFormatter: function(row){ diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/History.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/History.js index 1fe96188f..44b318f5b 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/History.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/History.js @@ -12,16 +12,7 @@ export default{ }, data() { return { - layout: 'fitDataFill', - layoutColumnsOnNewData: false, - height: 'auto', - selectable: false, - persistenceID: 'stv-details-prestudent-history', - } - }, - computed: { - tabulatorOptions() { - const options = { + tabulatorOptions: { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call(ApiStvPrestudent.getHistoryPrestudents(this.personId)), ajaxResponse: (url, params, response) => response.data, @@ -46,11 +37,13 @@ export default{ element.classList.add('fw-bold'); } }, - }; - return options; - }, - tabulatorEvents() { - const events = [ + layout: 'fitDataFill', + layoutColumnsOnNewData: false, + height: 'auto', + selectable: false, + persistenceID: 'stv-details-prestudent-history' + }, + tabulatorEvents: [ { event: 'tableBuilt', handler: async () => { @@ -71,9 +64,8 @@ export default{ }); } } - ]; - return events; - }, + ] + } }, watch: { personId() { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js index 8f381c330..e67f19ccf 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js @@ -26,8 +26,37 @@ export default{ } }, computed: { - tabulatorOptions() { - const options = { + prestudentIds() { + if (this.modelValue.prestudent_id) + { + return [this.modelValue.prestudent_id]; + } + return this.modelValue.map(e => e.prestudent_id); + }, + showToolbarStudent() { + if (Array.isArray(this.modelValue)) { + if (!this.modelValue.length) + return false; + return this.modelValue.every(item => item.uid); + } + return !!this.modelValue.uid; + }, + showToolbarInteressent() { + if (Array.isArray(this.modelValue)) { + if (!this.modelValue.length) + return false; + return !this.modelValue.some(item => item.uid); + } + return !this.modelValue.uid; + } + }, + props: { + modelValue: Object, + config: Object, + }, + data() { + return { + tabulatorOptions: { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call(ApiStvPrestudent.getHistoryPrestudent(this.modelValue.prestudent_id)), ajaxResponse: (url, params, response) => response.data, @@ -135,7 +164,7 @@ export default{ } }, {title: "UpdateVon", field: "updatevon", visible: false}, - /* {title: "Aufnahmestufe", field: "aufnahmestufe", visible: false},*/ +/* {title: "Aufnahmestufe", field: "aufnahmestufe", visible: false},*/ { title: 'Aktionen', field: 'actions', minWidth: 150, // Ensures Action-buttons will be always fully displayed @@ -178,8 +207,8 @@ export default{ button.addEventListener('click', () => this.actionEditStatus(data.status_kurzbz, data.studiensemester_kurzbz, data.ausbildungssemester) ); - /* if (this.dataMeldestichtag && this.dataMeldestichtag > data.datum && !this.hasPermissionToSkipStatusCheck) - button.disabled = true;*/ +/* if (this.dataMeldestichtag && this.dataMeldestichtag > data.datum && !this.hasPermissionToSkipStatusCheck) + button.disabled = true;*/ container.append(button); button = document.createElement('button'); @@ -211,11 +240,8 @@ export default{ selectable: false, index: 'statusId', persistenceID: 'stv-multistatus-2025112401' - }; - return options; - }, - tabulatorEvents() { - const events = [ + }, + tabulatorEvents: [ { event: 'tableBuilt', handler: async () => { @@ -224,8 +250,8 @@ export default{ let cm = this.$refs.table.tabulator.columnManager; cm.getColumnByField('lehrverband').component.updateDefinition({ - title: this.$p.t('lehre', 'lehrverband') - }); + title: this.$p.t('lehre', 'lehrverband') + }); cm.getColumnByField('bestaetigtam').component.updateDefinition({ title: this.$p.t('lehre', 'bestaetigt_am') @@ -272,39 +298,7 @@ export default{ }); } } - ]; - return events; - }, - prestudentIds() { - if (this.modelValue.prestudent_id) - { - return [this.modelValue.prestudent_id]; - } - return this.modelValue.map(e => e.prestudent_id); - }, - showToolbarStudent() { - if (Array.isArray(this.modelValue)) { - if (!this.modelValue.length) - return false; - return this.modelValue.every(item => item.uid); - } - return !!this.modelValue.uid; - }, - showToolbarInteressent() { - if (Array.isArray(this.modelValue)) { - if (!this.modelValue.length) - return false; - return !this.modelValue.some(item => item.uid); - } - return !this.modelValue.uid; - } - }, - props: { - modelValue: Object, - config: Object, - }, - data() { - return { + ], statusData: {}, statusId: {}, dataMeldestichtag: null,