diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index a5640d916..d2618274d 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -128,6 +128,21 @@ class Profil extends Auth_Controller } } + //? querying the telefon number of the office + if(isSuccess($this->MitarbeiterModel->addSelect(["mitarbeiter_uid"])) && + isSuccess($this->MitarbeiterModel->addJoin("tbl_kontakt", "tbl_mitarbeiter.standort_id = tbl_kontakt.standort_id")) + + + ){ + $this->MitarbeiterModel->addLimit(1); + $telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid"=>$this->uid, "kontakttyp"=>"telefon"]); + if(isError($telefon_res)){ + // error handling + }else{ + $telefon_res = hasData($telefon_res)? getData($telefon_res)[0] : null; + } + } + $res = new stdClass(); $res->username = $uid; @@ -163,6 +178,8 @@ class Profil extends Auth_Controller //? Mailverteiler Info $res->mailverteiler = $mailverteiler_res; + + $res->standort_telefon = $telefon_res; return $res; @@ -301,6 +318,9 @@ class Profil extends Auth_Controller } + + //$this->MitarbeiterModel->load($this->uid); + //? FH Ausweis Austellungsdatum soll auch nur der user selbst sehen $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid($this->uid,"Zutrittskarte"); if(isError($zutrittskarte_ausgegebenam)){ @@ -378,10 +398,28 @@ class Profil extends Auth_Controller } + //? querying the telefon number of the office + if(isSuccess($this->MitarbeiterModel->addSelect(["mitarbeiter_uid"])) && + isSuccess($this->MitarbeiterModel->addJoin("tbl_kontakt", "tbl_mitarbeiter.standort_id = tbl_kontakt.standort_id")) + + + ){ + $this->MitarbeiterModel->addLimit(1); + $telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid"=>$this->uid, "kontakttyp"=>"telefon"]); + if(isError($telefon_res)){ + // error handling + }else{ + $telefon_res = hasData($telefon_res)? getData($telefon_res)[0] : null; + } + } + + + - if(isSuccess($this->MitarbeiterModel->addSelect(["kurzbz","telefonklappe", "alias","ort_kurzbz"])) + if(isSuccess($this->MitarbeiterModel->addSelect(["kurzbz","tbl_mitarbeiter.telefonklappe", "alias","ort_kurzbz"])) && isSuccess($this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid")) + ){ $mitarbeiter_res = $this->MitarbeiterModel->load($this->uid); if(isError($mitarbeiter_res)){ @@ -426,6 +464,9 @@ class Profil extends Auth_Controller $res->emails = array($intern_email,$extern_email); $res->funktionen = $benutzer_funktion_res; + + //telefon nummer von dem Standort + $res->standort_telefon = $telefon_res; return $res; } diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index a64016556..6a858bb32 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -173,6 +173,14 @@ export default { } return "data:image/jpeg;base64," + this.data.foto; }, + + get_mitarbeiter_standort_telefon(){ + if(this.data.standort_telefon){ + return "tel:"+ this.data.telefonklappe + this.data.standort_telefon; + }else{ + return null; + } + }, //? this computed function returns all the informations for the first column in the profil personData() { if (!this.data) { @@ -207,7 +215,7 @@ export default { Geburtsdatum: this.data.gebdatum, Geburtsort: this.data.gebort, Kurzzeichen: this.data.kurzbz, - Telefon: this.data.telefonklappe, + Telefon: this.data.telefonklappe + (this.data.standort_telefon?this.data.standort_telefon:""), Büro: this.data.ort_kurzbz, }; }, @@ -253,6 +261,8 @@ export default { this.$refs.funktionenTable.tabulator.on("tableBuilt", () => { this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); }); + + }, template: ` @@ -423,8 +433,14 @@ export default {
-
- + + +
+ + {{wert?wert:''}} + + +
@@ -480,7 +496,7 @@ export default {
-
+
@@ -517,17 +533,26 @@ export default {
Private Kontakte
-
+
-
- +
+ +
-
- + + +
+ {{element.kontakt}}
+ +
+ {{element.kontakt}} + +
+
@@ -610,13 +635,7 @@ export default { - -
-
-

Sollten Ihre Daten nicht mehr aktuell sein, klicken Sie bitte hier

-
-
- +