ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilLearningSequenceParticipants Class Reference

Manage participants. More...

+ Inheritance diagram for ilLearningSequenceParticipants:
+ Collaboration diagram for ilLearningSequenceParticipants:

Public Member Functions

 __construct (int $obj_id, ilLogger $logger, ilAppEventHandler $app_event_handler, ilSetting $settings)
 
 add ($usr_id, $role)
 
 addSubscriber ($usr_id)
 
 sendNotification ($type, $usr_id, $force_sending_mail=false)
 Send notification mail. More...
 
- Public Member Functions inherited from ilParticipants
 __construct ($a_component_name, $a_ref_id)
 Singleton Constructor. More...
 
 getObjId ()
 get current obj_id More...
 
 getType ()
 Get object type. More...
 
 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 ()
 Get number of admins. More...
 
 getTutors ()
 Get all tutors ids. More...
 
 isAdmin ($a_usr_id)
 is user admin More...
 
 isTutor ($a_usr_id)
 is user tutor More...
 
 isMember ($a_usr_id)
 is user member More...
 
 isAssigned ($a_usr_id)
 check if user is assigned More...
 
 isLastAdmin ($a_usr_id)
 Check if user is last admin. More...
 
 getRoles ()
 Get course roles. More...
 
 getAssignedRoles ($a_usr_id)
 Get assigned roles. More...
 
 updateRoleAssignments ($a_usr_id, $a_roles)
 Update role assignments. More...
 
 checkLastAdmin ($a_usr_ids)
 Check if user for deletion are last admins. More...
 
 isBlocked ($a_usr_id)
 Check if user is blocked. More...
 
 hasPassed ($a_usr_id)
 Check if user has passed course. More...
 
 delete ($a_usr_id)
 Drop user from all roles. More...
 
 updateBlocked ($a_usr_id, $a_blocked)
 Update blocked status. More...
 
 updateContact ($a_usr_id, $a_contact)
 Update contact setting type $ilDB. More...
 
 getContacts ()
 get user ids which are confirgured as contact More...
 
 updateNotification ($a_usr_id, $a_notification)
 Update notification status. More...
 
 add ($a_usr_id, $a_role)
 Add user to object. More...
 
 deleteParticipants ($a_user_ids)
 Delete users. More...
 
 addDesktopItem ($a_usr_id)
 Add desktop item. More...
 
 dropDesktopItem ($a_usr_id)
 Drop desktop item. More...
 
 isNotificationEnabled ($a_usr_id)
 check if notification is enabled More...
 
 isContact ($a_usr_id)
 Check if user is contact. More...
 
 getAutoGeneratedRoleId ($a_role_type)
 Get role id of auto generated role type. More...
 
 isGroupingMember ($a_usr_id, $a_field='')
 Check grouping membership. More...
 
 getSubscribers ()
 get all subscribers More...
 
 getCountSubscribers ()
 get number of subscribers More...
 
 getSubscriberData ($a_usr_id)
 get subscriber data More...
 
 assignSubscribers ($a_usr_ids)
 Assign subscribers. More...
 
 assignSubscriber ($a_usr_id)
 Assign subscriber. More...
 
 autoFillSubscribers ()
 Assign subscriber. More...
 
 addSubscriber ($a_usr_id)
 Add subscriber. More...
 
 updateSubscriptionTime ($a_usr_id, $a_subtime)
 Update subscription time. More...
 
 updateSubject ($a_usr_id, $a_subject)
 update subject More...
 
 deleteSubscriber ($a_usr_id)
 Delete subsciber. More...
 
 deleteSubscribers ($a_usr_ids)
 Delete subscibers. More...
 
 isSubscriber ($a_usr_id)
 check if is subscriber More...
 
 setRoleOrderPosition ($a_user_id)
 Set role order position. More...
 

Static Public Member Functions

static _getInstanceByObjId (int $obj_id)
 
static getMemberRoles ($ref_id)
 
static _isParticipant ($ref_id, $usr_id)
 
- Static Public Member Functions inherited from ilParticipants
static getInstance ($a_ref_id)
 Get instance by ref_id. More...
 
static getInstanceByObjId ($a_obj_id)
 Get instance by obj type. More...
 
static hasParticipantListAccess ($a_obj_id, $a_usr_id=null)
 Check if (current) user has access to the participant list. More...
 
static getUserMembershipAssignmentsByType ($a_user_ids, $a_type, $a_only_member_roles)
 Get user membership assignments by type. More...
 
static _getMembershipByType ($a_usr_id, $a_type, $a_only_member_role=false)
 get membership by type Get course or group membership More...
 
static _isParticipant ($a_ref_id, $a_usr_id)
 Static function to check if a user is a participant of the container object. More...
 
static lookupNumberOfParticipants ($a_ref_id)
 Lookup the number of participants (crs admins, tutors, members, grp admins, members) More...
 
static lookupNumberOfMembers ($a_ref_id)
 Lookup number of members ilRbacReview $rbacreview <type> $ilObjDataCache. More...
 
static _isBlocked ($a_obj_id, $a_usr_id)
 Check if user is blocked. More...
 
