mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-03 11:59:29 +00:00
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:
@@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -281,13 +281,24 @@ $(function(){
|
||||
// Request Recommendation for Anrechnungen
|
||||
$("#request-recommendation").click(function(){
|
||||
// Get selected rows data
|
||||
let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData')
|
||||
.map(function(data){
|
||||
// reduce to necessary fields
|
||||
return {
|
||||
'anrechnung_id' : data.anrechnung_id,
|
||||
}
|
||||
});
|
||||
let selected_data = $('#tableWidgetTabulator').tabulator('getSelectedData');
|
||||
|
||||
// If some of selected anrechnungen has already been recommended...
|
||||
if (selected_data.some((data) => data.empfehlung_anrechnung !== null))
|
||||
{
|
||||
// ...confirm before requesting recommendation
|
||||
if(!confirm(FHC_PhrasesLib.t("anrechnung", "confirmTextAntragHatBereitsEmpfehlung")))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
selected_data.map(function(data){
|
||||
// reduce to necessary fields
|
||||
return {
|
||||
'anrechnung_id' : data.anrechnung_id,
|
||||
}
|
||||
});
|
||||
|
||||
// Alert and exit if no anrechnung is selected
|
||||
if (selected_data.length == 0)
|
||||
|
||||
@@ -8688,6 +8688,26 @@ Any unusual occurrences
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'anrechnung',
|
||||
'phrase' => 'confirmTextAntragHatBereitsEmpfehlung',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => "Mindestens 1 Antrag enthält bereits eine Empfehlung.\nWollen Sie wirklich für Ihre Auswahl eine Empfehlung anfordern und bereits vorhandene Empfehlungen dabei zurücksetzen?",
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => "At least one application was already recommended.\nDo you really want to request for recommendation for your selection?",
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user