3 declare(strict_types=1);
26 parent::__construct(self::COMPONENT_NAME, array_pop($refs));
29 $this->app_event_handler = $app_event_handler;
37 $logger = $DIC[
"ilLoggerFactory"]->getRootLogger();
38 $app_event_handler = $DIC[
'ilAppEventHandler'];
39 $settings = $DIC[
"ilSetting"];
41 if (isset(self::$instances[$obj_id])
and self::$instances[$obj_id]) {
42 return self::$instances[
$obj_id];
57 $rbacreview = $DIC->rbac()->review();
58 $lrol = $rbacreview->getRolesOfRoleFolder(
$ref_id,
false);
61 foreach ($lrol as $role) {
64 switch (substr(
$title, 0, 8)) {
81 $rbacreview = $DIC->rbac()->review();
82 $local_roles = $rbacreview->getRolesOfRoleFolder(
$ref_id,
false);
84 return $rbacreview->isAssignedToAtLeastOneGivenRole($usr_id, $local_roles);
87 public function add($usr_id, $role) : bool
99 parent::addSubscriber($usr_id);
101 $this->log->lso()->info(
'Raise new event: Modules/LearningSequence addSubscriber.');
102 $this->app_event_handler->raise(
103 "Modules/LearningSequence",
118 $mail->forceSendingMail($force_sending_mail);
123 $mail->setRefId($this->ref_id);
124 $mail->setRecipients(array($usr_id));
129 $mail->setRefId($this->ref_id);
130 $mail->setRecipients(array($usr_id));
135 $mail->setAdditionalInformation(array(
'usr_id' => $usr_id));
136 $mail->setRefId($this->ref_id);
142 $mail->setRefId($this->ref_id);
143 $mail->setRecipients(array($usr_id));
148 $mail->setAdditionalInformation(array(
'usr_id' => $usr_id));
149 $mail->setRefId($this->ref_id);
155 $mail->setRefId($this->ref_id);
156 $mail->setRecipients(array($usr_id));
161 $mail->setAdditionalInformation(array(
'usr_id' => $usr_id));
162 $mail->setRefId($this->ref_id);
168 $mail->setRefId($this->ref_id);
169 $mail->setRecipients(array($usr_id));
174 $mail->setRefId($this->ref_id);
175 $mail->setRecipients(array($usr_id));
180 $mail->setRefId($this->ref_id);
181 $mail->setRecipients(array($usr_id));
getObjId()
get current obj_id
const TYPE_STATUS_CHANGED
addDesktopItem($a_usr_id)
Add desktop item.
static _getInstanceByObjId(int $obj_id)
const TYPE_NOTIFICATION_UNSUBSCRIBE
const TYPE_ACCEPTED_SUBSCRIPTION_MEMBER
const TYPE_DISMISS_MEMBER
static _isParticipant($ref_id, $usr_id)
const TYPE_REFUSED_SUBSCRIPTION_MEMBER
static _lookupTitle($a_id)
lookup object title
static _getAllReferences($a_id)
get all reference ids of object
const TYPE_ADMISSION_MEMBER
const TYPE_SUBSCRIBE_MEMBER
sendNotification($type, $usr_id, $force_sending_mail=false)
Send notification mail.
__construct(int $obj_id, ilLogger $logger, ilAppEventHandler $app_event_handler, ilSetting $settings)
const TYPE_NOTIFICATION_REGISTRATION_REQUEST
getNotificationRecipients()
Get admin, tutor which have notification enabled.
const TYPE_UNSUBSCRIBE_MEMBER
Component logger with individual log levels by component id.
static getMemberRoles($ref_id)
const TYPE_NOTIFICATION_REGISTRATION