ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilGroupParticipants Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Inheritance diagram for ilGroupParticipants:
+ Collaboration diagram for ilGroupParticipants:

Public Member Functions

 __construct (int $a_obj_id)
 Constructor. More...
 
 add (int $a_usr_id, int $a_role)
 
 addSubscriber (int $a_usr_id)
 
 sendNotification (int $a_type, int $a_usr_id, bool $a_force_sending_mail=false)
 
- Public Member Functions inherited from ilParticipants
 __construct (string $a_component_name, int $a_ref_id)
 
 getObjId ()
 
 getType ()
 
 getNotificationRecipients ()
 Get admin, tutor which have notification enabled. More...
 
 getCountMembers ()
 Get number of members (not participants) More...
 
 getCountParticipants ()
 Get number of participants. More...
 
 getParticipants ()
 Get all participants ids. More...
 
 getMembers ()
 Get all members ids (admins and tutors are not members) Use get participants to fetch all. More...
 
 getAdmins ()
 Get all admins ids. More...
 
 getCountAdmins ()
 
 getTutors ()
 Get all tutors ids. More...
 
 isAdmin (int $a_usr_id)
 check if user is admin More...
 
 isTutor (int $a_usr_id)
 is user tutor More...
 
 isMember (int $a_usr_id)
 is user member More...
 
 isAssigned (int $a_usr_id)
 check if user is assigned More...
 
 isLastAdmin (int $a_usr_id)
 Check if user is last admin. More...
 
 getRoles ()
 Get object roles. More...
 
 getAssignedRoles (int $a_usr_id)
 Get assigned roles. More...
 
 updateRoleAssignments ($a_usr_id, $a_roles)
 Update role assignments public. More...
 
 checkLastAdmin (array $a_usr_ids)
 Check if users for deletion are last admins public. More...
 
 isBlocked (int $a_usr_id)
 Check if user is blocked. More...
 
 hasPassed (int $a_usr_id)
 Check if user has passed object. More...
 
 delete (int $a_usr_id)
 Drop user from all roles. More...
 
 updateBlocked (int $a_usr_id, bool $a_blocked)
 Update blocked status. More...
 
 updateContact (int $a_usr_id, bool $a_contact)
 
 getContacts ()
 get user ids which are confirgured as contact More...
 
 updateNotification (int $a_usr_id, bool $a_notification)
 Update notification status. More...
 
 add (int $a_usr_id, int $a_role)
 
 deleteParticipants (array $a_user_ids)
 
 addRecommendation (int $a_usr_id)
 Add desktop item public. More...
 
 isNotificationEnabled (int $a_usr_id)
 
 isContact (int $a_usr_id)
 
 getAutoGeneratedRoleId (int $a_role_type)
 
 isGroupingMember (int $a_usr_id, string $a_field='')
 Check membership for. More...
 
 getSubscribers ()
 get all subscribers int[] More...
 
 getCountSubscribers ()
 
 getSubscriberData (int $a_usr_id)
 
 assignSubscribers (array $a_usr_ids)
 
 assignSubscriber (int $a_usr_id)
 
 autoFillSubscribers ()
 
 addSubscriber (int $a_usr_id)
 
 updateSubscriptionTime (int $a_usr_id, int $a_subtime)
 
 updateSubject (int $a_usr_id, string $a_subject)
 
 deleteSubscriber (int $a_usr_id)
 
 deleteSubscribers (array $a_usr_ids)
 
 isSubscriber (int $a_usr_id)
 
 setRoleOrderPosition (int $a_user_id)
 Set role order position. More...
 

Static Public Member Functions

static _getInstanceByObjId (int $a_obj_id)
 Get singleton instance. More...
 
static getMemberRoles (int $a_ref_id)
 Get member roles (not auto generated) More...
 
static _isParticipant (int $a_ref_id, int $a_usr_id)
 Static function to check if a user is a participant of the container object. More...
 
- Static Public Member Functions inherited from ilParticipants
static getInstance (int $a_ref_id)
 
static getInstanceByObjId (int $a_obj_id)
 Get instance by obj type. More...
 
static hasParticipantListAccess (int $a_obj_id, int $a_usr_id=null)
 Check if (current) user has access to the participant list. More...
 
static canSendMailToMembers ( $ref_id_or_instance, ?int $usr_id=null, ?int $mail_obj_ref_id=null)
 This method was introduced as a band-aid fix for #22764. More...
 
