mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 08:34:29 +00:00
Added logic & GUI adaptations for rejecting Anrechnungen
. Added rejecting-methods in Controller and Library Signed-off-by: cris-technikum <[email protected]>
This commit is contained in:
@@ -18,7 +18,8 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
array(
|
||||
'index' => 'lehre/anrechnung_genehmigen:rw',
|
||||
'download' => 'lehre/anrechnung_genehmigen:rw',
|
||||
'approve' => 'lehre/anrechnung_genehmigen:rw'
|
||||
'approve' => 'lehre/anrechnung_genehmigen:rw',
|
||||
'reject' => 'lehre/anrechnung_genehmigen:rw'
|
||||
)
|
||||
);
|
||||
|
||||
@@ -127,6 +128,45 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function reject()
|
||||
{
|
||||
$data = $this->input->post('data');
|
||||
|
||||
if(isEmptyArray($data))
|
||||
{
|
||||
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
|
||||
}
|
||||
|
||||
// Get statusbezeichnung for 'approved'
|
||||
$this->AnrechnungstatusModel->addSelect('bezeichnung_mehrsprachig');
|
||||
$rejected = getData($this->AnrechnungstatusModel->load('rejected'))[0];
|
||||
$rejected = getUserLanguage() == 'German'
|
||||
? $rejected->bezeichnung_mehrsprachig[0]
|
||||
: $rejected->bezeichnung_mehrsprachig[1];
|
||||
|
||||
foreach ($data as $item)
|
||||
{
|
||||
// Approve Anrechnung
|
||||
if(getData($this->anrechnunglib->rejectAnrechnung($item['anrechnung_id'])))
|
||||
{
|
||||
$json[]= array(
|
||||
'anrechnung_id' => $item['anrechnung_id'],
|
||||
'status_bezeichnung' => $rejected
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Output json to ajax
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
{
|
||||
return $this->outputJsonSuccess($json);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->outputJsonError('Es wurden keine Anrechnungen genehmigt.');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Download and open uploaded document (Nachweisdokument).
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user