diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php index a9c49fa3f..adf9f729e 100644 --- a/application/controllers/api/frontend/v1/stv/Config.php +++ b/application/controllers/api/frontend/v1/stv/Config.php @@ -210,7 +210,7 @@ class Config extends FHCAPI_Controller ] ]; $result['finalexam'] = [ - 'title' => $this->p->t('stv', 'tab_finalexam'), + 'title' => $this->p->t('stv', 'tab_finalexam'), 'component' => './Stv/Studentenverwaltung/Details/Abschlusspruefung.js', 'config' => $config['finalexam'] ]; diff --git a/application/controllers/api/frontend/v1/stv/Students.php b/application/controllers/api/frontend/v1/stv/Students.php index 5fb7b592c..b2044a6d5 100644 --- a/application/controllers/api/frontend/v1/stv/Students.php +++ b/application/controllers/api/frontend/v1/stv/Students.php @@ -622,6 +622,8 @@ class Students extends FHCAPI_Controller $this->PrestudentModel->addSelect('ersatzkennzeichen'); $this->PrestudentModel->addSelect('gebdatum'); $this->PrestudentModel->addSelect('geschlecht'); + $this->PrestudentModel->addSelect('foto'); + $this->PrestudentModel->addSelect('foto_sperre'); // semester // verband @@ -629,6 +631,7 @@ class Students extends FHCAPI_Controller $this->PrestudentModel->addSelect('UPPER(stg.typ || stg.kurzbz) AS studiengang'); $this->PrestudentModel->addSelect('tbl_prestudent.studiengang_kz'); + $this->PrestudentModel->addSelect('stg.bezeichnung AS stg_bezeichnung'); $this->PrestudentModel->addSelect("s.matrikelnr"); $this->PrestudentModel->addSelect('p.person_id'); $this->PrestudentModel->addSelect('pls.status_kurzbz AS status'); @@ -640,7 +643,7 @@ class Students extends FHCAPI_Controller ); $this->PrestudentModel->addSelect(" CASE WHEN b.uid IS NOT NULL AND b.uid<>'' - THEN b.uid || " . $this->PrestudentModel->escape(DOMAIN) . " + THEN CONCAT(b.uid, '@', " . $this->PrestudentModel->escape(DOMAIN) . ") ELSE '' END AS mail_intern", false); $this->PrestudentModel->addSelect('p.anmerkung AS anmerkungen'); $this->PrestudentModel->addSelect('tbl_prestudent.anmerkung'); diff --git a/public/js/api/factory/detailHeader.js b/public/js/api/factory/detailHeader.js new file mode 100644 index 000000000..f9f368bc7 --- /dev/null +++ b/public/js/api/factory/detailHeader.js @@ -0,0 +1,37 @@ +/** + * Copyright (C) 2025 fhcomplete.org + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +export default { + getHeader(person_id){ + return { + method: 'get', + url: 'api/frontend/v1/vertraege/vertraege/getHeader/' + person_id, + }; + }, + getPersonAbteilung(person_id){ + return { + method: 'get', + url: 'api/frontend/v1/vertraege/vertraege/getPersonAbteilung/' + person_id, + }; + }, + getLeitungOrg(oekurzbz){ + return { + method: 'get', + url: 'api/frontend/v1/vertraege/vertraege/getLeitungOrg/' + oekurzbz, + }; + }, +} \ No newline at end of file diff --git a/public/js/components/DetailHeader/DetailHeader.js b/public/js/components/DetailHeader/DetailHeader.js new file mode 100644 index 000000000..0b50c5153 --- /dev/null +++ b/public/js/components/DetailHeader/DetailHeader.js @@ -0,0 +1,210 @@ +import ApiDetailHeader from "../../api/factory/detailHeader.js"; + +export default { + name: 'DetailHeader', + inject: { + domain: { + from: 'configDomain', + default: 'technikum-wien.at' + }, + }, + props: { + headerData: { + type: Object, + required: false + }, + person_id: { + type: Number, + required: false + }, + typeHeader: { + type: String, + default: 'student', + validator(value) { + return [ + 'student', + 'mitarbeiter', + ].includes(value) + } + } + }, + computed: { + appRoot() { + return FHC_JS_DATA_STORAGE_OBJECT.app_root; + }, + validatedHeaderData() { + if (this.typeHeader === 'student') return this.headerData; + if (this.typeHeader === 'mitarbeiter') return this.person_id; + return null; + } + }, + created(){ + if(this.person_id) { + this.getHeader(this.person_id); + + this.loadDepartmentData(this.person_id) + .then(() => { + // Call getLeitungOrg only after departmentData is loaded + this.getLeitungOrg(this.departmentData.oe_kurzbz); + }) + .catch((error) => { + console.error("Error loading department data:", error); + }); + } + }, + watch: { + person_id: { + handler(newVal) { + if (newVal) { + this.getHeader(this.person_id); + this.loadDepartmentData(this.person_id). + then(() => { + this.getLeitungOrg(this.departmentData.oe_kurzbz); + }); + } + }, + deep: true, + }, + }, + data(){ + return{ + headerDataMa: {}, + departmentData: {}, + leitungData: {}, + }; + }, + methods: { + getHeader(person_id) { + return this.$api + .call(ApiDetailHeader.getHeader(person_id)) + .then(result => { + this.headerDataMa = result.data; + + }) + .catch(this.$fhcAlert.handleSystemError); + }, + loadDepartmentData(person_id) { + return this.$api + .call(ApiDetailHeader.getPersonAbteilung(person_id)) + .then(result => { + this.departmentData = result.data; + }) + .catch(this.$fhcAlert.handleSystemError); + }, + getLeitungOrg(oekurzbz){ + return this.$api + .call(ApiDetailHeader.getLeitungOrg(oekurzbz)) + .then(result => { + this.leitungData = result.data; + }) + .catch(this.$fhcAlert.handleSystemError); + }, + redirectToLeitung(){ + this.$emit('redirectToLeitung', { + person_id: this.leitungData.person_id}); + } + }, + template: ` +
+ + + +
+ ` +} diff --git a/public/js/components/Stv/Studentenverwaltung/Details.js b/public/js/components/Stv/Studentenverwaltung/Details.js index dd046de63..8d6a9a7a1 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details.js +++ b/public/js/components/Stv/Studentenverwaltung/Details.js @@ -1,4 +1,5 @@ import FhcTabs from "../../Tabs.js"; +import FhcHeader from "../../DetailHeader/DetailHeader.js"; import ApiStvApp from '../../../api/factory/stv/app.js'; @@ -8,7 +9,8 @@ import ApiStvApp from '../../../api/factory/stv/app.js'; export default { name: "DetailsPrestudent", components: { - FhcTabs + FhcTabs, + FhcHeader }, data() { return { @@ -61,17 +63,26 @@ export default { Bitte StudentIn auswählen!
-
- profilbild -
-

{{students[0].titlepre}} {{students[0].vorname}} {{students[0].nachname}} {{students[0].titlepost}}

-
-
- + + + +
Loading...
` -}; \ No newline at end of file +};