static _hasPassed ($a_obj_id, $a_usr_id)
 Check if user has passed course. More...
 
static _deleteAllEntries ($a_obj_id)
 Delete all entries Normally called for course deletion. More...
 
static _deleteUser ($a_usr_id)
 Delete user data. More...
 
static getDefaultMemberRole ($a_ref_id)
 
static lookupSubscribers ($a_obj_id)
 
static _isSubscriber ($a_obj_id, $a_usr_id)
 check if user is subscriber More...
 
static lookupSubscribersData ($a_obj_id)
 
static _getAllSupportContactsOfUser ($a_usr_id, $a_type)
 Get all support contacts for a user. More...
 

Data Fields

const COMPONENT_NAME = 'Modules/LearningSequence'
 

Static Protected Attributes

static $instances
 

Additional Inherited Members

- Protected Member Functions inherited from ilParticipants
 getComponent ()
 Get component name Used for raising events. More...
 
 readParticipants ()
 Read participants. More...
 
 readParticipantsStatus ()
 Read status of participants (blocked, notification, passed) More...
 
 readSubscribers ()
 read subscribers More...
 
 readSubscriberData ($a_usr_id)
 read subscribers More...
 
- Protected Attributes inherited from ilParticipants
 $component = ''
 
 $obj_id = 0
 
 $type = ''
 
 $ref_id = 0
 
 $roles = array()
 
 $role_data = array()
 
 $roles_sorted = []
 
 $role_assignments = []
 
 $participants = array()
 
 $participants_status = array()
 
 $members = array()
 
 $tutors = array()
 
 $admins = array()
 
 $subscribers = array()
 
 $ilDB
 
 $lng
 
 $logger = null
 

Detailed Description

Manage participants.

Author
Daniel Weise danie.nosp@m.l.we.nosp@m.ise@c.nosp@m.once.nosp@m.pts-a.nosp@m.nd-t.nosp@m.raini.nosp@m.ng.d.nosp@m.e (refactor to psr-12 as far as possible)

Definition at line 10 of file class.ilLearningSequenceParticipants.php.

Constructor & Destructor Documentation

◆ __construct()

ilLearningSequenceParticipants::__construct ( int  $obj_id,
ilLogger  $logger,
ilAppEventHandler  $app_event_handler,
ilSetting  $settings 
)

Definition at line 19 of file class.ilLearningSequenceParticipants.php.

References ilParticipants\$logger, ilObject\_getAllReferences(), and settings().

24  {
26  parent::__construct(self::COMPONENT_NAME, array_pop($refs));
27 
28  $this->logger = $logger;
29  $this->app_event_handler = $app_event_handler;
30  $this->settings = $settings;
31  }
settings()
Definition: settings.php:2
static _getAllReferences($a_id)
get all reference ids of object
+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstanceByObjId()

static ilLearningSequenceParticipants::_getInstanceByObjId ( int  $obj_id)
static

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

References $DIC, ilParticipants\$logger, and ilParticipants\$obj_id.

Referenced by ilLearningSequenceMembershipMailNotification\createLearningSequenceStatus(), ilParticipants\getInstanceByObjId(), and ilLPStatusCollection\getMembers().

