ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSessionParticipants 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 ilSessionParticipants:
+ Collaboration diagram for ilSessionParticipants:

Public Member Functions

 __construct (int $a_ref_id)
 
 getEventParticipants ()
 
 checkLastAdmin (array $a_usr_ids)
 no last admin restrictions for sessions More...
 
 add (int $a_usr_id, int $a_role=0)
 Add user to session member role. More...
 
 register (int $a_usr_id)
 
 unregister (int $a_usr_id)
 
 sendNotification (int $a_type, int $a_usr_id, bool $a_force_email=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)
 
static getInstance (int $a_ref_id)
 
static _isParticipant (int $a_ref_id, int $a_usr_id)
 
- 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...
 

Data Fields

const COMPONENT_NAME = 'Modules/Session'
 
- 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

 readParticipantsStatus ()
 
- 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)
 

Protected Attributes

ilEventParticipants $event_part
 
- 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 = []
 

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 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 30 of file class.ilSessionParticipants.php.

Constructor & Destructor Documentation

◆ __construct()

ilSessionParticipants::__construct ( int  $a_ref_id)

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

References ILIAS\GlobalScreen\Provider\__construct(), and ilObject\_lookupObjId().

39  {
40  $this->event_part = new ilEventParticipants(ilObject::_lookupObjId($a_ref_id));
41  parent::__construct(self::COMPONENT_NAME, $a_ref_id);
42  }
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _getInstanceByObjId()

static ilSessionParticipants::_getInstanceByObjId ( int  $a_obj_id)
static

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

References ilObject\_getAllReferences().

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

45  {
46  $refs = ilObject::_getAllReferences($a_obj_id);
47  return self::getInstance(array_pop($refs));
48  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getAllReferences(int $id)
get all reference ids for object ID
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ _isParticipant()

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

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

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

72  : bool
73  {
74  $obj_id = ilObject::_lookupObjId($a_ref_id);
76  }
static _lookupObjId(int $ref_id)
static _isRegistered(int $a_usr_id, int $a_event_id)
+ Here is the call graph for this function:

◆ add()

ilSessionParticipants::add ( int  $a_usr_id,
int  $a_role = 0 
)

Add user to session member role.

Additionally the status registered or participated must be set manually

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

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

Referenced by register().

92  : bool
93  {
94  if (parent::add($a_usr_id, $a_role)) {
95  return true;
96  }
97  return false;
98  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkLastAdmin()

ilSessionParticipants::checkLastAdmin ( array  $a_usr_ids)

no last admin restrictions for sessions

Parameters
int[]$a_usr_ids

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

67  : bool
68  {
69  return false;
70  }

◆ getEventParticipants()

ilSessionParticipants::getEventParticipants ( )

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

References $event_part.

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

59  {
60  return $this->event_part;
61  }
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:

◆ getInstance()

static ilSessionParticipants::getInstance ( int  $a_ref_id)
static

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

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

51  {
52  if (isset(self::$instances[$a_ref_id]) && self::$instances[$a_ref_id] instanceof self) {
53  return self::$instances[$a_ref_id];
54  }
55  return self::$instances[$a_ref_id] = new self($a_ref_id);
56  }
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:

◆ readParticipantsStatus()

ilSessionParticipants::readParticipantsStatus ( )
protected

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

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

78  : void
79  {
80  $this->participants_status = [];
81  foreach ($this->getEventParticipants()->getParticipants() as $mem_uid => $info) {
82  $this->participants_status[$mem_uid]['blocked'] = false;
83  $this->participants_status[$mem_uid]['notification_enabled'] = (bool) $info['notification_enabled'];
84  $this->participants_status[$mem_uid]['passed'] = false;
85  $this->participants_status[$mem_uid]['contact'] = (bool) $info['contact'];
86  }
87  }
getParticipants()
Get all participants ids.
+ Here is the call graph for this function:

◆ register()

ilSessionParticipants::register ( int  $a_usr_id)

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

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

100  : bool
101  {
102  $this->logger->debug('Registering user: ' . $a_usr_id . ' for session: ' . $this->getObjId());
103  $this->add($a_usr_id, ilParticipants::IL_SESS_MEMBER);
104  // in any (already participant since status attended) case register user.
105  $this->getEventParticipants()->register($a_usr_id);
106  return true;
107  }
add(int $a_usr_id, int $a_role=0)
Add user to session member role.
+ Here is the call graph for this function:

◆ sendNotification()

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

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

References ILIAS\Repository\logger(), ilSessionMembershipMailNotification\TYPE_ACCEPTED_SUBSCRIPTION_MEMBER, and ilLogLevel\WARNING.

119  : void
120  {
122 
123  switch ($a_type) {
126  $mail->setRefId($this->ref_id);
127  $mail->setRecipients([$a_usr_id]);
128  $mail->send();
129  break;
130 
131  default:
132  $this->logger->warning('Invalid notfication type given: ' . $a_type);
133  $this->logger->logStack(ilLogLevel::WARNING);
134  break;
135  }
136  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

◆ unregister()

ilSessionParticipants::unregister ( int  $a_usr_id)

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

References getEventParticipants().

109  : bool
110  {
111  // participated users are not dropped from role
112  if (!$this->getEventParticipants()->hasParticipated($a_usr_id)) {
113  $this->delete($a_usr_id);
114  }
115  $this->getEventParticipants()->unregister($a_usr_id);
116  return true;
117  }
+ Here is the call graph for this function:

Field Documentation

◆ $event_part

ilEventParticipants ilSessionParticipants::$event_part
protected

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

Referenced by getEventParticipants().

◆ $instances

array ilSessionParticipants::$instances = []
staticprotected

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

◆ COMPONENT_NAME

const ilSessionParticipants::COMPONENT_NAME = 'Modules/Session'

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


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