diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index 8a731e085..27da9a07b 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -148,11 +148,17 @@ class Profil extends Auth_Controller $person_res = hasData($person_res)? getData($person_res)[0] : null; } } - $mitarbeiter_res = $this->MitarbeiterModel->load($uid); - if(isError($mitarbeiter_res)){ - // error handling - }else{ - $mitarbeiter_res = hasData($mitarbeiter_res)? getData($mitarbeiter_res)[0] : null; + + + if(isSuccess($this->MitarbeiterModel->addSelect(["kurzbz","telefonklappe", "alias","ort_kurzbz"])) + && isSuccess($this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid"))) + { + $mitarbeiter_res = $this->MitarbeiterModel->load($uid); + if(isError($mitarbeiter_res)){ + // error handling + }else{ + $mitarbeiter_res = hasData($mitarbeiter_res)? getData($mitarbeiter_res)[0] : null; + } } @@ -171,11 +177,11 @@ class Profil extends Auth_Controller $res->nachname = $person_res->nachname; - $res->gebdatum = $person_res->gebdatum; - $res->gebort = $person_res->gebort; //? Mitarbeiter Info - $res->kurzbz = $mitarbeiter_res->kurzbz; - $res->telefonklappe = $mitarbeiter_res->telefonklappe; + foreach($mitarbeiter_res as $key => $val){ + $res->$key = $val; + + } //? Email Info $intern_email = array(); $intern_email+=array("type" => "intern"); @@ -184,20 +190,14 @@ class Profil extends Auth_Controller $extern_email+=array("type" => "alias"); $extern_email+=array("email" => $benutzer_res->alias . "@" . DOMAIN); $res->emails = array($intern_email,$extern_email); - //? Adresse Info - $res->adressen = $adresse_res; + //? Benutzerfunktion Info $res->funktionen = $benutzer_funktion_res; - //? Betriebsmittel Info - $res->mittel = $betriebsmittelperson_res; - //? Austellungsdatum von der Zutrittskarte - $res->zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam; - //? Kontakt Info - $res->kontakte = $kontakte_res; + //? Mailverteiler Info $res->mailverteiler = $mailverteiler_res; - echo json_encode($res); + return $res; } @@ -276,7 +276,11 @@ class Profil extends Auth_Controller $res->postnomen = $person_res->titelpost; - $res->internal_email= $uid . "@" . DOMAIN; + $intern_email = array(); + $intern_email+=array("type" => "intern"); + $intern_email+=array("email"=> getAuthUID() . "@" . DOMAIN); + + $res->emails = array($intern_email); @@ -296,8 +300,7 @@ class Profil extends Auth_Controller } private function mitarbeiterProfil(){ - //? informationen die nur für den Mitarbeiter verfügbar sind - //? Data for the Mitarbeiter view + //? betriebsmittel soll nur der user selber sehen if( @@ -457,12 +460,9 @@ class Profil extends Auth_Controller $res->funktionen = $benutzer_funktion_res; return $res; - } + } - - - private function studentProfil(){ @@ -619,7 +619,12 @@ class Profil extends Auth_Controller $res->postnomen = $person_res->titelpost; - $res->internal_email= getAuthUID() . "@" . DOMAIN; + + $intern_email = array(); + $intern_email+=array("type" => "intern"); + $intern_email+=array("email"=> getAuthUID() . "@" . DOMAIN); + + $res->emails = array($intern_email); $res->adressen = $adresse_res; $res->zutrittsdatum = $zutrittskarte_ausgegebenam; $res->kontakte = $kontakte_res; @@ -662,18 +667,8 @@ class Profil extends Auth_Controller $isMitarbeiter = hasData($isMitarbeiter) ? getData($isMitarbeiter) : null; $res = new stdClass(); - - if($uid){ - // if an $uid was passed as payload to the function then the user is trying to view another profile - if($isMitarbeiter ){ - $res->view= "ViewMitarbeiterProfil"; - $res->data= $this->viewMitarbeiterProfil($uid); - } - else { - $res->view= "ViewStudentProfil"; - $res->data= $this->viewStudentProfil($uid); - } - }else{ + + if($uid == getAuthUID() || !$uid ){ // if the $uid is empty, then no payload was supplied and the own profile is being requested if($isMitarbeiter ) { $res->view= "MitarbeiterProfil"; @@ -684,10 +679,21 @@ class Profil extends Auth_Controller $res->data = $this->studentProfil(); } } + elseif($uid){ + // if an $uid was passed as payload to the function then the user is trying to view another profile + if($isMitarbeiter ){ + $res->view= "ViewMitarbeiterProfil"; + $res->data= $this->viewMitarbeiterProfil($uid); + } + else { + $res->view= "ViewStudentProfil"; + $res->data= $this->viewStudentProfil($uid); + } + } echo json_encode($res); - return; + diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index 93f951272..af86d2ea2 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -20,6 +20,7 @@ const app = Vue.createApp({ data() { return { view:null, + data:null, } }, @@ -38,16 +39,16 @@ const app = Vue.createApp({ }; Vue.$fhcapi.UserData.getView(payload).then((res)=>{ - //this.view = res.data.view; - //this.data = res.data.data; + this.view = res.data.view; + this.data = res.data.data; console.log(res.data); }); }, template:`
test element
- -FH-Ausweis Status
+{{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
+{{email.type}}: {{email.email}}
+Private Kontakte
+Sie sind Mitgglied in folgenden Verteilern:
+MitarbeiterProfil
`, -}; \ No newline at end of file +}; diff --git a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js index b259aa074..ad0afd863 100644 --- a/public/js/components/Cis/Profil/MitarbeiterViewProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterViewProfil.js @@ -1,6 +1,5 @@ - import fhcapifactory from "../../../apps/api/fhcapifactory.js"; -import {CoreFilterCmpt} from "../../../components/filter/Filter.js" +import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; //? possible types of roles: //! depending on the role of the current view, different content is being displayed and fetched @@ -10,209 +9,273 @@ import {CoreFilterCmpt} from "../../../components/filter/Filter.js" //* View_Mitarbeiter export default { - components:{ - CoreFilterCmpt, - }, - data() { - return { - index_information: null, - mitarbeiter_info: null, - student_info:null, - //? beinhaltet die Information ob der angefragte user ein Student oder Mitarbeiter ist - role: null, + components: { + CoreFilterCmpt, + }, + data() { + return { + index_information: null, + mitarbeiter_info: null, + student_info: null, + //? beinhaltet die Information ob der angefragte user ein Student oder Mitarbeiter ist + role: null, - funktionen_table_options: { - height: 300, - layout: 'fitColumns', - data:[{Bezeichnung:"",Organisationseinheit:"",Gültig_von:"",Gültig_bis:"",Wochenstunden:""}], - columns: [{title: 'Bezeichnung', field: 'Bezeichnung', headerFilter: true}, - {title: 'Organisationseinheit', field: 'Organisationseinheit', headerFilter: true}, - {title: 'Gültig_von', field: 'Gültig_von', headerFilter: true}, - {title: 'Gültig_bis', field: 'Gültig_bis', headerFilter: true}, - {title: 'Wochenstunden', field: 'Wochenstunden', headerFilter: true},] - - }, - betriebsmittel_table_options:{ - height: 300, - layout: 'fitColumns', - data:[{betriebsmittel:"",Nummer:"",Ausgegeben_am:""}], - columns: [{title: 'Betriebsmittel', field: 'betriebsmittel', headerFilter: true}, - {title: 'Nummer', field: 'Nummer', headerFilter: true}, - {title: 'Ausgegeben_am', field: 'Ausgegeben_am', headerFilter: true},] - - }, - zutrittsgruppen_table_options:{ - height: 300, - layout: 'fitColumns', - data:[{bezeichnung:"test1"}], - columns: [{title: 'Zutritt', field: 'bezeichnung'}] - } - } + funktionen_table_options: { + height: 300, + layout: "fitColumns", + data: [ + { + Bezeichnung: "", + Organisationseinheit: "", + Gültig_von: "", + Gültig_bis: "", + Wochenstunden: "", + }, + ], + columns: [ + { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true }, + { + title: "Organisationseinheit", + field: "Organisationseinheit", + headerFilter: true, + }, + { title: "Gültig_von", field: "Gültig_von", headerFilter: true }, + { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true }, + { + title: "Wochenstunden", + field: "Wochenstunden", + headerFilter: true, + }, + ], + }, + betriebsmittel_table_options: { + height: 300, + layout: "fitColumns", + data: [{ betriebsmittel: "", Nummer: "", Ausgegeben_am: "" }], + columns: [ + { + title: "Betriebsmittel", + field: "betriebsmittel", + headerFilter: true, + }, + { title: "Nummer", field: "Nummer", headerFilter: true }, + { + title: "Ausgegeben_am", + field: "Ausgegeben_am", + headerFilter: true, + }, + ], + }, + zutrittsgruppen_table_options: { + height: 300, + layout: "fitColumns", + data: [{ bezeichnung: "test1" }], + columns: [{ title: "Zutritt", field: "bezeichnung" }], + }, + }; + }, + + //? this props were passed in the Profil.php view file + props: ["data"], + methods: { + concatenate_addresses(address_array) { + let result = ""; + for (let i = 0; i < address_array.length; i++) { + result += + address_array[i].strasse + + " " + + address_array[i].plz + + " " + + address_array[i].ort + + "\n"; + } + return result; }, - - //? this props were passed in the Profil.php view file - props:['uid','view'], - methods: { + render_unterelement(wert, bezeichnung) { + if (isArray(bezeichnung)) { + } + }, + concatenate_kontakte(kontakt_array) { + let result = ""; + for (let i = 0; i < kontakt_array.length; i++) { + result += + kontakt_array[i].kontakttyp + + " " + + kontakt_array[i].kontakt + + " " + + kontakt_array[i].zustellung + + "\n"; + } + return result; + }, + sperre_foto_function(value) { + if (!this.data) { + return; + } + fhcapifactory.UserData.sperre_foto_function(value).then((res) => { + this.data.foto_sperre = res.data.foto_sperre; + }); + }, + }, + computed: { + get_image_base64_src() { + if (!this.data) { + return ""; + } + return "data:image/jpeg;base64," + this.data.foto; + }, + personData() { + if (!this.data) { + return {}; + } + + return { + Allgemein: { + Username: this.data.username, + Anrede: this.data.anrede, + Titel: this.data.titel, + Vorname: this.data.vorname, + Nachname: this.data.nachname, + Postnomen: this.data.postnomen, + }, + + + SpecialInformation: { + Kurzzeichen: this.data.kurzbz, + Telefon: this.data.telefonklappe, + Büro:this.data.ort_kurzbz, + }, + }; + }, + //? this computed conains all the information that is used for the second column that displays the information of the person + kontaktInfo() { + if (!this.data) { + return {}; + } + + return { + + emails: this.data.emails, - concatenate_addresses(address_array){ - let result = ""; - for (let i = 0; i < address_array.length; i++) { - result += address_array[i].strasse + " " + address_array[i].plz + " " + address_array[i].ort + "\n"; - } - return result; - }, - render_unterelement(wert,bezeichnung){ - if (isArray(bezeichnung)){ - - } - }, - concatenate_kontakte(kontakt_array){ - let result = ""; - for (let i = 0; i < kontakt_array.length; i++) { - result += kontakt_array[i].kontakttyp + " " + kontakt_array[i].kontakt + " " + kontakt_array[i].zustellung + "\n"; - } - return result; - }, - sperre_foto_function(value){ - if(!(this.mitarbeiter_info && this.index_information && this.student_info) ){ - return; - } - fhcapifactory.UserData.sperre_foto_function(value).then(res => { + }; + }, + }, + + mounted() { + + + this.$refs.funktionenTable.tabulator.on('tableBuilt', () => { + + this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); + + }) + + }, + + template: ` + + +FH-Ausweis Status
+{{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
+{{email.type}}: {{email.email}}
+Private Kontakte
+Sie sind Mitgglied in folgenden Verteilern:
+MitarbeiterViewProfil
`, -}; \ No newline at end of file +}; diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index 3f23925e8..3e25652c5 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -51,7 +51,7 @@ export default { }, //? this props were passed in the Profil.php view file - props:['uid','view'], + props:['data','view'], methods: { concatenate_addresses(address_array){ diff --git a/public/js/components/Cis/Profil/StudentProfil.js b/public/js/components/Cis/Profil/StudentProfil.js index ffe63e952..13105d949 100644 --- a/public/js/components/Cis/Profil/StudentProfil.js +++ b/public/js/components/Cis/Profil/StudentProfil.js @@ -1,6 +1,5 @@ - import fhcapifactory from "../../../apps/api/fhcapifactory.js"; -import {CoreFilterCmpt} from "../../../components/filter/Filter.js" +import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; //? possible types of roles: //! depending on the role of the current view, different content is being displayed and fetched @@ -10,209 +9,284 @@ import {CoreFilterCmpt} from "../../../components/filter/Filter.js" //* View_Mitarbeiter export default { - components:{ - CoreFilterCmpt, - }, - data() { - return { - index_information: null, - mitarbeiter_info: null, - student_info:null, - //? beinhaltet die Information ob der angefragte user ein Student oder Mitarbeiter ist - role: null, + components: { + CoreFilterCmpt, + }, + data() { + return { + index_information: null, + mitarbeiter_info: null, + student_info: null, + //? beinhaltet die Information ob der angefragte user ein Student oder Mitarbeiter ist + role: null, - funktionen_table_options: { - height: 300, - layout: 'fitColumns', - data:[{Bezeichnung:"",Organisationseinheit:"",Gültig_von:"",Gültig_bis:"",Wochenstunden:""}], - columns: [{title: 'Bezeichnung', field: 'Bezeichnung', headerFilter: true}, - {title: 'Organisationseinheit', field: 'Organisationseinheit', headerFilter: true}, - {title: 'Gültig_von', field: 'Gültig_von', headerFilter: true}, - {title: 'Gültig_bis', field: 'Gültig_bis', headerFilter: true}, - {title: 'Wochenstunden', field: 'Wochenstunden', headerFilter: true},] - - }, - betriebsmittel_table_options:{ - height: 300, - layout: 'fitColumns', - data:[{betriebsmittel:"",Nummer:"",Ausgegeben_am:""}], - columns: [{title: 'Betriebsmittel', field: 'betriebsmittel', headerFilter: true}, - {title: 'Nummer', field: 'Nummer', headerFilter: true}, - {title: 'Ausgegeben_am', field: 'Ausgegeben_am', headerFilter: true},] - - }, - zutrittsgruppen_table_options:{ - height: 300, - layout: 'fitColumns', - data:[{bezeichnung:"test1"}], - columns: [{title: 'Zutritt', field: 'bezeichnung'}] - } - } + funktionen_table_options: { + height: 300, + layout: "fitColumns", + data: [ + { + Bezeichnung: "", + Organisationseinheit: "", + Gültig_von: "", + Gültig_bis: "", + Wochenstunden: "", + }, + ], + columns: [ + { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true }, + { + title: "Organisationseinheit", + field: "Organisationseinheit", + headerFilter: true, + }, + { title: "Gültig_von", field: "Gültig_von", headerFilter: true }, + { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true }, + { + title: "Wochenstunden", + field: "Wochenstunden", + headerFilter: true, + }, + ], + }, + betriebsmittel_table_options: { + height: 300, + layout: "fitColumns", + data: [{ betriebsmittel: "", Nummer: "", Ausgegeben_am: "" }], + columns: [ + { + title: "Betriebsmittel", + field: "betriebsmittel", + headerFilter: true, + }, + { title: "Nummer", field: "Nummer", headerFilter: true }, + { + title: "Ausgegeben_am", + field: "Ausgegeben_am", + headerFilter: true, + }, + ], + }, + zutrittsgruppen_table_options: { + height: 300, + layout: "fitColumns", + data: [{ bezeichnung: "test1" }], + columns: [{ title: "Zutritt", field: "bezeichnung" }], + }, + }; + }, + + //? this props were passed in the Profil.php view file + props: ["data"], + methods: { + concatenate_addresses(address_array) { + let result = ""; + for (let i = 0; i < address_array.length; i++) { + result += + address_array[i].strasse + + " " + + address_array[i].plz + + " " + + address_array[i].ort + + "\n"; + } + return result; }, + render_unterelement(wert, bezeichnung) { + if (isArray(bezeichnung)) { + } + }, + concatenate_kontakte(kontakt_array) { + let result = ""; + for (let i = 0; i < kontakt_array.length; i++) { + result += + kontakt_array[i].kontakttyp + + " " + + kontakt_array[i].kontakt + + " " + + kontakt_array[i].zustellung + + "\n"; + } + return result; + }, + sperre_foto_function(value) { + if (!this.data) { + return; + } + fhcapifactory.UserData.sperre_foto_function(value).then((res) => { + this.data.foto_sperre = res.data.foto_sperre; + }); + }, + }, + computed: { + get_image_base64_src() { + if (!this.data) { + return ""; + } + return "data:image/jpeg;base64," + this.data.foto; + }, + personData() { + if (!this.data) { + return {}; + } + + return { + Allgemein: { + Username: this.data.username, + Matrikelnummer: this.data.matrikelnummer, + Anrede: this.data.anrede, + Titel: this.data.titel, + Vorname: this.data.vorname, + Nachname: this.data.nachname, + Postnomen: this.data.postnomen, + }, + GeburtsDaten: { + Geburtsdatum: this.data.gebdatum, + Geburtsort: this.data.gebort, + }, + Adressen: this.data.adressen, + SpecialInformation: { + Studiengang: this.data.studiengang, + Semester: this.data.semester, + Verband: this.data.verband, + Gruppe: this.data.gruppe, + Personenkennzeichen: this.data.personenkennzeichen, + }, + }; + }, + //? this computed conains all the information that is used for the second column that displays the information of the person + kontaktInfo() { + if (!this.data) { + return {}; + } + + return { + FhAusweisStatus: this.data.zutrittsdatum, + emails: this.data.emails, + Kontakte: this.data.kontakte, + }; + }, + }, + + mounted() { + this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { - //? this props were passed in the Profil.php view file - props:['uid','view'], - methods: { + this.$refs.betriebsmittelTable.tabulator.setData(this.data.mittel); - concatenate_addresses(address_array){ - let result = ""; - for (let i = 0; i < address_array.length; i++) { - result += address_array[i].strasse + " " + address_array[i].plz + " " + address_array[i].ort + "\n"; - } - return result; - }, - render_unterelement(wert,bezeichnung){ - if (isArray(bezeichnung)){ - - } - }, - concatenate_kontakte(kontakt_array){ - let result = ""; - for (let i = 0; i < kontakt_array.length; i++) { - result += kontakt_array[i].kontakttyp + " " + kontakt_array[i].kontakt + " " + kontakt_array[i].zustellung + "\n"; - } - return result; - }, - sperre_foto_function(value){ - if(!(this.mitarbeiter_info && this.index_information && this.student_info) ){ - return; - } - fhcapifactory.UserData.sperre_foto_function(value).then(res => { + }) + + this.$refs.zutrittsgruppenTable.tabulator.on('tableBuilt', () => { + + this.$refs.zutrittsgruppenTable.tabulator.setData(this.data.zuttritsgruppen); + + }) + + }, + + template: ` + + +FH-Ausweis Status
+{{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}
+{{email.type}}: {{email.email}}
+Private Kontakte
+Sie sind Mitgglied in folgenden Verteilern:
+StudentProfil
`, -}; \ No newline at end of file +}; diff --git a/public/js/components/Cis/Profil/StudentViewProfil.js b/public/js/components/Cis/Profil/StudentViewProfil.js index 65484fd2e..a5f4036fb 100644 --- a/public/js/components/Cis/Profil/StudentViewProfil.js +++ b/public/js/components/Cis/Profil/StudentViewProfil.js @@ -1,6 +1,5 @@ - import fhcapifactory from "../../../apps/api/fhcapifactory.js"; -import {CoreFilterCmpt} from "../../../components/filter/Filter.js" +import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; //? possible types of roles: //! depending on the role of the current view, different content is being displayed and fetched @@ -10,209 +9,236 @@ import {CoreFilterCmpt} from "../../../components/filter/Filter.js" //* View_Mitarbeiter export default { - components:{ - CoreFilterCmpt, + components: { + CoreFilterCmpt, + }, + data() { + return { + index_information: null, + mitarbeiter_info: null, + student_info: null, + //? beinhaltet die Information ob der angefragte user ein Student oder Mitarbeiter ist + role: null, + + funktionen_table_options: { + height: 300, + layout: "fitColumns", + data: [ + { + Bezeichnung: "", + Organisationseinheit: "", + Gültig_von: "", + Gültig_bis: "", + Wochenstunden: "", + }, + ], + columns: [ + { title: "Bezeichnung", field: "Bezeichnung", headerFilter: true }, + { + title: "Organisationseinheit", + field: "Organisationseinheit", + headerFilter: true, + }, + { title: "Gültig_von", field: "Gültig_von", headerFilter: true }, + { title: "Gültig_bis", field: "Gültig_bis", headerFilter: true }, + { + title: "Wochenstunden", + field: "Wochenstunden", + headerFilter: true, + }, + ], + }, + betriebsmittel_table_options: { + height: 300, + layout: "fitColumns", + data: [{ betriebsmittel: "", Nummer: "", Ausgegeben_am: "" }], + columns: [ + { + title: "Betriebsmittel", + field: "betriebsmittel", + headerFilter: true, + }, + { title: "Nummer", field: "Nummer", headerFilter: true }, + { + title: "Ausgegeben_am", + field: "Ausgegeben_am", + headerFilter: true, + }, + ], + }, + zutrittsgruppen_table_options: { + height: 300, + layout: "fitColumns", + data: [{ bezeichnung: "test1" }], + columns: [{ title: "Zutritt", field: "bezeichnung" }], + }, + }; + }, + + //? this props were passed in the Profil.php view file + props: ["data"], + methods: { + concatenate_addresses(address_array) { + let result = ""; + for (let i = 0; i < address_array.length; i++) { + result += + address_array[i].strasse + + " " + + address_array[i].plz + + " " + + address_array[i].ort + + "\n"; + } + return result; }, - data() { - return { - index_information: null, - mitarbeiter_info: null, - student_info:null, - //? beinhaltet die Information ob der angefragte user ein Student oder Mitarbeiter ist - role: null, - - funktionen_table_options: { - height: 300, - layout: 'fitColumns', - data:[{Bezeichnung:"",Organisationseinheit:"",Gültig_von:"",Gültig_bis:"",Wochenstunden:""}], - columns: [{title: 'Bezeichnung', field: 'Bezeichnung', headerFilter: true}, - {title: 'Organisationseinheit', field: 'Organisationseinheit', headerFilter: true}, - {title: 'Gültig_von', field: 'Gültig_von', headerFilter: true}, - {title: 'Gültig_bis', field: 'Gültig_bis', headerFilter: true}, - {title: 'Wochenstunden', field: 'Wochenstunden', headerFilter: true},] - - }, - betriebsmittel_table_options:{ - height: 300, - layout: 'fitColumns', - data:[{betriebsmittel:"",Nummer:"",Ausgegeben_am:""}], - columns: [{title: 'Betriebsmittel', field: 'betriebsmittel', headerFilter: true}, - {title: 'Nummer', field: 'Nummer', headerFilter: true}, - {title: 'Ausgegeben_am', field: 'Ausgegeben_am', headerFilter: true},] - - }, - zutrittsgruppen_table_options:{ - height: 300, - layout: 'fitColumns', - data:[{bezeichnung:"test1"}], - columns: [{title: 'Zutritt', field: 'bezeichnung'}] - } - } + render_unterelement(wert, bezeichnung) { + if (isArray(bezeichnung)) { + } }, - - //? this props were passed in the Profil.php view file - props:['uid','view'], - methods: { - - concatenate_addresses(address_array){ - let result = ""; - for (let i = 0; i < address_array.length; i++) { - result += address_array[i].strasse + " " + address_array[i].plz + " " + address_array[i].ort + "\n"; - } - return result; - }, - render_unterelement(wert,bezeichnung){ - if (isArray(bezeichnung)){ - - } - }, - concatenate_kontakte(kontakt_array){ - let result = ""; - for (let i = 0; i < kontakt_array.length; i++) { - result += kontakt_array[i].kontakttyp + " " + kontakt_array[i].kontakt + " " + kontakt_array[i].zustellung + "\n"; - } - return result; - }, - sperre_foto_function(value){ - if(!(this.mitarbeiter_info && this.index_information && this.student_info) ){ - return; - } - fhcapifactory.UserData.sperre_foto_function(value).then(res => { - - this.index_information.foto_sperre = res.data.foto_sperre; - - }); - - }, - - + concatenate_kontakte(kontakt_array) { + let result = ""; + for (let i = 0; i < kontakt_array.length; i++) { + result += + kontakt_array[i].kontakttyp + + " " + + kontakt_array[i].kontakt + + " " + + kontakt_array[i].zustellung + + "\n"; + } + return result; }, - computed:{ - - - get_image_base64_src(){ - if(!this.index_information){ - return ""; - } - return "data:image/jpeg;base64,"+this.index_information.foto; - }, - personData(){ - if(!this.index_information){ - return {}; - } - - return { - Allgemein: (this.role =='Mitarbeiter' || this.role =='View_Mitarbeiter')?{ - Username:this.index_information.username, - Anrede:this.index_information.anrede, - Titel:this.index_information.titel, - Vorname:this.index_information.vorname, - Nachname:this.index_information.nachname, - Postnomen:this.index_information.postnomen, - }:{ - Username:this.index_information.username, - Matrikelnummer: this.student_info?.matrikelnummer, - Anrede:this.index_information.anrede, - Titel:this.index_information.titel, - Vorname:this.index_information.vorname, - Nachname:this.index_information.nachname, - Postnomen:this.index_information.postnomen, - }, - GeburtsDaten:!this.role.includes("View")?{ - Geburtsdatum:this.index_information.gebdatum, - Geburtsort: this.index_information.gebort, - }: null, - Adressen: this.index_information.adressen, - SpecialInformation: this.role =='Mitarbeiter' || this.role === 'View_Mitarbeiter'? { - Kurzzeichen: this.mitarbeiter_info?.kurzbz, - Telefon: this.mitarbeiter_info?.telefonklappe, - //* Wird das Feld Ort_kurzbz noch gepflegt? - ...(this.role === 'View_Mitarbeiter'?{Büro:this.mitarbeiter_info?.ort_kurzbz}:{}) , - } : { - Studiengang:this.student_info?.studiengang, - Semester:this.student_info?.semester, - Verband:this.student_info?.verband, - Gruppe:this.student_info?.gruppe, - Personenkennzeichen:this.student_info?.personenkennzeichen - }, - }; - }, - //? this computed conains all the information that is used for the second column that displays the information of the person - kontaktInfo(){ - if(!this.index_information){ - return {}; - } - - return { - FhAusweisStatus: this.index_information.zutrittsdatum, - emails: this.role === 'Mitarbeiter' || this.role === 'View_Mitarbeiter'? this.mitarbeiter_info?.emails: this.index_information.emails, - Kontakte:this.index_information.kontakte, - }; - }, - + sperre_foto_function(value) { + if (!this.data) { + return; + } + fhcapifactory.UserData.sperre_foto_function(value).then((res) => { + this.data.foto_sperre = res.data.foto_sperre; + }); }, - - mounted(){ - - console.log(this.uid); - console.log(this.view); - console.log(typeof this.view); - if(this.view){console.log("view is true")}else{ console.log("view is false")} - - //? this function is to update the tabulator information only when the tabulator was build checking the tableBulit event - //! only the tableBuilt event of the second tabulator was used to update the table informations - - - fhcapifactory.UserData.isMitarbeiterOrStudent(this.uid).then((res) => { - - this.role = this.view? "View_"+res.data: res.data; - if(!this.role.includes('View')){ - this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { - }) - } - - - console.log("the role of the current view: ", this.role); - - - - //? Die anderen api calls werden erst gemacht wenn der call zu isMitarbeiterOrStudent gemacht worden ist - - - //! indexProfilInformationen werden immer gefetcht - fhcapifactory.UserData.indexProfilInformaion(this.uid,this.view).then((res) => { - console.log(res.data); - this.index_information = res.data; - if(!this.role.includes("View")){ - this.$refs.betriebsmittelTable.tabulator.setData(res.data.mittel); - } - }); - - - //? Danach werden die Informationen der Role gefetcht - if(this.role === "Student" || this.role === "View_Student"){ - fhcapifactory.UserData.studentProfil(this.uid,this.view).then((res)=> { - this.student_info = res.data; - if(this.role ==="Student"){ - this.$refs.zutrittsgruppenTable.tabulator.setData(res.data.zuttritsgruppen); - } - }) - } - - if(this.role === "Mitarbeiter" || this.role === "View_Mitarbeiter"){ - fhcapifactory.UserData.mitarbeiterProfil(this.uid).then((res)=> { - this.mitarbeiter_info = res.data; - this.$refs.funktionenTable.tabulator.setData(res.data.funktionen); - }) - } - }); - - - + }, + computed: { + get_image_base64_src() { + if (!this.data) { + return ""; + } + return "data:image/jpeg;base64," + this.data.foto; }, - - template: ` + personData() { + if (!this.data) { + return {}; + } + + return { + Allgemein: { + Username: this.data.username, + Matrikelnummer: this.data.matrikelnummer, + Anrede: this.data.anrede, + Titel: this.data.titel, + Vorname: this.data.vorname, + Nachname: this.data.nachname, + Postnomen: this.data.postnomen, + }, + + + SpecialInformation: { + Studiengang: this.data.studiengang, + Semester: this.data.semester, + Verband: this.data.verband, + Gruppe: this.data.gruppe, + Personenkennzeichen: this.data.personenkennzeichen, + }, + }; + }, + //? this computed conains all the information that is used for the second column that displays the information of the person + kontaktInfo() { + if (!this.data) { + return {}; + } + + return { + + emails: this.data.emails, + + }; + }, + }, + + mounted() { -StudentViewProfil
+ + }, + + template: ` + + +{{email.type}}: {{email.email}}
+Sie sind Mitgglied in folgenden Verteilern:
+