adds breadcrumb to modal and adjusts controller functions and api calls

This commit is contained in:
SimonGschnell
2024-01-16 15:44:04 +01:00
parent 73792d1e78
commit b53dec6a31
8 changed files with 174 additions and 206 deletions
@@ -15,7 +15,8 @@ class Profil_change_model extends DB_Model
}
/**
* getLastStatuses
* getTimestamp
* returns insert or update timestamp of a certain profil update
*/
public function getTimestamp($uid){
$this->addSelect(['change_timestamp']);
@@ -23,4 +24,31 @@ class Profil_change_model extends DB_Model
return hasData($res) ? getData($res)[0]->change_timestamp : null;
}
/**
*
* getProfilUpdate
* returns a profil update with id
* returns all profil updates if id is set to null
*/
public function getProfilUpdate($uid,$id=null){
$whereClause = ["uid"=>$uid];
if(!is_null($id)){
$whereClause['profil_update_id']=$id;
}
$res = $this->loadWhere($whereClause);
if(isError($res)){
// catch error
}else{
if(hasData($res)){
foreach($res->retval as $update){
$update->requested_change = json_decode($update->requested_change);
$update->change_timestamp = date_create($update->change_timestamp)->format('d.m.Y');
}
}
}
return $res;
}
}