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

Session participation handling. More...

+ Inheritance diagram for ilSessionParticipants:
+ Collaboration diagram for ilSessionParticipants:

Public Member Functions

 __construct ($a_ref_id)
 Constructor. More...
 
 getEventParticipants ()
 Get event particpants object. More...
 
 checkLastAdmin ($a_usr_ids)
 no last admin restrictions for sessions More...
 
 readParticipantsStatus ()
 read participant status More...
 
 add ($a_usr_id, $a_role="")
 Add user to session member role. More...
 
 register ($a_usr_id)
 Register user. More...
 
 unregister ($a_usr_id)
 Unregister user. More...
 
 sendNotification ($a_type, $a_usr_id, $a_force_email=false)
 
- 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 @global 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 ($a_obj_id)
 Get instance. More...
 
static getInstance ($a_ref_id)
 Get instance. 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 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 @global ilRbacReview $rbacreview @global <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/Session'
 

Protected Attributes

 $event_part = null
 
- 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
 

Static Protected Attributes

static $instances = array()
 

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...
 

Detailed Description

Session participation handling.

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

Definition at line 15 of file class.ilSessionParticipants.php.

Constructor & Destructor Documentation

◆ __construct()

ilSessionParticipants::__construct (   $a_ref_id)

Constructor.

@access protected

Parameters
intref_id of object

Definition at line 29 of file class.ilSessionParticipants.php.

30 {
31 $this->event_part = new ilEventParticipants(ilObject::_lookupObjId($a_ref_id));
32 parent::__construct(self::COMPONENT_NAME, $a_ref_id);
33 }
static _lookupObjId($a_id)

References ilObject\_lookupObjId().

+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstanceByObjId()

static ilSessionParticipants::_getInstanceByObjId (   $a_obj_id)
static

Get instance.

Parameters
int$a_ref_id
Returns
ilSessionParticipants

Definition at line 41 of file class.ilSessionParticipants.php.

42 {
43 $refs = ilObject::_getAllReferences($a_obj_id);
44 return self::getInstance(array_pop($refs));
45 }
static _getAllReferences($a_id)
get all reference ids of object
static getInstance($a_ref_id)
Get instance.

References ilObject\_getAllReferences(), and getInstance().

Referenced by ilParticipants\getInstanceByObjId(), ilObjSession\handleAutoFill(), and ilObjSession\initParticipants().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isParticipant()

static ilSessionParticipants::_isParticipant (   $a_ref_id,
  $a_usr_id 
)
static

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

@access public

Parameters
intref_id
intuser id

Reimplemented from ilParticipants.

Definition at line 89 of file class.ilSessionParticipants.php.

90 {
93 }
static _isRegistered($a_usr_id, $a_event_id)

References ilParticipants\$obj_id, ilEventParticipants\_isRegistered(), and ilObject\_lookupObjId().

+ Here is the call graph for this function:

◆ add()

ilSessionParticipants::add (   $a_usr_id,
  $a_role = "" 
)

Add user to session member role.

Additionally the status registered or participated must be set manually

Parameters
int$a_usr_id
int$a_role

Reimplemented from ilParticipants.

Definition at line 114 of file class.ilSessionParticipants.php.

115 {
116 if (parent::add($a_usr_id, $a_role)) {
117 return true;
118 }
119 return false;
120 }
add()
Definition: add.php:2

References add().

Referenced by register().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkLastAdmin()

ilSessionParticipants::checkLastAdmin (   $a_usr_ids)

no last admin restrictions for sessions

Parameters
int[]$a_usr_ids
Returns
boolean

Reimplemented from ilParticipants.

Definition at line 76 of file class.ilSessionParticipants.php.

77 {
78 return false;
79 }

◆ getEventParticipants()

ilSessionParticipants::getEventParticipants ( )

Get event particpants object.

Returns
ilEventParticipants

Definition at line 66 of file class.ilSessionParticipants.php.

References $event_part.

Referenced by readParticipantsStatus(), register(), and unregister().

+ Here is the caller graph for this function:

◆ getInstance()

static ilSessionParticipants::getInstance (   $a_ref_id)
static