static getUserMembershipAssignmentsByType (array $a_user_ids, array $a_type, bool $a_only_member_roles)
 Get user membership assignments by type. More...
 
static _getMembershipByType (int $a_usr_id, array $a_type, bool $a_only_member_role=false)
 get membership by type Get course or group membership More...
 
static _isParticipant (int $a_ref_id, int $a_usr_id)
 Static function to check if a user is a participant of the container object. More...
 
static lookupNumberOfParticipants (int $a_ref_id)
 Lookup the number of participants (crs admins, tutors, members, grp admins, members) More...
 
static lookupNumberOfMembers (int $a_ref_id)
 Lookup number of members. More...
 
static _isBlocked (int $a_obj_id, int $a_usr_id)
 Check if user is blocked. More...
 
static _hasPassed (int $a_obj_id, int $a_usr_id)
 Check if user has passed course. More...
 
static _deleteAllEntries (int $a_obj_id)
 Delete all entries Normally called in case of object deletion. More...
 
static _deleteUser (int $a_usr_id)
 Delete user data. More...
 
static getDefaultMemberRole (int $a_ref_id)
 
static lookupSubscribers (int $a_obj_id)
 
static _isSubscriber (int $a_obj_id, int $a_usr_id)
 
static lookupSubscribersData (int $a_obj_id)
 
static _getAllSupportContactsOfUser (int $a_usr_id, string $a_type)
 Get all support contacts for a user. More...
 

Protected Attributes

const COMPONENT_NAME = 'Modules/Group'
 
- Protected Attributes inherited from ilParticipants
string $component = ''
 
int $ref_id = 0
 
int $obj_id = 0
 
string $type = ''
 
array $roles = []
 
array $role_data = []
 
array $roles_sorted = []
 
array $role_assignments = []
 
array $participants = []
 
array $participants_status = []
 
array $members = []
 
array $tutors = []
 
array $admins = []
 
array $subscribers = []
 
ilAppEventHandler $eventHandler
 
ilRbacReview $rbacReview
 
ilRbacAdmin $rbacAdmin
 
ilObjectDataCache $objectDataCache
 
ilDBInterface $ilDB
 
ilLanguage $lng
 
ilLogger $logger
 
ilErrorHandling $error
 
ilRecommendedContentManager $recommended_content_manager
 

Static Protected Attributes

static array $instances = []
 

Additional Inherited Members

- Data Fields inherited from ilParticipants
const IL_CRS_ADMIN = 1
 
const IL_CRS_TUTOR = 3
 
const IL_CRS_MEMBER = 2
 
const IL_GRP_ADMIN = 4
 
const IL_GRP_MEMBER = 5
 
const IL_SESS_MEMBER = 6
 
const IL_LSO_ADMIN = 7
 
const IL_LSO_MEMBER = 8
 
const IL_ROLE_POSITION_ADMIN = 1
 
const IL_ROLE_POSITION_TUTOR = 2
 
const IL_ROLE_POSITION_MEMBER = 3
 
- Protected Member Functions inherited from ilParticipants
 getComponent ()
 Get component name Used for raising events. More...
 
 readParticipants ()
 
 readParticipantsStatus ()
 Read status of participants (blocked, notification, passed) More...
 
 readSubscribers ()
 
 readSubscriberData (int $a_usr_id)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 31 of file class.ilGroupParticipants.php.

Constructor & Destructor Documentation

◆ __construct()

ilGroupParticipants::__construct ( int  $a_obj_id)

Constructor.

protected

Parameters
intobj_id of container

Definition at line 43 of file class.ilGroupParticipants.php.

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilObject\_getAllReferences(), and ILIAS\Repository\logger().

44  {
45  global $DIC;
46 
47  $this->logger = $DIC->logger()->grp();
48 
49  // ref based constructor
50  $refs = ilObject::_getAllReferences($a_obj_id);
51  parent::__construct(self::COMPONENT_NAME, array_pop($refs));
52  }
static _getAllReferences(int $id)
get all reference ids for object ID
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstanceByObjId()

static ilGroupParticipants::_getInstanceByObjId ( int  $a_obj_id)
static

Get singleton instance.

Definition at line 57 of file class.ilGroupParticipants.php.

