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];
95 $this->participants_status[$a_usr_id][
'passed'] = (int) $a_passed;
97 $query =
"SELECT * FROM crs_members ".
98 "WHERE obj_id = ".$ilDB->quote($this->obj_id,
'integer').
" ".
99 "AND usr_id = ".$ilDB->quote($a_usr_id,
'integer');
103 $query =
"UPDATE crs_members SET ".
104 "passed = ".$ilDB->quote((
int) $a_passed,
'integer').
" ".
105 "WHERE obj_id = ".$ilDB->quote($this->obj_id,
'integer').
" ".
106 "AND usr_id = ".$ilDB->quote($a_usr_id,
'integer');
110 $query =
"INSERT INTO crs_members (passed,obj_id,usr_id,notification,blocked) ".
112 $ilDB->quote((
int) $a_passed,
'integer').
", ".
113 $ilDB->quote($this->obj_id,
'integer').
", ".
114 $ilDB->quote($a_usr_id,
'integer').
", ".
115 $ilDB->quote(0,
'integer').
", ".
116 $ilDB->quote(0,
'integer').
" ".
131 include_once
'./Modules/Course/classes/class.ilCourseMembershipMailNotification.php';
133 global $ilObjDataCache,$ilUser;
137 case $this->NOTIFY_DISMISS_SUBSCRIBER:
140 $mail->setRefId($this->ref_id);
141 $mail->setRecipients(array($a_usr_id));
145 case $this->NOTIFY_ACCEPT_SUBSCRIBER:
148 $mail->setRefId($this->ref_id);
149 $mail->setRecipients(array($a_usr_id));
153 case $this->NOTIFY_DISMISS_MEMBER:
156 $mail->setRefId($this->ref_id);
157 $mail->setRecipients(array($a_usr_id));
161 case $this->NOTIFY_BLOCK_MEMBER:
164 $mail->setRefId($this->ref_id);
165 $mail->setRecipients(array($a_usr_id));
169 case $this->NOTIFY_UNBLOCK_MEMBER:
172 $mail->setRefId($this->ref_id);
173 $mail->setRecipients(array($a_usr_id));
177 case $this->NOTIFY_ACCEPT_USER:
180 $mail->setRefId($this->ref_id);
181 $mail->setRecipients(array($a_usr_id));
185 case $this->NOTIFY_STATUS_CHANGED:
188 $mail->setRefId($this->ref_id);
189 $mail->setRecipients(array($a_usr_id));
193 case $this->NOTIFY_UNSUBSCRIBE:
196 $mail->setRefId($this->ref_id);
197 $mail->setRecipients(array($a_usr_id));
201 case $this->NOTIFY_REGISTERED:
204 $mail->setRefId($this->ref_id);
205 $mail->setRecipients(array($a_usr_id));
209 case $this->NOTIFY_WAITING_LIST:
210 include_once(
'./Modules/Course/classes/class.ilCourseWaitingList.php');
212 $pos = $wl->getPosition($a_usr_id);
216 $mail->setRefId($this->ref_id);
217 $mail->setRecipients(array($a_usr_id));
218 $mail->setAdditionalInformation(array(
'position' =>
$pos));
222 case $this->NOTIFY_SUBSCRIPTION_REQUEST:
226 case $this->NOTIFY_ADMINS:
236 global
$ilDB,$ilObjDataCache;
238 include_once
'./Modules/Course/classes/class.ilCourseMembershipMailNotification.php';
241 $mail->setAdditionalInformation(array(
'usr_id' => $a_usr_id));
242 $mail->setRefId($this->ref_id);
251 global
$ilDB,$ilObjDataCache;
253 include_once
'./Modules/Course/classes/class.ilCourseMembershipMailNotification.php';
256 $mail->setAdditionalInformation(array(
'usr_id' => $a_usr_id));
257 $mail->setRefId($this->ref_id);
266 global
$ilDB,$ilObjDataCache;
268 include_once
'./Modules/Course/classes/class.ilCourseMembershipMailNotification.php';
271 $mail->setAdditionalInformation(array(
'usr_id' => $a_usr_id));
272 $mail->setRefId($this->ref_id);
283 $body = $this->lng->txt(
'crs_status_changed_body').
"\n";
284 $body .= $this->lng->txt(
'login').
': '.$user_obj->getLogin().
"\n";
285 $body .= $this->lng->txt(
'role').
': ';
287 if($this->
isAdmin($user_obj->getId()))
289 $body .= $this->lng->txt(
'crs_admin').
"\n";
291 if($this->
isTutor($user_obj->getId()))
293 $body .= $this->lng->txt(
'crs_tutor').
"\n";
295 if($this->
isMember($user_obj->getId()))
297 $body .= $this->lng->txt(
'crs_member').
"\n";
299 $body .= $this->lng->txt(
'status').
': ';
303 $body .= $this->lng->txt(
"crs_notify").
"\n";
307 $body .= $this->lng->txt(
"crs_no_notify").
"\n";
311 $body .= $this->lng->txt(
"crs_blocked").
"\n";
315 $body .= $this->lng->txt(
"crs_unblocked").
"\n";
317 $passed = $this->
hasPassed($user_obj->getId()) ? $this->lng->txt(
'yes') : $this->lng->txt(
'no');
318 $body .= $this->lng->txt(
'crs_passed').
': '.$passed.
"\n";