diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index bd0970923..cbbc84145 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -86,12 +86,16 @@ class Profil extends Auth_Controller } - $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittel(getAuthPersonId()); + $zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid(getAuthUID(),"Zutrittskarte"); if(isError($zutrittskarte_ausgegebenam)){ // error handling }else{ - $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam)? getData($zutrittskarte_ausgegebenam)[0] : null; + $zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam)? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null; + //? formats the date from 01-01-2000 to 01.01.2000 + $zutrittskarte_ausgegebenam = str_replace("-",".",$zutrittskarte_ausgegebenam); } + + if( isSuccess($this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel","nummer as Nummer","ausgegebenam as Ausgegeben_am"])) @@ -170,9 +174,14 @@ class Profil extends Auth_Controller //? Mitarbeiter Info $res->kurzbz = $mitarbeiter_res->kurzbz; $res->telefonklappe = $mitarbeiter_res->telefonklappe; - //? Benutzer Info - $res->email_intern = getAuthUID() . DOMAIN; - $res->email_extern = $benutzer_res->alias . DOMAIN; + //? Email Info + $intern_email = array(); + $intern_email+=array("type" => "intern"); + $intern_email+=array("email"=> getAuthUID() . DOMAIN); + $extern_email=array(); + $extern_email+=array("type" => "extern"); + $extern_email+=array("email" => $benutzer_res->alias . DOMAIN); + $res->emails = array($intern_email,$extern_email); //? Adresse Info $res->adressen = $adresse_res; //? Benutzerfunktion Info @@ -180,7 +189,7 @@ class Profil extends Auth_Controller //? Betriebsmittel Info $res->mittel = $betriebsmittelperson_res; //? Austellungsdatum von der Zutrittskarte - $res->zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam->ausgegebenam; + $res->zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam; //? Kontakt Info $res->kontakte = $kontakte_res; //? Mailverteiler Info diff --git a/application/views/Cis/Profil.php b/application/views/Cis/Profil.php index 8c930db09..931d879d5 100644 --- a/application/views/Cis/Profil.php +++ b/application/views/Cis/Profil.php @@ -3,7 +3,7 @@ $includesArray = array( 'title' => 'Stundenplan', 'customJSModules' => ['public/js/apps/Cis/ProfilApp.js'], 'tabulator5' => true, - 'customCSSs' => ['public/css/components/calendar.css'] + 'customCSSs' => ['public/css/components/calendar.css', 'public/css/components/FilterComponent.css'] ); $this->load->view('templates/CISHTML-Header', $includesArray); diff --git a/public/js/components/Cis/Profil/Profil.js b/public/js/components/Cis/Profil/Profil.js index e8970f3f5..7361f8026 100644 --- a/public/js/components/Cis/Profil/Profil.js +++ b/public/js/components/Cis/Profil/Profil.js @@ -46,7 +46,7 @@ export default { betriebsmittel_table_options:{ height: 300, layout: 'fitColumns', - data:[{Bezeichnung:"test1",Organisationseinheit:"test2",Gültig_von:"test3",Gültig_bis:"test4",Wochenstunden:"test5"}], + data:[{betriebsmittel:"test1",Nummer:"test2",Ausgegeben_am:"test3"}], columns: [{title: 'Betriebsmittel', field: 'betriebsmittel', headerFilter: true}, {title: 'Nummer', field: 'Nummer', headerFilter: true}, @@ -59,6 +59,7 @@ export default { //? this props were passed in the Profil.php view file props:['uid','pid'], methods: { + concatenate_addresses(address_array){ let result = ""; for (let i = 0; i < address_array.length; i++) { @@ -133,8 +134,8 @@ export default { } //! postnomen is still missing return { - Intern:this.person_info.email_intern, - Alias:this.person_info.email_extern, + FhAusweisStatus: this.person_info.zutrittskarte_ausgegebenam, + emails:this.person_info.emails, Kontakte:this.person_info.kontakte, }; }, @@ -150,12 +151,21 @@ export default { //.tabulator.setData(this.person_info?.funktionen); }, - mounted(){ - fhcapifactory.UserData.getMitarbeiterAnsicht().then(res => { - this.person_info = res.data; - this.$refs.funktionenTable.tabulator.setData(res.data.funktionen); - this.$refs.betriebsmittelTable.tabulator.setData(res.data.mittel); - }); + mounted(){ + //? 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 + this.$refs.betriebsmittelTable.tabulator.on('tableBuilt', () => { + fhcapifactory.UserData.getMitarbeiterAnsicht().then((res)=>{ + this.person_info = res.data; + this.$refs.funktionenTable.tabulator.setData(res.data.funktionen); + this.$refs.betriebsmittelTable.tabulator.setData(res.data.mittel); + + }) + }) + + + + }, template: ` @@ -200,17 +210,27 @@ export default {
    - +
  1. -

    + +

    +

    FH-Ausweis Status

    +

    {{"Der FH Ausweis ist am "+ wert+ " ausgegeben worden."}}

    +
    + + + +
    +

    Private Kontakte

    + {{element.kontakttyp + " " + element.kontakt+" " }} + +
    -

    - -

    {{bezeichnung +": "+wert}}

    +
@@ -223,7 +243,7 @@ export default {
- +
@@ -231,8 +251,9 @@ export default {
+ - +
diff --git a/public/js/components/filter/Filter.js b/public/js/components/filter/Filter.js index 2bf878e5a..985dc9a6e 100644 --- a/public/js/components/filter/Filter.js +++ b/public/js/components/filter/Filter.js @@ -182,8 +182,11 @@ export const CoreFilterCmpt = { const cols = this.tabulator.getColumns(); this.fields = cols.map(col => col.getField()); this.selectedFields = cols.filter(col => col.isVisible()).map(col => col.getField()); + }); + } + }, updateTabulator() { if (this.tabulator) {