diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php index 8f71dc8d0..3a62ff7d9 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungDetail.php @@ -242,7 +242,7 @@ class approveAnrechnungDetail extends Auth_Controller $empfehlungsanfrage_an = !isEmptyArray($result) ? implode(', ', array_column($result, 'fullname')) : ''; // Request Recommendation - if($this->anrechnunglib->requestRecommendation($anrechnung_id)) + if ($this->anrechnunglib->requestRecommendation($anrechnung_id)) { $retval[]= array( 'anrechnung_id' => $anrechnung_id, @@ -254,31 +254,23 @@ class approveAnrechnungDetail extends Auth_Controller ); } - /** - * Send mails to lectors - * NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector - * even if they are required for more recommendations - * */ - if (!isEmptyArray($retval)) - { - if ($this->config->item('send_mail') === TRUE) - { - $this->_sendSanchoMailToLectors($anrechnung_id); - } - - // Output json to ajax - return $this->outputJsonSuccess($retval); - } - // Output json to ajax + if ($empfehlungsanfrage_an == '') + { + $this->terminateWithJsonError( + "Empfehlung wurde nicht angefordert,\nDer LV sind keine LektorInnen zugeteilt." + ); + } + if (isEmptyArray($retval)) { - $this->terminateWithJsonError( - "Empfehlung wurde nicht angefordert,\nDer LV sind keine LektorInnen zugeteilt." - ); + $this->terminateWithJsonError("Empfehlung wurde nicht angefordert"); } - - $this->terminateWithJsonError($this->p->t('ui', 'errorNichtAusgefuehrt')); + else + { + // Output json to ajax + return $this->outputJsonSuccess($retval); + } } /** diff --git a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php index f13814e66..b5a44b8f6 100644 --- a/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php +++ b/application/controllers/lehre/anrechnung/ApproveAnrechnungUebersicht.php @@ -249,19 +249,6 @@ class approveAnrechnungUebersicht extends Auth_Controller } } - /** - * Send mails - * NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector - * even if they are required for more recommendations - * */ - if (!isEmptyArray($retval)) - { - if ($this->config->item('send_mail') === TRUE) - { - $this->_sendSanchoMail($retval); - } - } - // Output json to ajax if (isEmptyArray($retval)) { @@ -273,7 +260,7 @@ class approveAnrechnungUebersicht extends Auth_Controller $this->terminateWithJsonError('Es wurden keine Empfehlungen angefordert'); } - return $this->outputJsonSuccess($retval); + $this->outputJsonSuccess($retval); } /**