Referenced by ilGroupXMLWriter\__construct(), ilGroupEditParticipantsTableGUI\__construct(), ilObjCourseGrouping\_checkGroupingDependencies(), ilCourseParticipantsGroupsGUI\add(), ilObjGroupGUI\afterSave(), ilPortfolioAccessHandler\checkAccessOfUser(), ilWorkspaceAccessHandler\checkAccessOfUser(), ilGroupMembershipMailNotification\createGroupStatus(), ilParticipants\getInstanceByObjId(), ilGroupLP\getMembers(), ilLPStatusCollection\getMembers(), ilNotification\getNotificationsForObject(), ilMembershipNotifications\getParticipants(), ilForumSettingsGUI\getParticipants(), ilMilestoneResponsiblesTableGUI\getParticipantsAndResponsibles(), ilBadgeHandler\getUserIds(), ilSoapGroupAdministration\groupExists(), ilObjSessionGUI\initContainer(), ilCourseParticipantsGroupsTableGUI\initGroups(), ilMemberExport\initGroups(), ilMemberExport\initMembers(), ilGroupRegistrationGUI\initParticipants(), ilObjGroup\initParticipants(), ilLPStatusCollection\isMember(), ilObjGroupGUI\leaveObject(), ilObjGroupAccess\lookupRegistrationInfo(), ilGroupParticipantsTableGUI\parse(), ilObjGroup\read(), ilECSCmsCourseMemberCommandQueueHandler\refreshAssignmentStatus(), ilObjGroup\register(), and ilCourseParticipantsGroupsGUI\remove().

