diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php index d46217fea..58b5e2280 100644 --- a/application/controllers/Cis/Profil.php +++ b/application/controllers/Cis/Profil.php @@ -533,8 +533,8 @@ class Profil extends Auth_Controller //telefon nummer von dem Standort $res->standort_telefon = $telefon_res; - $res->editData = json_decode($editData_res->profil_changes); - $res->editDataTimestamp = $editData_res->change_timestamp; + $res->editData = $editData_res? json_decode($editData_res->profil_changes): null; + $res->editDataTimestamp = $editData_res? $editData_res->change_timestamp: null; return $res; } @@ -733,8 +733,8 @@ class Profil extends Auth_Controller $res->mailverteiler = $mailverteiler_res; - $res->editData = json_decode($editData_res->profil_changes); - $res->editDataTimestamp = $editData_res->change_timestamp; + $res->editData = $editData_res? json_decode($editData_res->profil_changes): null; + $res->editDataTimestamp = $editData_res? $editData_res->change_timestamp: null; return $res; diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js index 2969d62f2..4014d8e6e 100644 --- a/public/js/apps/Cis/Profil.js +++ b/public/js/apps/Cis/Profil.js @@ -107,9 +107,15 @@ const app = Vue.createApp({ Vue.$fhcapi.UserData.getView(uid).then((res)=>{ if(!res.data){ this.notFoundUID=uid; + }else{ + this.view = res.data?.view; + + this.data = res.data?.data; + + if(this.data.editDataTimestamp){ + this.data.editDataTimestamp= new Date(this.data.editDataTimestamp); + } } - this.view = res.data?.view; - this.data = res.data?.data; }); diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 5630fa8ee..0be210761 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -3,6 +3,7 @@ import { CoreFilterCmpt } from "../../../components/filter/Filter.js"; import BsModal from "../../Bootstrap/Modal.js"; + export default { components: { CoreFilterCmpt, @@ -165,6 +166,15 @@ export default { }, computed: { + + editDataTimestampFormated: function(){ + return [ + this.data.editDataTimestamp.getDate().toString().padStart(2,'0'), + (this.data.editDataTimestamp.getMonth()+1).toString().padStart(2,'0'), + this.data.editDataTimestamp.getFullYear(), + ].join('/'); + }, + //? legacy mailto link to create an email with information that should be changed refreshMailTo() { return `mailto:info.mio@technikum-wien.at?subject=Datenkorrektur&body=Die%20Profildaten%20für%20User%20'${this.data.username}'%20sind%20nicht%20korrekt.%0DHier, die richtigen Daten:%0A%0ANachname:%20${this.data.nachname}%0AVorname:%20${this.data.vorname}%0AGeburtsdatum:${this.data.gebdatum}%0AGeburtsort:%20${this.data.gebort}%0ATitelPre:${this.data.titel}%20%0ATitelPost:${this.data.postnomen}%20%0A%0A***%0DPlatz für weitere (nicht angeführte Daten)%0D***%0A%0A[Bitte%20übermitteln%20Sie%20uns%20etwaige%20Dokumente%20zum%20Beleg%20der%20Änderung]`; @@ -291,6 +301,9 @@ export default { this.$refs.funktionenTable.tabulator.on("tableBuilt", () => { this.$refs.funktionenTable.tabulator.setData(this.data.funktionen); }); + + + }, @@ -587,8 +600,10 @@ export default { -