Get instance.

Parameters
int$a_ref_id
Returns
ilSessionParticipants

Reimplemented from ilParticipants.

Definition at line 54 of file class.ilSessionParticipants.php.

55 {
56 if (self::$instances[$a_ref_id] instanceof self) {
57 return self::$instances[$a_ref_id];
58 }
59 return self::$instances[$a_ref_id] = new self($a_ref_id);
60 }

Referenced by _getInstanceByObjId(), ilParticipants\getInstance(), ilObjSessionListGUI\getProperties(), and ilObjSessionGUI\unregisterObject().

+ Here is the caller graph for this function:

◆ readParticipantsStatus()

ilSessionParticipants::readParticipantsStatus ( )

read participant status

Reimplemented from ilParticipants.

Definition at line 98 of file class.ilSessionParticipants.php.

99 {
100 $this->participants_status = array();
101 foreach ($this->getMembers() as $mem_uid) {
102 $this->participants_status[$mem_uid]['blocked'] = false;
103 $this->participants_status[$mem_uid]['notification'] = false;
104 $this->participants_status[$mem_uid]['passed'] = false;
105 $this->participants_status[$mem_uid]['contact'] = $this->getEventParticipants()->isContact($mem_uid);
106 }
107 }
getMembers()
Get all members ids (admins and tutors are not members) Use get participants to fetch all.
getEventParticipants()
Get event particpants object.

References getEventParticipants(), and ilParticipants\getMembers().

+ Here is the call graph for this function:

◆ register()

ilSessionParticipants::register (   $a_usr_id)

Register user.

Parameters
int$a_usr_id
Returns
boolean

Definition at line 127 of file class.ilSessionParticipants.php.

128 {
129 $this->logger->debug('Registering user: ' . $a_usr_id . ' for session: ' . $this->getObjId());
130 $this->add($a_usr_id, IL_SESS_MEMBER);
131 // in any (already participant since status attended) case register user.
132 $this->getEventParticipants()->register($a_usr_id);
133 return true;
134 }
const IL_SESS_MEMBER
getObjId()
get current obj_id
add($a_usr_id, $a_role="")
Add user to session member role.

References add(), getEventParticipants(), ilParticipants\getObjId(), and IL_SESS_MEMBER.

+ Here is the call graph for this function:

◆ sendNotification()

ilSessionParticipants::sendNotification (   $a_type,
  $a_usr_id,
  $a_force_email = false 
)
Parameters
int$a_type
int$a_usr_id
bool$a_force_email

Definition at line 161 of file class.ilSessionParticipants.php.

162 {
164
165 switch ($a_type) {
168 $mail->setRefId($this->ref_id);
169 $mail->setRecipients([$a_usr_id]);
170 $mail->send();
171 break;
172
173 default:
174 $this->logger->warning('Invalid notfication type given: ' . $a_type);
175 $this->logger->logStack(ilLogLevel::WARNING);
176 break;
177 }
178 }
$a_type
Definition: workflow.php:92

References $a_type, ilSessionMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, and ilLogLevel\WARNING.

◆ unregister()

ilSessionParticipants::unregister (   $a_usr_id)

Unregister user.

Parameters
int$a_usr_id
Returns
boolean

Definition at line 141 of file class.ilSessionParticipants.php.

142 {
143 // participated users are not dropped from role
144 if ($this->getEventParticipants()->hasParticipated($a_usr_id)) {
145 $this->getEventParticipants()->unregister($a_usr_id);
146 return true;
147 } else {
148 $this->delete($a_usr_id);
149 $this->getEventParticipants()->unregister($a_usr_id);
150 return true;
151 }
152 return false;
153 }

References getEventParticipants().

+ Here is the call graph for this function:

Field Documentation

◆ $event_part

ilSessionParticipants::$event_part = null
protected

Definition at line 21 of file class.ilSessionParticipants.php.

Referenced by getEventParticipants().

◆ $instances

ilSessionParticipants::$instances = array()
staticprotected

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

◆ COMPONENT_NAME

const ilSessionParticipants::COMPONENT_NAME = 'Modules/Session'

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


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