From 7afbf21e675de089eb1444f5307c3b6742642afc Mon Sep 17 00:00:00 2001 From: Angel Fernando Quiroz Campos Date: Tue, 3 Mar 2015 11:20:15 -0500 Subject: [PATCH] Indicate whether the mail must be sent on CourseLegal plugin - refs BT#9461 --- plugin/courselegal/CourseLegalPlugin.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugin/courselegal/CourseLegalPlugin.php b/plugin/courselegal/CourseLegalPlugin.php index bd04b17a97..2ba254f78b 100755 --- a/plugin/courselegal/CourseLegalPlugin.php +++ b/plugin/courselegal/CourseLegalPlugin.php @@ -111,10 +111,10 @@ class CourseLegalPlugin extends Plugin * @param int $userId * @param int $courseCode * @param int $sessionId - * + * @param boolean $sendEmail Optional. Indicate whether the mail must be sent. Default is true * @return bool */ - public function saveUserLegal($userId, $courseCode, $sessionId) + public function saveUserLegal($userId, $courseCode, $sessionId, $sendEmail = true) { $courseInfo = api_get_course_info($courseCode); $courseId = $courseInfo['real_id']; @@ -136,7 +136,9 @@ class CourseLegalPlugin extends Plugin ); $id = Database::insert($table, $values); - $this->sendMailLink($uniqueId, $userId, $courseId, $sessionId); + if ($sendEmail) { + $this->sendMailLink($uniqueId, $userId, $courseId, $sessionId); + } } return $id;