Added check, when STGL tries to request recommendation for already recommended Antraege

Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
Cris
2021-01-26 10:58:26 +01:00
committed by cris-technikum
parent 5b77a5d08f
commit 7d0ff4fcee
5 changed files with 66 additions and 12 deletions
@@ -202,7 +202,8 @@ class approveAnrechnungUebersicht extends Auth_Controller
$json[]= array(
'anrechnung_id' => $item['anrechnung_id'],
'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR,
'status_bezeichnung' => $inProgressLektor
'status_bezeichnung' => $inProgressLektor,
'empfehlung_anrechnung' => null
);
}
}
+24 -3
View File
@@ -284,15 +284,36 @@ class AnrechnungLib
return success(false); // dont ask for recommendation
}
// Start DB transaction
$this->ci->db->trans_start(false);
// Insert new status inProgressLektor
$result = $this->ci->AnrechnungModel->saveAnrechnungstatus($anrechnung_id, self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR);
if (isError($result))
/**
* Anyway update empfehlung_anrechnung to be null
* Regardless of what empfehlung_anrechnung was already set (true/false/null), it should be (reset to ) null by
* requesting a (new) recommendation.
* **/
$this->ci->AnrechnungModel->update(
$anrechnung_id,
array(
'empfehlung_anrechnung' => null,
'updateamum' => (new DateTime())->format('Y-m-d H:m:i'),
'updatevon' => getAuthUID()
)
);
// Transaction complete
$this->ci->db->trans_complete();
if ($this->ci->db->trans_status() === false)
{
show_error(getError($result));
$this->ci->db->trans_rollback();
return error($result->msg, EXIT_ERROR);
}
return success(true); // rejected
return success(true); // recommended
}
/**
@@ -17,7 +17,8 @@ $this->load->view(
),
'anrechnung' => array(
'nachweisdokumente',
'empfehlung'
'empfehlung',
'confirmTextAntragHatBereitsEmpfehlung'
),
'ui' => array(
'anzeigen',