diff --git a/application/controllers/api/frontend/v1/Profil.php b/application/controllers/api/frontend/v1/Profil.php index 36bc5b68c..c52d8bae5 100644 --- a/application/controllers/api/frontend/v1/Profil.php +++ b/application/controllers/api/frontend/v1/Profil.php @@ -567,7 +567,7 @@ class Profil extends FHCAPI_Controller */ private function getStudentInfo($uid) { - $this->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang', 'tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe', 'tbl_student.matrikelnr as personenkennzeichen']); + $this->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang', 'tbl_studiengang.studiengang_kz as studiengang_kz', 'tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe', 'tbl_student.matrikelnr as personenkennzeichen']); $this->StudentModel->addJoin('tbl_studiengang', "tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz"); $student_res = $this->StudentModel->load([$uid]); diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index ccdc68a9b..acae0cc5a 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -198,6 +198,15 @@ export default { editable() { return this.data?.editAllowed ?? false; }, + getTelefonValue() { + if(this.data.standort_telefon?.kontakt) { + return this.data.standort_telefon.kontakt + " " + this.data.telefonklappe + } else if(this.data.standort_telefon) { + return this.data.standort_telefon + " " + this.data.telefonklappe + } else { + return this.data.telefonklappe + } + }, filteredEditData() { return this.editDataFilter ? this.editData.data[this.editDataFilter] @@ -226,13 +235,36 @@ export default { } return { - [`${this.$p.t('profil', 'Geburtsdatum')}`]: this.data.gebdatum, - [`${this.$p.t('profil', 'Geburtsort')}`]: this.data.gebort, - [`${this.$p.t('profil', 'Kurzzeichen')}`]: this.data.kurzbz, - [`${this.$p.t('profil', 'Telefon')}`]: - (this.data.standort_telefon ? this.data.standort_telefon.kontakt + " " + this.data.telefonklappe : this.data.telefonklappe), - [`${this.$p.t('profil', 'Büro')}`]: this.data.ort_kurzbz, + geburtsdatum: { + label: `${this.$p.t('profil','Geburtsdatum')}`, + value: this.data.gebdatum + }, + geburtsort: { + label: `${this.$p.t('profil','Geburtsort')}`, + value: this.data.gebort + }, + personenkennzeichen: { + label: `${this.$p.t('profil','Kurzzeichen')}`, + value: this.data.kurzbz + }, + telefon: { + label: `${this.$p.t('profil','Telefon')}`, + value: this.getTelefonValue + }, + office: { + label: `${this.$p.t('profil','Büro')}`, + value: this.data.ort_kurzbz + } }; + + // return { + // [`${this.$p.t('profil', 'Geburtsdatum')}`]: this.data.gebdatum, + // [`${this.$p.t('profil', 'Geburtsort')}`]: this.data.gebort, + // [`${this.$p.t('profil', 'Kurzzeichen')}`]: this.data.kurzbz, + // [`${this.$p.t('profil', 'Telefon')}`]: + // (this.data.standort_telefon ? this.data.standort_telefon.kontakt + " " + this.data.telefonklappe : this.data.telefonklappe), + // [`${this.$p.t('profil', 'Büro')}`]: this.data.ort_kurzbz, + // }; }, }, diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index b062b7708..07cb83402 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -93,6 +93,15 @@ export default { }, computed: { + getTelefonValue() { + if(this.data.standort_telefon?.kontakt) { + return this.data.standort_telefon.kontakt + " " + this.data.telefonklappe + } else if(this.data.standort_telefon) { + return this.data.standort_telefon + " " + this.data.telefonklappe + } else { + return this.data.telefonklappe + } + }, editable() { return this.data?.editAllowed ?? false; }, @@ -122,15 +131,37 @@ export default { if (!this.data) { return {}; } - return { - [`${this.$p.t('profil', 'Geburtsdatum')}`]: this.data.gebdatum, - [`${this.$p.t('profil', 'Geburtsort')}`]: this.data.gebort, - [`${this.$p.t('profil', 'Kurzzeichen')}`]: this.data.kurzbz, - [`${this.$p.t('profil', 'Telefon')}`]: - (this.data.standort_telefon ? this.data.standort_telefon + " " + this.data.telefonklappe : this.data.telefonklappe), - [`${this.$p.t('profil', 'Büro')}`]: this.data.ort_kurzbz, + geburtsdatum: { + label: `${this.$p.t('profil','Geburtsdatum')}`, + value: this.data.gebdatum + }, + geburtsort: { + label: `${this.$p.t('profil','Geburtsort')}`, + value: this.data.gebort + }, + personenkennzeichen: { + label: `${this.$p.t('profil','Kurzzeichen')}`, + value: this.data.kurzbz + }, + telefon: { + label: `${this.$p.t('profil','Telefon')}`, + value: this.getTelefonValue + }, + office: { + label: `${this.$p.t('profil','Büro')}`, + value: this.data.ort_kurzbz + } }; + + // return { + // [`${this.$p.t('profil', 'Geburtsdatum')}`]: this.data.gebdatum, + // [`${this.$p.t('profil', 'Geburtsort')}`]: this.data.gebort, + // [`${this.$p.t('profil', 'Kurzzeichen')}`]: this.data.kurzbz, + // [`${this.$p.t('profil', 'Telefon')}`]: + // (this.data.standort_telefon ? this.data.standort_telefon + " " + this.data.telefonklappe : this.data.telefonklappe), + // [`${this.$p.t('profil', 'Büro')}`]: this.data.ort_kurzbz, + // }; }, }, diff --git a/public/js/components/Cis/Profil/ProfilComponents/RoleInformation.js b/public/js/components/Cis/Profil/ProfilComponents/RoleInformation.js index 9fb0b4976..e49fa624a 100644 --- a/public/js/components/Cis/Profil/ProfilComponents/RoleInformation.js +++ b/public/js/components/Cis/Profil/ProfilComponents/RoleInformation.js @@ -10,7 +10,25 @@ export default { type: String, } }, - computed: {}, + inject: [ + 'studiengang_kz', // inject info that should not be displayed + ], + computed: { + getLinkGruppeListe() { + return this.data.gruppe?.value && this.data.verband?.value && this.data.semester?.value ? FHC_JS_DATA_STORAGE_OBJECT.app_root + + 'cis/private/stud_in_grp.php?kz='+this.studiengang_kz+'&sem=' + this.data.semester.value + + '&verband=' + this.data.verband.value + '&grp=' + this.data.gruppe.value : '' + }, + getLinkVerbandListe() { + return this.data.verband?.value && this.data.semester?.value ? FHC_JS_DATA_STORAGE_OBJECT.app_root + + 'cis/private/stud_in_grp.php?kz='+this.studiengang_kz+'&sem=' + this.data.semester.value + + '&verband=' + this.data.verband.value : '' + }, + getLinkSemesterListe() { + return this.data.semester?.value ? FHC_JS_DATA_STORAGE_OBJECT.app_root + + 'cis/private/stud_in_grp.php?kz='+this.studiengang_kz+'&sem=' + this.data.semester.value : '' + } + }, created() { //TODO: check if data.Telefon is a valid telefon number to call before using it as a tel: link }, @@ -19,16 +37,40 @@ export default {