merge master into bug-71363/FHC4_Stvw_Refactor_TabulatorOptions_As_Computed

This commit is contained in:
ma0068
2026-02-02 17:24:36 +01:00
8 changed files with 326 additions and 1082 deletions
@@ -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: {
@@ -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: {
@@ -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: {
@@ -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: '<i class="fa fa-check text-success"></i>',
crossElement: '<i class="fa fa-xmark text-danger"></i>'
}
},
{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 = '<i class="fa fa-edit"></i>';
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 = '<i class="fa fa-xmark"></i>';
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: '<i class="fa fa-check text-success"></i>',
crossElement: '<i class="fa fa-xmark text-danger"></i>'
}
},
{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 = '<i class="fa fa-edit"></i>';
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 = '<i class="fa fa-xmark"></i>';
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))
@@ -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: '<i class="fa fa-check text-success"></i>',
crossElement: '<i class="fa fa-xmark text-danger"></i>'
}
},
{
title:"Zustelladresse",
field:"zustelladresse",
formatter:"tickCross",
hozAlign:"center",
formatterParams: {
tickElement: '<i class="fa fa-check text-success"></i>',
crossElement: '<i class="fa fa-xmark text-danger"></i>'
}
},
{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 = '<i class="fa fa-edit"></i>';
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 = '<i class="fa fa-xmark"></i>';
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: `
<div class="stv-details-kontakt-address h-100 pt-3">
<!--Modal: AddressModal-->
<bs-modal ref="adressModal" dialog-class="modal-dialog-scrollable">
<template #title>
<p v-if="statusNew" class="fw-bold mt-3">{{$p.t('person', 'adresse_new')}}</p>
<p v-else class="fw-bold mt-3">{{$p.t('person', 'adresse_edit')}}</p>
</template>
<form-form class="row g-3 mt-2" ref="addressData">
<div class="row mb-3">
<form-input
type="select"
name="adressentyp"
:label="$p.t('global/typ')"
v-model="addressData.typ"
>
<option
v-for="typ in adressentypen"
:key="typ.adressentyp_kurzbz"
:value="typ.adressentyp_kurzbz"
>
{{typ.bezeichnung}}
</option>
</form-input>
</div>
<div class="row mb-3">
<form-input
type="text"
name="strasse"
:label="$p.t('person/strasse')"
v-model="addressData.strasse"
>
</form-input>
</div>
<div class="row mb-3">
<form-input
type="select"
name="nation"
:label="$p.t('person/nation')"
v-model="addressData.nation"
>
<option
v-for="nation in nations"
:key="nation.nation_code"
:value="nation.nation_code"
:disabled="nation.sperre"
>
{{nation.kurztext}}
</option>
</form-input>
</div>
<div class="row mb-3">
<form-input
type="text"
name="address[plz]"
:label="$p.t('person/plz') + ' *'"
v-model="addressData.address.plz"
required
@input="loadPlaces"
>
</form-input>
</div>
<div class="row mb-3">
<form-input
v-if="addressData.nation == 'A'"
type="select"
name="gemeinde"
:label="$p.t('person/gemeinde')"
v-model="addressData.gemeinde"
>
<option v-if="!gemeinden.length" disabled>{{$p.t('ui', 'bittePlzWaehlen')}}</option>
<option
v-for="gemeinde in gemeinden"
:key="gemeinde.name"
:value="gemeinde.name"
>
{{gemeinde.name}}
</option>
</form-input>
<form-input
v-else
type="text"
:label="$p.t('person/gemeinde')"
name="addressData.gemeinde"
v-model="addressData.gemeinde"
>
</form-input>
</div>
<div class="row mb-3">
<form-input
v-if="addressData.nation == 'A'"
type="select"
name="ort"
:label="$p.t('person/ort')"
v-model="addressData.ort"
>
<option v-if="!orte.length" disabled>{{$p.t('ui', 'bitteGemeindeWaehlen')}}</option>
<option
v-for="ort in orte"
:key="ort.ortschaftsname"
:value="ort.ortschaftsname"
>
{{ort.ortschaftsname}}
</option>
</form-input>
<form-input
v-else
type="text"
:label="$p.t('person/ort')"
name="ort"
v-model="addressData.ort"
>
</form-input>
</div>
<div class="row mb-3">
<div class="col-sm-4">
<form-input
container-class="form-check"
type="checkbox"
name="heimatadresse"
:label="$p.t('person/heimatadresse')"
v-model="addressData.heimatadresse"
>
</form-input>
</div>
</div>
<div class="row mb-3">
<div class="col-sm-4">
<form-input
container-class="form-check"
type="checkbox"
name="zustelladresse"
:label="$p.t('person/zustelladresse')"
v-model="addressData.zustelladresse"
>
</form-input>
</div>
</div>
<div class="row mb-3">
<form-input
type="text"
name="co_name"
:label="$p.t('person/co_name')"
v-model="addressData.co_name"
>
</form-input>
</div>
<div class="row mb-3">
<div class="col-sm-4">
<form-input
container-class="form-check"
type="checkbox"
name="rechnungsadresse"
:label="$p.t('person/rechnungsadresse')"
v-model="addressData.rechnungsadresse"
>
</form-input>
</div>
</div>
<div class="row mb-3">
<form-input
type="autocomplete"
:label="$p.t('person/firma')"
name="firma_name"
v-model="selectedFirma"
optionLabel="label"
optionValue="firma_id"
dropdown
forceSelection
:suggestions="filteredFirmen"
@complete="filterFirmen"
:min-length="3"
>
</form-input>
</div>
<div class="row mb-3">
<input type="hidden" class="form-control" id="firma_id" v-model="addressData.firma_id">
</div>
<div class="row mb-3">
<form-input
type="text"
name="firma_zusatz"
:label="$p.t('global/name')"
v-model="addressData.name"
>
</form-input>
</div>
<div class="row mb-3">
<form-input
type="text"
name="anmerkung"
:label="$p.t('global/anmerkung')"
v-model="addressData.anmerkung"
>
</form-input>
</div>
</form-form>
<template #footer>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal" @click="reload()">{{$p.t('ui', 'abbrechen')}}</button>
<button v-if="statusNew" type="button" class="btn btn-primary" @click="addNewAddress()">OK</button>
<button v-else type="button" class="btn btn-primary" @click="updateAddress(addressData.adresse_id)">OK</button>
</template>
</bs-modal>
<core-filter-cmpt
ref="table"
:tabulator-options="tabulatorOptions"
:tabulator-events="tabulatorEvents"
table-only
:side-menu="false"
reload
:reload-btn-infotext="this.$p.t('table', 'reload')"
new-btn-show
:new-btn-label="this.$p.t('person', 'adresse')"
@click:new="actionNewAdress"
>
</core-filter-cmpt>
</div>`
};
@@ -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){
@@ -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() {
@@ -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,