34  {
35  global $DIC;
36 
37  $logger = $DIC["ilLoggerFactory"]->getRootLogger();
38  $app_event_handler = $DIC['ilAppEventHandler'];
39  $settings = $DIC["ilSetting"];
40 
41  if (isset(self::$instances[$obj_id]) and self::$instances[$obj_id]) {
42  return self::$instances[$obj_id];
43  }
44 
45  return self::$instances[$obj_id] = new ilLearningSequenceParticipants(
46  $obj_id,
47  $logger,
48  $app_event_handler,
49  $settings
50  );
51  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ _isParticipant()

static ilLearningSequenceParticipants::_isParticipant (   $ref_id,
  $usr_id 
)
static

Definition at line 77 of file class.ilLearningSequenceParticipants.php.

References $DIC, and ilParticipants\$ref_id.

Referenced by ilObjLearningSequenceGUI\checkLPAccess().

77  : bool
78  {
79  global $DIC;
80 
81  $rbacreview = $DIC->rbac()->review();
82  $local_roles = $rbacreview->getRolesOfRoleFolder($ref_id, false);
83 
84  return $rbacreview->isAssignedToAtLeastOneGivenRole($usr_id, $local_roles);
85  }
global $DIC
Definition: saml.php:7
+ Here is the caller graph for this function:

◆ add()

ilLearningSequenceParticipants::add (   $usr_id,
  $role 
)

Definition at line 87 of file class.ilLearningSequenceParticipants.php.

References add(), and ilParticipants\addDesktopItem().

Referenced by ilObjLearningSequenceGUI\afterSave().

87  : bool
88  {
89  if (parent::add($usr_id, $role)) {
90  $this->addDesktopItem($usr_id);
91  return true;
92  }
93 
94  return false;
95  }
addDesktopItem($a_usr_id)
Add desktop item.
add()
Definition: add.php:2
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSubscriber()

ilLearningSequenceParticipants::addSubscriber (   $usr_id)

Definition at line 97 of file class.ilLearningSequenceParticipants.php.

References ilParticipants\getObjId().

98  {
99  parent::addSubscriber($usr_id);
100 
101  $this->log->lso()->info('Raise new event: Modules/LearningSequence addSubscriber.');
102  $this->app_event_handler->raise(
103  "Modules/LearningSequence",
104  'addSubscriber',
105  array(
106  'obj_id' => $this->getObjId(),
107  'usr_id' => $usr_id
108  )
109  );
110  }
getObjId()
get current obj_id
+ Here is the call graph for this function:

◆ getMemberRoles()

static ilLearningSequenceParticipants::getMemberRoles (   $ref_id)
static

Definition at line 53 of file class.ilLearningSequenceParticipants.php.

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

53  : array
54  {
55  global $DIC;
56 
57  $rbacreview = $DIC->rbac()->review();
58  $lrol = $rbacreview->getRolesOfRoleFolder($ref_id, false);
59 
60  $roles = array();
61  foreach ($lrol as $role) {
63 
64  switch (substr($title, 0, 8)) {
65  case 'il_lso_a':
66  case 'il_lso_m':
67  $roles[$role] = $role;
68  // no break
69  default:
70  break;
71  }
72  }
73 
74  return $roles;
75  }
global $DIC
Definition: saml.php:7
static _lookupTitle($a_id)
lookup object title
+ Here is the call graph for this function:

◆ sendNotification()

ilLearningSequenceParticipants::sendNotification (   $type,
  $usr_id,
  $force_sending_mail = false 
)

Send notification mail.

Definition at line 115 of file class.ilLearningSequenceParticipants.php.

References ilParticipants\$type, ilParticipants\getNotificationRecipients(), settings(), ilLearningSequenceMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, ilLearningSequenceMembershipMailNotification\TYPE_ADMISSION_MEMBER, ilLearningSequenceMembershipMailNotification\TYPE_DISMISS_MEMBER, ilLearningSequenceMembershipMailNotification\TYPE_NOTIFICATION_REGISTRATION, ilLearningSequenceMembershipMailNotification\TYPE_NOTIFICATION_REGISTRATION_REQUEST, ilLearningSequenceMembershipMailNotification\TYPE_NOTIFICATION_UNSUBSCRIBE, ilLearningSequenceMembershipMailNotification\TYPE_REFUSED_SUBSCRIPTION_MEMBER, ilLearningSequenceMembershipMailNotification\TYPE_STATUS_CHANGED, ilLearningSequenceMembershipMailNotification\TYPE_SUBSCRIBE_MEMBER, and ilLearningSequenceMembershipMailNotification\TYPE_UNSUBSCRIBE_MEMBER.

115  : bool
116  {
117  $mail = new ilLearningSequenceMembershipMailNotification($this->logger, $this->settings);
118  $mail->forceSendingMail($force_sending_mail);
119 
120  switch ($type) {
123  $mail->setRefId($this->ref_id);
124  $mail->setRecipients(array($usr_id));
125  $mail->send();
126  break;
129  $mail->setRefId($this->ref_id);
130  $mail->setRecipients(array($usr_id));
131  $mail->send();
132  break;
135  $mail->setAdditionalInformation(array('usr_id' => $usr_id));
136  $mail->setRefId($this->ref_id);
137  $mail->setRecipients($this->getNotificationRecipients());
138  $mail->send();
139  break;
142  $mail->setRefId($this->ref_id);
143  $mail->setRecipients(array($usr_id));
144  $mail->send();
145  break;
148  $mail->setAdditionalInformation(array('usr_id' => $usr_id));
149  $mail->setRefId($this->ref_id);
150  $mail->setRecipients($this->getNotificationRecipients());
151  $mail->send();
152  break;
155  $mail->setRefId($this->ref_id);
156  $mail->setRecipients(array($usr_id));
157  $mail->send();
158  break;
161  $mail->setAdditionalInformation(array('usr_id' => $usr_id));
162  $mail->setRefId($this->ref_id);
163  $mail->setRecipients($this->getNotificationRecipients());
164  $mail->send();
165  break;
168  $mail->setRefId($this->ref_id);
169  $mail->setRecipients(array($usr_id));
170  $mail->send();
171  break;
174  $mail->setRefId($this->ref_id);
175  $mail->setRecipients(array($usr_id));
176  $mail->send();
177  break;
180  $mail->setRefId($this->ref_id);
181  $mail->setRecipients(array($usr_id));
182  $mail->send();
183  break;
184  }
185  return true;
186  }
settings()
Definition: settings.php:2
getNotificationRecipients()
Get admin, tutor which have notification enabled.
+ Here is the call graph for this function:

Field Documentation

◆ $instances

ilLearningSequenceParticipants::$instances
staticprotected

Definition at line 17 of file class.ilLearningSequenceParticipants.php.

◆ COMPONENT_NAME

const ilLearningSequenceParticipants::COMPONENT_NAME = 'Modules/LearningSequence'

Definition at line 12 of file class.ilLearningSequenceParticipants.php.


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