19 declare(strict_types=1);
44 $this->
logger = $DIC->logger()->grp();
56 if (isset(self::$instances[$a_obj_id]) && self::$instances[$a_obj_id]) {
57 return self::$instances[$a_obj_id];
69 $rbacreview = $DIC[
'rbacreview'];
71 $lrol = $rbacreview->getRolesOfRoleFolder($a_ref_id,
false);
74 foreach ($lrol as $role) {
76 switch (substr($title, 0, 8)) {
88 public function add(
int $a_usr_id,
int $a_role): bool
99 parent::addSubscriber($a_usr_id);
101 $this->
logger->info(
'Raise new event: Modules/Group addSubscriber.');
102 $this->eventHandler->raise(
103 "components/ILIAS/Group",
107 'usr_id' => $a_usr_id
121 $rbacreview = $DIC->rbac()->review();
122 $local_roles = $rbacreview->getRolesOfRoleFolder($a_ref_id,
false);
123 return $rbacreview->isAssignedToAtLeastOneGivenRole($a_usr_id, $local_roles);
126 public function sendNotification(
int $a_type,
int $a_usr_id,
bool $a_force_sending_mail =
false): void
129 $mail->forceSendingMail($a_force_sending_mail);
135 $mail->setRefId($this->ref_id);
136 $mail->setRecipients(array($a_usr_id));
143 $mail->setRefId($this->ref_id);
144 $mail->setRecipients(array($a_usr_id));
151 $mail->setAdditionalInformation(array(
'usr_id' => $a_usr_id));
152 $mail->setRefId($this->ref_id);
160 $mail->setRefId($this->ref_id);
161 $mail->setRecipients(array($a_usr_id));
168 $mail->setAdditionalInformation(array(
'usr_id' => $a_usr_id));
169 $mail->setRefId($this->ref_id);
177 $mail->setRefId($this->ref_id);
178 $mail->setRecipients(array($a_usr_id));
185 $mail->setAdditionalInformation(array(
'usr_id' => $a_usr_id));
186 $mail->setRefId($this->ref_id);
194 $mail->setRefId($this->ref_id);
195 $mail->setRecipients(array($a_usr_id));
202 $mail->setRefId($this->ref_id);
203 $mail->setRecipients(array($a_usr_id));
210 $pos = $wl->getPosition($a_usr_id);
213 $mail->setRefId($this->ref_id);
214 $mail->setRecipients(array($a_usr_id));
215 $mail->setAdditionalInformation(array(
'position' => $pos));
222 $mail->setRefId($this->ref_id);
223 $mail->setRecipients(array($a_usr_id));
static _isParticipant(int $a_ref_id, int $a_usr_id)
Static function to check if a user is a participant of the container object.
const TYPE_NOTIFICATION_REGISTRATION_REQUEST
const TYPE_NOTIFICATION_UNSUBSCRIBE
add()
description: > Example for rendring an add glyph.
const TYPE_ACCEPTED_SUBSCRIPTION_MEMBER
const TYPE_STATUS_CHANGED
static getMemberRoles(int $a_ref_id)
Get member roles (not auto generated)
const TYPE_SUBSCRIBE_MEMBER
const TYPE_DISMISS_MEMBER
static _getAllReferences(int $id)
get all reference ids for object ID
const TYPE_NOTIFICATION_REGISTRATION
addRecommendation(int $a_usr_id)
Add desktop item public.
const TYPE_WAITING_LIST_MEMBER
__construct(int $a_obj_id)
Constructor.
static _lookupTitle(int $obj_id)
const TYPE_UNSUBSCRIBE_MEMBER
sendNotification(int $a_type, int $a_usr_id, bool $a_force_sending_mail=false)
const TYPE_REFUSED_SUBSCRIPTION_MEMBER
addSubscriber(int $a_usr_id)
add(int $a_usr_id, int $a_role)
Base class for course and group participants.
static _getInstanceByObjId(int $a_obj_id)
Get singleton instance.
__construct(Container $dic, ilPlugin $plugin)
getNotificationRecipients()
Get admin, tutor which have notification enabled.
const TYPE_ADMISSION_MEMBER