fetches profil update request if an entry with uid in table public.tbl_cis_profil_update exists

This commit is contained in:
Simon Gschnell
2023-12-28 11:51:58 +01:00
parent 414541b6cf
commit 59b848c576
5 changed files with 63 additions and 52 deletions
+27 -1
View File
@@ -21,6 +21,7 @@ class Profil extends Auth_Controller
'foto_sperre_function' => ['student/anrechnung_beantragen:r', 'user:r'],
'getView' => ['student/anrechnung_beantragen:r', 'user:r'],
'editProfil' => ['student/anrechnung_beantragen:r', 'user:r'],
]);
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
@@ -90,6 +91,7 @@ class Profil extends Auth_Controller
}
private function viewMitarbeiterProfil($uid)
{
@@ -179,6 +181,7 @@ class Profil extends Auth_Controller
}
}
$res = new stdClass();
$res->username = $uid;
@@ -482,6 +485,15 @@ class Profil extends Auth_Controller
}
}
//? querying if the user already has a pending profil information update request
$editData_res = $this->ProfilChangeModel->load([$this->uid]);
if(isError($editData_res)){
//error handling
}else{
$editData_res = hasData($editData_res) ? getData($editData_res)[0] : null;
}
$res = new stdClass();
$res->foto = $person_res->foto;
$res->foto_sperre = $person_res->foto_sperre;
@@ -520,6 +532,10 @@ 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;
return $res;
}
@@ -672,6 +688,15 @@ class Profil extends Auth_Controller
}
}
//? querying if the user already has a pending profil information update request
$editData_res = $this->ProfilChangeModel->load([$this->uid]);
if(isError($editData_res)){
//error handling
}else{
$editData_res = hasData($editData_res) ? getData($editData_res)[0] : null;
}
$res = new stdClass();
@@ -708,7 +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;
return $res;