corrects the display of links to attachments of a profil update request

This commit is contained in:
SimonGschnell
2024-02-09 14:41:29 +01:00
parent 43492add0b
commit bbf6616cd9
6 changed files with 27 additions and 15 deletions
+2 -3
View File
@@ -178,7 +178,6 @@ class ProfilUpdate extends Auth_Controller
return json_encode(error("Error loading DmsVersion resource"));
}
$attachment = hasData($attachment) ? getData($attachment) : null;
//? returns {name:..., dms_id:...}
echo json_encode($attachment);
}
@@ -353,11 +352,11 @@ class ProfilUpdate extends Auth_Controller
}
private function updateRequestedChange($id, $requested_change){
return $this->update([$id], ['requested_change'=>json_encode($requested_change)]);
return $this->ProfilUpdateModel->update([$id], ['requested_change'=>json_encode($requested_change)]);
}
private function setStatusOnUpdateRequest($id, $status, $status_message ){
return $this->update([$id], ["status"=>$status,"status_timestamp"=>"NOW()","status_message"=>$status_message]);
return $this->ProfilUpdateModel->update([$id], ["status"=>$status,"status_timestamp"=>"NOW()","status_message"=>$status_message]);
}
@@ -84,7 +84,9 @@ class Profil_update_model extends DB_Model
//? Nur wenn der/die AssistentIn auch die Berechtigung in der gleichen Organisationseinheit des Studenten hat
$parameters = [];
$query="
SELECT * FROM public.tbl_profil_update
SELECT
profil_update_id, uid, name, topic, requested_change, tbl_profil_update.updateamum, tbl_profil_update.updatevon, tbl_profil_update.insertamum, tbl_profil_update.insertvon, status, status_timestamp, status_message, attachment_id
FROM public.tbl_profil_update
JOIN public.tbl_student ON public.tbl_student.student_uid=public.tbl_profil_update.uid
JOIN public.tbl_prestudent ON public.tbl_prestudent.prestudent_id=public.tbl_student.prestudent_id
JOIN public.tbl_studiengang ON public.tbl_studiengang.studiengang_kz=public.tbl_prestudent.studiengang_kz
@@ -107,7 +109,7 @@ class Profil_update_model extends DB_Model
}
}
if($mitarbeiterBerechtigung) {
$this->addSelect(["profil_update_id", "uid", "name", "topic", "requested_change", "tbl_profil_update.updateamum", "tbl_profil_update.updatevon", "tbl_profil_update.insertamum", "tbl_profil_update.insertvon", "status", "status_timestamp", "status_message", "attachment_id"]);
$this->addJoin('tbl_mitarbeiter','tbl_mitarbeiter.mitarbeiter_uid=tbl_profil_update.uid');
$mitarbeiterRequests = $this->loadWhere($whereClause);
if(isError($mitarbeiterRequests)) return error("db error: ". getData($mitarbeiterRequests));