mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-23 01:42:17 +00:00
Added sending Sanchomail to student when Anrechnung was approved/rejected
Signed-off-by: cris-technikum <hainberg@technikum-wien.at>
This commit is contained in:
@@ -118,6 +118,11 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
'status_kurzbz' => self::ANRECHNUNGSTATUS_APPROVED,
|
||||
'status_bezeichnung' => $approved
|
||||
);
|
||||
|
||||
if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], $approved))
|
||||
{
|
||||
show_error('Failed sending mail');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,6 +166,11 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
'status_kurzbz' => self::ANRECHNUNGSTATUS_REJECTED,
|
||||
'status_bezeichnung' => $rejected
|
||||
);
|
||||
|
||||
if(!$this->_sendSanchoMailToStudent($item['anrechnung_id'], $rejected))
|
||||
{
|
||||
show_error('Failed sending mail');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,4 +254,33 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
|
||||
/**
|
||||
* Send mail to student to inform if Anrechnung was approved or rejected
|
||||
* @param $mail_params
|
||||
*/
|
||||
private function _sendSanchoMailToStudent($anrechnung_id, $status_bezeichnung)
|
||||
{
|
||||
$result = getData($this->anrechnunglib->getStudentData($anrechnung_id))[0];
|
||||
|
||||
// Get student name and mail address
|
||||
$to = $result->uid. '@'. DOMAIN;
|
||||
|
||||
|
||||
// Prepare mail content
|
||||
$body_fields = array(
|
||||
'vorname' => $result->vorname,
|
||||
'lehrveranstaltung_bezeichnung' => $result->lv_bezeichnung,
|
||||
'status' => $status_bezeichnung
|
||||
);
|
||||
|
||||
sendSanchoMail(
|
||||
'AnrechnungGenehmigen',
|
||||
$body_fields,
|
||||
$to,
|
||||
'Dein Anrechnungsantrag zur LV '. $result->lv_bezeichnung. ' wurde '. $status_bezeichnung
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -177,7 +177,6 @@ class requestAnrechnung extends Auth_Controller
|
||||
|
||||
// Send mail to STGL
|
||||
$mail_params = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $prestudent->studiengang_kz,
|
||||
'lehrveranstaltung_id' => $lehrveranstaltung_id
|
||||
);
|
||||
|
||||
@@ -120,7 +120,10 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
// Output json to ajax
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
{
|
||||
// Send mails to STGL (if not present STGL, send to STGL assistance)
|
||||
/**
|
||||
* Send mails to STGL (if not present STGL, send to STGL assistance)
|
||||
* NOTE: mails are sent at the end to ensure sending only one mail to each STGL
|
||||
* */
|
||||
if (!$this->_sendSanchoMails($json, true))
|
||||
{
|
||||
show_error('Failed sending emails');
|
||||
|
||||
Reference in New Issue
Block a user