58  {
59  if (isset(self::$instances[$a_obj_id]) && self::$instances[$a_obj_id]) {
60  return self::$instances[$a_obj_id];
61  }
62  return self::$instances[$a_obj_id] = new ilGroupParticipants($a_obj_id);
63  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ _isParticipant()

static ilGroupParticipants::_isParticipant ( int  $a_ref_id,
int  $a_usr_id 
)
static

Static function to check if a user is a participant of the container object.

Definition at line 120 of file class.ilGroupParticipants.php.

References $DIC.

Referenced by ilObjGroupAccess\_checkAccess(), ilStartUpGUI\_checkGoto(), ilObjGroupGUI\getTabs(), ilNotification\hasNotification(), and ilObjGroupGUI\initHeaderAction().

120  : bool
121  {
122  global $DIC;
123 
124  $rbacreview = $DIC->rbac()->review();
125  $local_roles = $rbacreview->getRolesOfRoleFolder($a_ref_id, false);
126  return $rbacreview->isAssignedToAtLeastOneGivenRole($a_usr_id, $local_roles);
127  }
global $DIC
Definition: feed.php:28
+ Here is the caller graph for this function:

◆ add()

ilGroupParticipants::add ( int  $a_usr_id,
int  $a_role 
)

Definition at line 91 of file class.ilGroupParticipants.php.

References ILIAS\UI\examples\Symbol\Glyph\Add\add(), and ilParticipants\addRecommendation().

Referenced by ilGroupXMLParser\assignMembers().

91  : bool
92  {
93  if (parent::add($a_usr_id, $a_role)) {
94  $this->addRecommendation($a_usr_id);
95  return true;
96  }
97  return false;
98  }
addRecommendation(int $a_usr_id)
Add desktop item public.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSubscriber()

ilGroupParticipants::addSubscriber ( int  $a_usr_id)

Definition at line 100 of file class.ilGroupParticipants.php.

References ilParticipants\getObjId(), and ILIAS\Repository\logger().

100  : void
101  {
102  parent::addSubscriber($a_usr_id);
103 
104  $this->logger->info('Raise new event: Modules/Group addSubscriber.');
105  $this->eventHandler->raise(
106  "Modules/Group",
107  'addSubscriber',
108  array(
109  'obj_id' => $this->getObjId(),
110  'usr_id' => $a_usr_id
111  )
112  );
113  }
+ Here is the call graph for this function:

◆ getMemberRoles()

static ilGroupParticipants::getMemberRoles ( int  $a_ref_id)
static

Get member roles (not auto generated)

Definition at line 68 of file class.ilGroupParticipants.php.

References $DIC, ilParticipants\$roles, and ilObject\_lookupTitle().

68  : array
69  {
70  global $DIC;
71 
72  $rbacreview = $DIC['rbacreview'];
73 
74  $lrol = $rbacreview->getRolesOfRoleFolder($a_ref_id, false);
75 
76  $roles = array();
77  foreach ($lrol as $role) {
78  $title = ilObject::_lookupTitle($role);
79  switch (substr($title, 0, 8)) {
80  case 'il_grp_a':
81  case 'il_grp_m':
82  continue 2;
83 
84  default:
85  $roles[$role] = $role;
86  }
87  }
88  return $roles;
89  }
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
+ Here is the call graph for this function:

◆ sendNotification()

ilGroupParticipants::sendNotification ( int  $a_type,
int  $a_usr_id,
bool  $a_force_sending_mail = false 
)

Definition at line 129 of file class.ilGroupParticipants.php.

References ilParticipants\getNotificationRecipients(), ilGroupMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, ilGroupMembershipMailNotification\TYPE_ADMISSION_MEMBER, ilGroupMembershipMailNotification\TYPE_DISMISS_MEMBER, ilGroupMembershipMailNotification\TYPE_NOTIFICATION_REGISTRATION, ilGroupMembershipMailNotification\TYPE_NOTIFICATION_REGISTRATION_REQUEST, ilGroupMembershipMailNotification\TYPE_NOTIFICATION_UNSUBSCRIBE, ilGroupMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER, ilGroupMembershipMailNotification\TYPE_STATUS_CHANGED, ilGroupMembershipMailNotification\TYPE_SUBSCRIBE_MEMBER, ilGroupMembershipMailNotification\TYPE_UNSUBSCRIBE_MEMBER, and ilGroupMembershipMailNotification\TYPE_WAITING_LIST_MEMBER.

129  : void
130  {
131  $mail = new ilGroupMembershipMailNotification();
132  $mail->forceSendingMail($a_force_sending_mail);
133 
134  switch ($a_type) {
136 
138  $mail->setRefId($this->ref_id);
139  $mail->setRecipients(array($a_usr_id));
140  $mail->send();
141  break;
142 
144 
146  $mail->setRefId($this->ref_id);
147  $mail->setRecipients(array($a_usr_id));
148  $mail->send();
149  break;
150 
152 
154  $mail->setAdditionalInformation(array('usr_id' => $a_usr_id));
155  $mail->setRefId($this->ref_id);
156  $mail->setRecipients($this->getNotificationRecipients());
157  $mail->send();
158  break;
159 
161 
163  $mail->setRefId($this->ref_id);
164  $mail->setRecipients(array($a_usr_id));
165  $mail->send();
166  break;
167 
169 
171  $mail->setAdditionalInformation(array('usr_id' => $a_usr_id));
172  $mail->setRefId($this->ref_id);
173  $mail->setRecipients($this->getNotificationRecipients());
174  $mail->send();
175  break;
176 
178 
180  $mail->setRefId($this->ref_id);
181  $mail->setRecipients(array($a_usr_id));
182  $mail->send();
183  break;
184 
186 
188  $mail->setAdditionalInformation(array('usr_id' => $a_usr_id));
189  $mail->setRefId($this->ref_id);
190  $mail->setRecipients($this->getNotificationRecipients());
191  $mail->send();
192  break;
193 
195 
197  $mail->setRefId($this->ref_id);
198  $mail->setRecipients(array($a_usr_id));
199  $mail->send();
200  break;
201 
203 
205  $mail->setRefId($this->ref_id);
206  $mail->setRecipients(array($a_usr_id));
207  $mail->send();
208  break;
209 
211 
212  $wl = new ilGroupWaitingList($this->obj_id);
213  $pos = $wl->getPosition($a_usr_id);
214 
216  $mail->setRefId($this->ref_id);
217  $mail->setRecipients(array($a_usr_id));
218  $mail->setAdditionalInformation(array('position' => $pos));
219  $mail->send();
220  break;
221 
223 
225  $mail->setRefId($this->ref_id);
226  $mail->setRecipients(array($a_usr_id));
227  $mail->send();
228  break;
229 
230 
231  }
232  }
Waiting list for groups.
getNotificationRecipients()
Get admin, tutor which have notification enabled.
+ Here is the call graph for this function:

Field Documentation

◆ $instances

array ilGroupParticipants::$instances = []
staticprotected

Definition at line 35 of file class.ilGroupParticipants.php.

◆ COMPONENT_NAME

const ilGroupParticipants::COMPONENT_NAME = 'Modules/Group'
protected

Definition at line 33 of file class.ilGroupParticipants.php.


The documentation for this class was generated from the following file: