mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-25 00:24:35 +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);
|
||||
|
||||
Reference in New Issue
Block a user