mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
makes it possible to display documents when reviewing profil update requests
This commit is contained in:
@@ -26,7 +26,8 @@ class Profil extends Auth_Controller
|
||||
'selectProfilRequest' => ['student/anrechnung_beantragen:r', 'user:r'],
|
||||
'insertFile' => ['student/anrechnung_beantragen:r', 'user:r'],
|
||||
'getProfilRequestFiles' => ['student/anrechnung_beantragen:r', 'user:r'],
|
||||
|
||||
'deleteOldVersionFiles' => ['student/anrechnung_beantragen:r', 'user:r'],
|
||||
|
||||
]);
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
@@ -38,6 +39,8 @@ class Profil extends Auth_Controller
|
||||
$this->load->model('ressource/Betriebsmittelperson_model', 'BetriebsmittelpersonModel');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
$this->load->model('person/Profil_change_model', 'ProfilChangeModel');
|
||||
$this->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
|
||||
|
||||
//? put the uid and pid inside the controller to reuse in controller
|
||||
$this->uid = getAuthUID();
|
||||
@@ -114,6 +117,18 @@ class Profil extends Auth_Controller
|
||||
}
|
||||
|
||||
|
||||
public function deleteOldVersionFiles(){
|
||||
//? table dms_version has a composite primary key with dms_id and dms_version
|
||||
$file_array = json_decode($this->input->raw_input_stream);
|
||||
$res =[];
|
||||
foreach($file_array as $value){
|
||||
|
||||
array_push($res, $this->DmsVersionModel->delete([$value,0]));
|
||||
}
|
||||
echo json_encode($res);
|
||||
}
|
||||
|
||||
|
||||
public function selectProfilRequest(){
|
||||
$_GET = json_decode($this->input->raw_input_stream, true);
|
||||
$uid = $this->input->get('uid');
|
||||
|
||||
@@ -15,6 +15,7 @@ class ProfilUpdate extends Auth_Controller
|
||||
'getAllRequests' => ['student/anrechnung_beantragen:r', 'user:r'],
|
||||
'acceptProfilRequest'=>['user:r'],
|
||||
'denyProfilRequest'=>['user:r'],
|
||||
'show'=>['user:r'],
|
||||
|
||||
]);
|
||||
|
||||
@@ -31,6 +32,17 @@ class ProfilUpdate extends Auth_Controller
|
||||
$this->load->view('Cis/ProfilUpdate');
|
||||
}
|
||||
|
||||
public function show($dms_id){
|
||||
$this->load->library('DmsLib');
|
||||
//? downloads the file using the dms_id
|
||||
$file = $this->dmslib->download($dms_id);
|
||||
$file = hasData($file) ? getData($file) : null;
|
||||
//? returns the downloaded file to the user
|
||||
$res = $this->outputFile($file);
|
||||
|
||||
echo json_encode($res);
|
||||
}
|
||||
|
||||
public function getAllRequests(){
|
||||
$res = $this->ProfilChangeModel->getProfilUpdate();
|
||||
$res = hasData($res)? getData($res) : null;
|
||||
@@ -87,7 +99,8 @@ class ProfilUpdate extends Auth_Controller
|
||||
case "titel": $topic ="titelpre"; break;
|
||||
case "postnomen": $topic = "titelpost"; break;
|
||||
}
|
||||
$result = $this->PersonModel->update($personID,[$topic=>$requested_change]);
|
||||
|
||||
$result = $this->PersonModel->update($personID,[$topic=>$requested_change["value"]]);
|
||||
if(isError($result)){
|
||||
echo json_encode(error("was not able to update Person Information: " . $topic . " with value : " . $requested_change));
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user