diff --git a/application/controllers/Cis/Profil.php b/application/controllers/Cis/Profil.php
index 9f692b0a9..272474d22 100644
--- a/application/controllers/Cis/Profil.php
+++ b/application/controllers/Cis/Profil.php
@@ -76,15 +76,16 @@ class Profil extends Auth_Controller
$res = $this->ProfilChangeModel->load([$this->uid]);
$res = hasData($res) ? getData($res) : null;
-
+
if (empty($res)) {
$insert_res = $this->ProfilChangeModel->insert($data);
if(isError($insert_res)){
//catch error
}else{
+ $editTimestamp = $this->ProfilChangeModel->getTimestamp($this->uid);
//? status code 201 CREATED
$insert_res->code = 201;
- $insert_res->retval = $this->ProfilChangeModel->getTimestamp($this->uid)->change_timestamp;
+ $insert_res->retval = date_create($editTimestamp)->format('d/m/Y');
echo json_encode($insert_res);
}
@@ -93,9 +94,10 @@ class Profil extends Auth_Controller
if(isError($update_res)){
//catch error
}
+ $editTimestamp = $this->ProfilChangeModel->getTimestamp($this->uid);
//? status code 200 OK
$update_res->code = 200;
- $update_res->retval = $this->ProfilChangeModel->getTimestamp($this->uid)->change_timestamp;
+ $update_res->retval = date_create($editTimestamp)->format('d/m/Y');;
echo json_encode($update_res);
}
@@ -547,7 +549,8 @@ class Profil extends Auth_Controller
$res->standort_telefon = $telefon_res;
$res->editData = $editData_res? json_decode($editData_res->profil_changes): null;
- $res->editDataTimestamp = $editData_res? $editData_res->change_timestamp: null;
+ $res->editDataTimestamp = $editData_res? date_create($editData_res->change_timestamp)->format('d/m/Y') : null;
+
return $res;
}
@@ -747,7 +750,8 @@ class Profil extends Auth_Controller
$res->mailverteiler = $mailverteiler_res;
$res->editData = $editData_res? json_decode($editData_res->profil_changes): null;
- $res->editDataTimestamp = $editData_res? $editData_res->change_timestamp: null;
+ $res->editDataTimestamp = $editData_res? date_create($editData_res->change_timestamp)->format('d/m/Y'): null;
+
return $res;
diff --git a/application/controllers/Cis/ProfilUpdate.php b/application/controllers/Cis/ProfilUpdate.php
index 5e410bace..2ee7368be 100644
--- a/application/controllers/Cis/ProfilUpdate.php
+++ b/application/controllers/Cis/ProfilUpdate.php
@@ -35,7 +35,14 @@ class ProfilUpdate extends Auth_Controller
echo $res->retval->data;
return;
}else{
- $res = hasData($res)? getData($res) : null;
+ if(hasData($res)){
+ $res = getData($res);
+ foreach($res as $element){
+ $element->change_timestamp = date_create($element->change_timestamp)->format('d/m/Y H:i');
+ }
+ }else{
+ $res = null;
+ }
}
echo json_encode($res);
}
diff --git a/application/models/person/Profil_change_model.php b/application/models/person/Profil_change_model.php
index 946fe6d84..f7e514847 100644
--- a/application/models/person/Profil_change_model.php
+++ b/application/models/person/Profil_change_model.php
@@ -12,8 +12,6 @@ class Profil_change_model extends DB_Model
$this->pk = ['uid'];
$this->hasSequence = false;
- //? loading other models to query them
- $this->load->model('crm/prestudentstatus_model', 'PrestudentstatusModel');
}
/**
@@ -22,7 +20,7 @@ class Profil_change_model extends DB_Model
public function getTimestamp($uid){
$this->addSelect(['change_timestamp']);
$res = $this->load([$uid]);
- return hasData($res) ? getData($res)[0] : null;
+ return hasData($res) ? getData($res)[0]->change_timestamp : null;
}
}
diff --git a/public/js/apps/Cis/Profil.js b/public/js/apps/Cis/Profil.js
index ba4443b69..a490eddc5 100644
--- a/public/js/apps/Cis/Profil.js
+++ b/public/js/apps/Cis/Profil.js
@@ -114,9 +114,7 @@ const app = Vue.createApp({
this.data = res.data?.data;
- if(this.data.editDataTimestamp){
- this.data.editDataTimestamp= new Date(this.data.editDataTimestamp);
- }
+
}
diff --git a/public/js/apps/Cis/ProfilUpdateRequests.js b/public/js/apps/Cis/ProfilUpdateRequests.js
index 4a518796c..65b996f3c 100644
--- a/public/js/apps/Cis/ProfilUpdateRequests.js
+++ b/public/js/apps/Cis/ProfilUpdateRequests.js
@@ -1,6 +1,14 @@
import fhcapifactory from "../api/fhcapifactory.js";
import {CoreFilterCmpt} from '../../components/filter/Filter.js'
Vue.$fhcapi = fhcapifactory;
+/*
+data: [
+ {
+ uid: "",
+ profil_changes: "",
+ change_timestamp: "",
+ },
+], */
const app = Vue.createApp({
components:{
@@ -9,32 +17,32 @@ const app = Vue.createApp({
data(){
return{
profil_updates_table_options:{
+ ajaxURL:FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + '/Cis/ProfilUpdate/getAllRequests',
height:300,
layout:'fitColumns',
responsiveLayout: "collapse",
- data: [
- {
- uid: "",
- profil_changes: "",
- change_timestamp: "",
- },
- ],
+ responsiveLayoutCollapseUseFormatters:false,
+ responsiveLayoutCollapseFormatter:this.collapseFormatter,
+
columns: [
{
title: "Uid",
field: "uid",
minWidth: 200,
+ responsive:0,
},
{
title: "Update",
field: "profil_changes",
- minWidth: 200,
+ minWidth: 10000,
+ responsive:3,
},
{
title: "Date",
field: "change_timestamp",
resizable: true,
minWidth: 200,
+ responsive:0,
},
],
@@ -44,7 +52,33 @@ const app = Vue.createApp({
methods:{
sideMenuFunction: function(){
console.log("test from the side menu");
- }
+ },
+ collapseFormatter: function(data){
+ //data - an array of objects containing the column title and value for each cell
+ var container = document.createElement("div");
+ container.classList.add("tabulator-collapsed-row");
+ container.classList.add("text-break");
+
+ var list = document.createElement("div");
+ list.classList.add("row");
+
+
+ container.appendChild(list);
+
+ data.forEach(function(col){
+ let item = document.createElement("div");
+ item.classList.add("col-12");
+
+
+ item.innerHTML = Object.keys(JSON.parse(col.value)).map(key => {return key+'
'});
+
+
+ list.appendChild(item);
+
+ });
+
+ return Object.keys(data).length ? container : "";
+ },
},
created(){
@@ -54,12 +88,7 @@ const app = Vue.createApp({
},
mounted(){
- this.$refs.UpdatesTable.tabulator.on('tableBuilt',()=>{
- Vue.$fhcapi.UserData.getProfilUpdateRequest().then((data)=>{
- this.$refs.UpdatesTable.tabulator.setData(data.data);
- }).catch(()=>{});
-
- });
+
},
template:`
{{JSON.stringify(changesData,null,2)}}
+
Letzte Anfrage: {{getFormatedDate}}
+Letzte Anfrage: {{editTimestamp}}
diff --git a/public/js/components/Cis/Profil/MitarbeiterProfil.js b/public/js/components/Cis/Profil/MitarbeiterProfil.js index 0776565be..538e1a2f5 100644 --- a/public/js/components/Cis/Profil/MitarbeiterProfil.js +++ b/public/js/components/Cis/Profil/MitarbeiterProfil.js @@ -126,13 +126,13 @@ export default { methods: { showModal() { - + EditProfil.popup({ value:JSON.parse(JSON.stringify(this.data.editData)), timestamp:this.data.editDataTimestamp }).then((res) => { if(res.timestamp && res.editData){ - this.data.editDataTimestamp = new Date(res.timestamp); + this.data.editDataTimestamp = res.timestamp; this.data.editData = res.editData; } @@ -260,14 +260,13 @@ export default { created() { - if(!this.data.editData){ this.data.editData = { Personen_Informationen : {...this.personData, vorname: this.data.vorname, nachname: this.data.nachname}, - Mitarbeiter_Informatinen: this.specialData, + Mitarbeiter_Informationen: this.specialData, Emails:this.data.emails, Private_Kontakte: this.data.kontakte, Private_Adressen:this.privateAdressen,