diff --git a/public/js/components/Betriebsmittel/Betriebsmittel.js b/public/js/components/Betriebsmittel/Betriebsmittel.js index 148d7a83c..2c88448d3 100644 --- a/public/js/components/Betriebsmittel/Betriebsmittel.js +++ b/public/js/components/Betriebsmittel/Betriebsmittel.js @@ -43,7 +43,22 @@ export default { }, data() { return { - tabulatorOptions: { + listBetriebsmitteltyp: [], + formData: { + ausgegebenam : new Date(), + betriebsmitteltyp: 'Zutrittskarte' + }, + statusNew: true, + filteredInventar: [], + layout: 'fitColumns', + layoutColumnsOnNewData: false, + height: '550', + persistenceID: 'core-betriebsmittel' + } + }, + computed: { + tabulatorOptions() { + const options = { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call( this.endpoint.getAllBetriebsmittel(this.typeId, this.id, (this.filterByProvidedTypes ? this.betriebsmittelTypes : null)) @@ -115,7 +130,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'); @@ -143,13 +158,13 @@ export default { return container; }, frozen: true - }], - layout: 'fitColumns', - layoutColumnsOnNewData: false, - height: '550', - persistenceID: 'core-betriebsmittel' - }, - tabulatorEvents: [ + } + ], + }; + return options; + }, + tabulatorEvents() { + const events = [ { event: 'tableBuilt', handler: async() => { @@ -193,14 +208,8 @@ export default { }); } } - ], - listBetriebsmitteltyp: [], - formData: { - ausgegebenam : new Date(), - betriebsmitteltyp: 'Zutrittskarte' - }, - statusNew: true, - filteredInventar: [] + ]; + return events; } }, watch: { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js b/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js index d46e1f299..da938b063 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Abschlusspruefung/Abschlusspruefung.js @@ -34,40 +34,58 @@ 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 { - tabulatorOptions: { + 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 = { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call(ApiStvAbschlusspruefung.getAbschlusspruefung(this.student.uid)), ajaxResponse: (url, params, response) => response.data, @@ -163,14 +181,11 @@ export default { frozen: true }, ], - layout: 'fitDataStretchFrozen', - layoutColumnsOnNewData: false, - height: 'auto', - minHeight: '200', - index: 'abschlusspruefung_id', - persistenceID: 'stv-details-finalexam-2025112401' - }, - tabulatorEvents: [ + }; + return options; + }, + tabulatorEvents() { + const events = [ { event: 'dataLoaded', handler: data => this.tabulatorData = data.map(item => { @@ -225,50 +240,36 @@ 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') - }); - */ } } - ], - 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 - }, + ]; + 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; } }, watch: { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js b/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js index a2029b0b9..32224062d 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Anrechnungen/Anrechnungen.js @@ -31,7 +31,24 @@ export default { }, data() { return { - tabulatorOptions: { + 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 = { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call( ApiStvExemptions.getAnrechnungen(this.student.prestudent_id) @@ -107,12 +124,11 @@ export default { frozen: true }, ], - layout: 'fitDataStretchFrozen', - height: '500', - index: 'anrechnung_id', - persistenceID: 'stv-details-anrechnungen-2025112401' - }, - tabulatorEvents: [ + }; + return options; + }, + tabulatorEvents() { + const events = [ { event: 'tableBuilt', handler: async () => { @@ -154,16 +170,8 @@ export default { } } - ], - formData: {}, - listBegruendungen: [], - listNewLehrveranstaltungen: [], - listLektoren: [], - listKompatibleLehrveranstaltungen: [], - statusNew: true, - showNotizen: false, - currentAnrechnung_id: null, - endpoint: ApiNotizPerson + ]; + return events; } }, watch: { diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js b/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js index d03569df4..b2ba26a55 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Aufnahmetermine/Aufnahmetermine.js @@ -36,158 +36,19 @@ 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: [] + filteredPlacementTests: [], + //data after tabulator data + layout: 'fitDataStretchFrozen', + layoutColumnsOnNewData: false, + height: 'auto', + minHeight: 200, + index: 'aufnahmetermin_id', + persistenceID: 'stv-details-table_admission-dates-2025112401' } }, methods: { @@ -332,6 +193,155 @@ 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 7bb8080e1..e4174e378 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Address.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/Address.js @@ -23,7 +23,36 @@ export default{ }, data() { return { - tabulatorOptions: { + 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 = { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call(ApiStvAddress.get(this.uid)), ajaxResponse: (url, params, response) => response.data, @@ -122,11 +151,11 @@ export default{ frozen: true }, ], - height: 'auto', - index: 'adresse_id', - persistenceID: 'stv-details-kontakt-address' - }, - tabulatorEvents: [ + }; + return options; + }, + tabulatorEvents() { + const events = [ { event: 'tableBuilt', handler: async () => { @@ -184,37 +213,11 @@ 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') - });*/ } } - ], - 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:{ + ]; + return events; + }, 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 new file mode 100644 index 000000000..7ed448cfd --- /dev/null +++ b/public/js/components/Stv/Studentenverwaltung/Details/Kontakt/AddressOld.js @@ -0,0 +1,622 @@ +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 1ff34dc79..f7fad0dfb 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,8 +20,42 @@ export default{ uid: Number }, data() { - return{ - tabulatorOptions: { + 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 = { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call(ApiStvContact.get(this.uid)), ajaxResponse: (url, params, response) => response.data, @@ -94,11 +128,11 @@ export default{ frozen: true }, ], - height: 'auto', - index: 'kontakt_id', - persistenceID: 'stv-details-kontakt-contact' - }, - tabulatorEvents: [ + }; + return options; + }, + tabulatorEvents() { + const events = [ { event: 'tableBuilt', handler: async() => { @@ -139,27 +173,11 @@ export default{ cm.getColumnByField('standort_id').component.updateDefinition({ title: this.$p.t('ui', 'standort_id') }); -/* 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 - }, - } + } + } + ]; + return events; + }, }, 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 20cb95fbd..cd5f8f1f3 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine/ListLehrveranstaltungstermine.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine/ListLehrveranstaltungstermine.js @@ -11,22 +11,6 @@ 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', @@ -44,6 +28,114 @@ 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 = { @@ -80,7 +172,7 @@ export default { {title: "farbe", field: "farbe", visible: false}, {title: "Gruppen", field: "gruppen_kuerzel"}, {title: "ort", field: "ort_kurzbz"}, - {title: "lektorIn", field: "lektorname"}, + {title: "lektorIn", field: "lektorname", sorter:"string"}, {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 44b318f5b..1fe96188f 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/History.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/History.js @@ -12,7 +12,16 @@ export default{ }, data() { return { - tabulatorOptions: { + layout: 'fitDataFill', + layoutColumnsOnNewData: false, + height: 'auto', + selectable: false, + persistenceID: 'stv-details-prestudent-history', + } + }, + computed: { + tabulatorOptions() { + const options = { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call(ApiStvPrestudent.getHistoryPrestudents(this.personId)), ajaxResponse: (url, params, response) => response.data, @@ -37,13 +46,11 @@ export default{ element.classList.add('fw-bold'); } }, - layout: 'fitDataFill', - layoutColumnsOnNewData: false, - height: 'auto', - selectable: false, - persistenceID: 'stv-details-prestudent-history' - }, - tabulatorEvents: [ + }; + return options; + }, + tabulatorEvents() { + const events = [ { event: 'tableBuilt', handler: async () => { @@ -64,8 +71,9 @@ 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 e67f19ccf..8f381c330 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js @@ -26,37 +26,8 @@ export default{ } }, computed: { - 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: { + tabulatorOptions() { + const options = { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call(ApiStvPrestudent.getHistoryPrestudent(this.modelValue.prestudent_id)), ajaxResponse: (url, params, response) => response.data, @@ -164,7 +135,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 @@ -207,8 +178,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'); @@ -240,8 +211,11 @@ export default{ selectable: false, index: 'statusId', persistenceID: 'stv-multistatus-2025112401' - }, - tabulatorEvents: [ + }; + return options; + }, + tabulatorEvents() { + const events = [ { event: 'tableBuilt', handler: async () => { @@ -250,8 +224,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') @@ -298,7 +272,39 @@ 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,