mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
Bugfixed error message when LV has no lectors and only one recommendation is requested
This commit is contained in:
@@ -220,15 +220,12 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
}
|
||||
|
||||
$retval = array();
|
||||
$counter = 0;
|
||||
|
||||
foreach ($data as $item)
|
||||
{
|
||||
// Check if Anrechnungs-LV has lector
|
||||
if (!$this->anrechnunglib->LVhasLector($item['anrechnung_id']))
|
||||
{
|
||||
// Count up LV with no lector
|
||||
$counter++;
|
||||
|
||||
// Check if Anrechnungs-LV has lector
|
||||
if (!$this->anrechnunglib->LVhasLector($anrechnung_id))
|
||||
{
|
||||
$this->terminateWithJsonError('LV has no lector');
|
||||
}
|
||||
|
||||
// Get Fachbereichsleitung or LV Leitung.
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
@@ -274,9 +271,9 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
}
|
||||
|
||||
// Output json to ajax
|
||||
if (isEmptyArray($retval) && $counter > 0)
|
||||
if (isEmptyArray($retval))
|
||||
{
|
||||
return $this->outputJsonError(
|
||||
$this->terminateWithJsonError(
|
||||
"Empfehlung wurde nicht angefordert,\nDer LV sind keine LektorInnen zugeteilt."
|
||||
);
|
||||
}
|
||||
|
||||
@@ -248,9 +248,14 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
}
|
||||
|
||||
// Output json to ajax
|
||||
if (isEmptyArray($retval) && $counter == 0)
|
||||
if (isEmptyArray($retval))
|
||||
{
|
||||
return $this->outputJsonError('Es wurden keine Empfehlungen angefordert');
|
||||
if ($counter > 0)
|
||||
{
|
||||
$this->terminateWithJsonError('Bei '. $counter.' LV sind keine LektorInnen zugeteilt.');
|
||||
}
|
||||
|
||||
$this->terminateWithJsonError('Es wurden keine Empfehlungen angefordert');
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($retval);
|
||||
|
||||
@@ -603,14 +603,14 @@ $(function(){
|
||||
// Print success message
|
||||
FHC_DialogLib.alertSuccess(FHC_PhrasesLib.t("ui", "empfehlungWurdeAngefordert"));
|
||||
}
|
||||
}
|
||||
|
||||
//Update status 'genehmigt'
|
||||
$('#tableWidgetTabulator').tabulator('updateData', data);
|
||||
|
||||
// Deselect rows
|
||||
var indexesToDeselect = data.map(x => x.anrechnung_id);
|
||||
$("#tableWidgetTabulator").tabulator('deselectRow', indexesToDeselect);
|
||||
// Deselect rows
|
||||
var indexesToDeselect = data.map(x => x.anrechnung_id);
|
||||
$("#tableWidgetTabulator").tabulator('deselectRow', indexesToDeselect);
|
||||
}
|
||||
},
|
||||
errorCallback: function (jqXHR, textStatus, errorThrown)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user