ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 (int $a_usr_id, int $a_role)
 
 addSubscriber (int $a_usr_id)
 
 sendNotification (int $type, int $usr_id, bool $force_sending_mail=false)
 Send notification mail. More...
 
- 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 @access public. More...
 
 checkLastAdmin (array $a_usr_ids)
 Check if users for deletion are last admins @access 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 @access 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 $obj_id)
 
static getMemberRoles (int $ref_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. 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 (int|ilObject $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...
 

Data Fields

const COMPONENT_NAME = 'components/ILIAS/LearningSequence'
 
- 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 Attributes

ilAppEventHandler $app_event_handler
 
ilSetting $settings
 
- 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

- 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

Manage participants.

Definition at line 24 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 35 of file class.ilLearningSequenceParticipants.php.

40 {
42 parent::__construct(self::COMPONENT_NAME, array_pop($refs));
43
44 $this->logger = $logger;
45 $this->app_event_handler = $app_event_handler;
46 $this->settings = $settings;
47 }
static _getAllReferences(int $id)
get all reference ids for object ID
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $app_event_handler, ilParticipants\$logger, ilParticipants\$obj_id, $settings, ILIAS\GlobalScreen\Provider\__construct(), ilObject\_getAllReferences(), ILIAS\Repository\logger(), and ILIAS\Repository\settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstanceByObjId()

static ilLearningSequenceParticipants::_getInstanceByObjId ( int  $obj_id)
static

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

50 {
51 global $DIC;
52
53 $logger = $DIC["ilLoggerFactory"]->getRootLogger();
54 $app_event_handler = $DIC['ilAppEventHandler'];
55 $settings = $DIC["ilSetting"];
56
57 if (isset(self::$instances[$obj_id]) && self::$instances[$obj_id]) {
58 return self::$instances[$obj_id];
59 }
60
61 return self::$instances[$obj_id] = new ilLearningSequenceParticipants(
62 $obj_id,
63 $logger,
66 );
67 }
global $DIC
Definition: shib_login.php:26

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

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

+ Here is the caller graph for this function:

◆ _isParticipant()

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

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

Reimplemented from ilParticipants.

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

93 : bool
94 {
95 global $DIC;
96
97 $rbacreview = $DIC->rbac()->review();
98 $local_roles = $rbacreview->getRolesOfRoleFolder($a_ref_id, false);
99
100 return $rbacreview->isAssignedToAtLeastOneGivenRole($a_usr_id, $local_roles);
101 }

References $DIC.

Referenced by ilObjLearningSequenceGUI\checkLPAccess().

+ Here is the caller graph for this function:

◆ add()

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

Reimplemented from ilParticipants.

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

103 : bool
104 {
105 return parent::add($a_usr_id, $a_role);
106 }

References ILIAS\UI\examples\Symbol\Glyph\Add\add().

+ Here is the call graph for this function:

◆ addSubscriber()

ilLearningSequenceParticipants::addSubscriber ( int  $a_usr_id)

Reimplemented from ilParticipants.

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

108 : void
109 {
110 parent::addSubscriber($a_usr_id);
111
112 $this->logger->info('Raise new event: Modules/LearningSequence addSubscriber.');
113 $this->app_event_handler->raise(
114 "components/ILIAS/LearningSequence",
115 'addSubscriber',
116 array(
117 'obj_id' => $this->getObjId(),
118 'usr_id' => $a_usr_id
119 )
120 );
121 }

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

+ Here is the call graph for this function:

◆ getMemberRoles()

static ilLearningSequenceParticipants::getMemberRoles ( int  $ref_id)
static

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

69 : array
70 {
71 global $DIC;
72
73 $rbacreview = $DIC->rbac()->review();
74 $lrol = $rbacreview->getRolesOfRoleFolder($ref_id, false);
75
76 $roles = array();
77 foreach ($lrol as $role) {
78 $title = ilObject::_lookupTitle($role);
79
80 switch (substr($title, 0, 8)) {
81 case 'il_lso_a':
82 case 'il_lso_m':
83 $roles[$role] = $role;
84 // no break
85 default:
86 break;
87 }
88 }
89
90 return $roles;
91 }
static _lookupTitle(int $obj_id)

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

+ Here is the call graph for this function:

◆ sendNotification()

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

Send notification mail.

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

126 : bool
127 {
129 $mail->forceSendingMail($force_sending_mail);
130
131 switch ($type) {
134 $mail->setRefId($this->ref_id);
135 $mail->setRecipients(array($usr_id));
136 $mail->send();
137 break;
140 $mail->setRefId($this->ref_id);
141 $mail->setRecipients(array($usr_id));
142 $mail->send();
143 break;
146 $mail->setAdditionalInformation(array('usr_id' => $usr_id));
147 $mail->setRefId($this->ref_id);
148 $mail->setRecipients($this->getNotificationRecipients());
149 $mail->send();
150 break;
153 $mail->setRefId($this->ref_id);
154 $mail->setRecipients(array($usr_id));
155 $mail->send();
156 break;
159 $mail->setAdditionalInformation(array('usr_id' => $usr_id));
160 $mail->setRefId($this->ref_id);
161 $mail->setRecipients($this->getNotificationRecipients());
162 $mail->send();
163 break;
166 $mail->setRefId($this->ref_id);
167 $mail->setRecipients(array($usr_id));
168 $mail->send();
169 break;
172 $mail->setAdditionalInformation(array('usr_id' => $usr_id));
173 $mail->setRefId($this->ref_id);
174 $mail->setRecipients($this->getNotificationRecipients());
175 $mail->send();
176 break;
179 $mail->setRefId($this->ref_id);
180 $mail->setRecipients(array($usr_id));
181 $mail->send();
182 break;
185 $mail->setRefId($this->ref_id);
186 $mail->setRecipients(array($usr_id));
187 $mail->send();
188 break;
191 $mail->setRefId($this->ref_id);
192 $mail->setRecipients(array($usr_id));
193 $mail->send();
194 break;
195 }
196 return true;
197 }
getNotificationRecipients()
Get admin, tutor which have notification enabled.

References ilParticipants\$type, ilParticipants\getNotificationRecipients(), ILIAS\Repository\logger(), ILIAS\Repository\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.

+ Here is the call graph for this function:

Field Documentation

◆ $app_event_handler

ilAppEventHandler ilLearningSequenceParticipants::$app_event_handler
protected

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

Referenced by __construct(), and _getInstanceByObjId().

◆ $instances

array ilLearningSequenceParticipants::$instances
staticprotected

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

◆ $settings

ilSetting ilLearningSequenceParticipants::$settings
protected

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

Referenced by __construct(), and _getInstanceByObjId().

◆ COMPONENT_NAME

const ilLearningSequenceParticipants::COMPONENT_NAME = 'components/ILIAS/LearningSequence'

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


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