From 73e8d4d6e2fdab11dae54e655381956e60dbbda8 Mon Sep 17 00:00:00 2001 From: Ali Date: Mon, 6 May 2024 08:59:54 +0800 Subject: [PATCH] Admissions: Changed the string of the withdraw notification when a student is going to withdraw in the future --- .../Admissions/student_withdrawProcess.php | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/modules/Admissions/student_withdrawProcess.php b/modules/Admissions/student_withdrawProcess.php index 9e5b4f3bd8..6838721ebf 100644 --- a/modules/Admissions/student_withdrawProcess.php +++ b/modules/Admissions/student_withdrawProcess.php @@ -106,13 +106,24 @@ if (!empty($notify) || !empty($notificationList)) { // Create the notification body $studentName = Format::name('', $student['preferredName'], $student['surname'], 'Student', false, true); - $notificationString = __('{student} {formGroup} has withdrawn from {school} on {date}.', [ - 'student' => $studentName, - 'formGroup' => $student['formGroup'], - 'school' => $session->get('organisationNameShort'), - 'date' => Format::date($data['dateEnd']), - ]); - + + $today = date("Y-m-d"); + if ($today > $data['dateEnd']) { + $notificationString = __('{student} {formGroup} has withdrawn from {school} on {date}.', [ + 'student' => $studentName, + 'formGroup' => $student['formGroup'], + 'school' => $session->get('organisationNameShort'), + 'date' => Format::date($data['dateEnd']), + ]); + } else { + $notificationString = __('{student} {formGroup} will withdraw from {school}, effective from {date}.', [ + 'student' => $studentName, + 'formGroup' => $student['formGroup'], + 'school' => $session->get('organisationNameShort'), + 'date' => Format::date($data['dateEnd']), + ]); + } + if (!empty($withdrawNote)) { $notificationString .= '

'.__('Withdraw Note').': '.$withdrawNote; }