24 include_once(
'./Services/Membership/classes/class.ilParticipants.php');
49 $this->NOTIFY_DISMISS_SUBSCRIBER = 1;
50 $this->NOTIFY_ACCEPT_SUBSCRIBER = 2;
51 $this->NOTIFY_DISMISS_MEMBER = 3;
52 $this->NOTIFY_BLOCK_MEMBER = 4;
53 $this->NOTIFY_UNBLOCK_MEMBER = 5;
54 $this->NOTIFY_ACCEPT_USER = 6;
55 $this->NOTIFY_ADMINS = 7;
56 $this->NOTIFY_STATUS_CHANGED = 8;
57 $this->NOTIFY_SUBSCRIPTION_REQUEST = 9;
59 $this->NOTIFY_REGISTERED = 10;
60 $this->NOTIFY_UNSUBSCRIBE = 11;
61 $this->NOTIFY_WAITING_LIST = 12;
76 if(isset(self::$instances[$a_obj_id]) and self::$instances[$a_obj_id])
78 return self::$instances[$a_obj_id];
98 $this->participants_status[$a_usr_id][
'passed'] = (int) $a_passed;
100 $query =
"SELECT * FROM crs_members ".
101 "WHERE obj_id = ".$ilDB->quote($this->obj_id,
'integer').
" ".
102 "AND usr_id = ".$ilDB->quote($a_usr_id,
'integer');
106 $query =
"UPDATE crs_members SET ".
107 "passed = ".$ilDB->quote((
int) $a_passed,
'integer').
" ".
108 "WHERE obj_id = ".$ilDB->quote($this->obj_id,
'integer').
" ".
109 "AND usr_id = ".$ilDB->quote($a_usr_id,
'integer');
113 $query =
"INSERT INTO crs_members (passed,obj_id,usr_id,notification,blocked) ".
115 $ilDB->quote((
int) $a_passed,
'integer').
", ".
116 $ilDB->quote($this->obj_id,
'integer').
", ".
117 $ilDB->quote($a_usr_id,
'integer').
", ".
118 $ilDB->quote(0,
'integer').
", ".
119 $ilDB->quote(0,
'integer').
" ".
134 include_once
'./Modules/Course/classes/class.ilCourseMembershipMailNotification.php';
136 global $ilObjDataCache,$ilUser;
140 case $this->NOTIFY_DISMISS_SUBSCRIBER:
143 $mail->setRefId($this->ref_id);
144 $mail->setRecipients(array($a_usr_id));
148 case $this->NOTIFY_ACCEPT_SUBSCRIBER:
151 $mail->setRefId($this->ref_id);
152 $mail->setRecipients(array($a_usr_id));
156 case $this->NOTIFY_DISMISS_MEMBER:
159 $mail->setRefId($this->ref_id);
160 $mail->setRecipients(array($a_usr_id));
164 case $this->NOTIFY_BLOCK_MEMBER:
167 $mail->setRefId($this->ref_id);
168 $mail->setRecipients(array($a_usr_id));
172 case $this->NOTIFY_UNBLOCK_MEMBER:
175 $mail->setRefId($this->ref_id);
176 $mail->setRecipients(array($a_usr_id));
180 case $this->NOTIFY_ACCEPT_USER:
183 $mail->setRefId($this->ref_id);
184 $mail->setRecipients(array($a_usr_id));
188 case $this->NOTIFY_STATUS_CHANGED:
191 $mail->setRefId($this->ref_id);
192 $mail->setRecipients(array($a_usr_id));
196 case $this->NOTIFY_UNSUBSCRIBE:
199 $mail->setRefId($this->ref_id);
200 $mail->setRecipients(array($a_usr_id));
204 case $this->NOTIFY_REGISTERED:
207 $mail->setRefId($this->ref_id);
208 $mail->setRecipients(array($a_usr_id));
212 case $this->NOTIFY_WAITING_LIST:
213 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
215 $pos = $wl->getPosition($a_usr_id);
219 $mail->setRefId($this->ref_id);
220 $mail->setRecipients(array($a_usr_id));
221 $mail->setAdditionalInformation(array(
'position' => $pos));
225 case $this->NOTIFY_SUBSCRIPTION_REQUEST:
229 case $this->NOTIFY_ADMINS:
239 global
$ilDB,$ilObjDataCache;
241 include_once
'./Modules/Course/classes/class.ilCourseMembershipMailNotification.php';
244 $mail->setAdditionalInformation(array(
'usr_id' => $a_usr_id));
245 $mail->setRefId($this->ref_id);
254 global
$ilDB,$ilObjDataCache;
256 include_once
'./Modules/Course/classes/class.ilCourseMembershipMailNotification.php';
259 $mail->setAdditionalInformation(array(
'usr_id' => $a_usr_id));
260 $mail->setRefId($this->ref_id);
269 global
$ilDB,$ilObjDataCache;
271 include_once
'./Modules/Course/classes/class.ilCourseMembershipMailNotification.php';
274 $mail->setAdditionalInformation(array(
'usr_id' => $a_usr_id));
275 $mail->setRefId($this->ref_id);
286 $body = $this->lng->txt(
'crs_status_changed_body').
"\n";
287 $body .= $this->lng->txt(
'login').
': '.$user_obj->getLogin().
"\n";
288 $body .= $this->lng->txt(
'role').
': ';
290 if($this->
isAdmin($user_obj->getId()))
292 $body .= $this->lng->txt(
'crs_admin').
"\n";
294 if($this->
isTutor($user_obj->getId()))
296 $body .= $this->lng->txt(
'crs_tutor').
"\n";
298 if($this->
isMember($user_obj->getId()))
300 $body .= $this->lng->txt(
'crs_member').
"\n";
302 $body .= $this->lng->txt(
'status').
': ';
306 $body .= $this->lng->txt(
"crs_notify").
"\n";
310 $body .= $this->lng->txt(
"crs_no_notify").
"\n";
314 $body .= $this->lng->txt(
"crs_blocked").
"\n";
318 $body .= $this->lng->txt(
"crs_unblocked").
"\n";
320 $passed = $this->
hasPassed($user_obj->getId()) ? $this->lng->txt(
'yes') : $this->lng->txt(
'no');
321 $body .= $this->lng->txt(
'crs_passed').
': '.$passed.
"\n";