ILIAS  release_8 Revision v8.24
ilSessionMembershipGUI 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 ilSessionMembershipGUI:
+ Collaboration diagram for ilSessionMembershipGUI:

Public Member Functions

 __construct (ilObjectGUI $repository_gui, ilObject $repository_obj)
 
 getPrintMemberData (array $a_members)
 
 getAttendanceListUserData (int $user_id, array $filters=[])
 
- Public Member Functions inherited from ilMembershipGUI
 __construct (ilObjectGUI $repository_gui, ilObject $repository_obj)
 
 getParentGUI ()
 
 getParentObject ()
 
 getMembersObject ()
 
 filterUserIdsByRbacOrPositionOfCurrentUser (array $a_user_ids)
 Filter user ids by access. More...
 
 executeCommand ()
 
 getAttendanceListUserData (int $user_id, array $filters=[])
 
 updateParticipants ()
 update members More...
 
 createMailSignature ()
 Create Mail signature. More...
 
 addMemberTab (ilTabsGUI $tabs, bool $a_is_participant=false)
 
 readMemberData (array $usr_ids, array $columns)
 Required for member table guis. More...
 
 getLocalRoles ()
 
 confirmAssignSubscribers ()
 Show subscription confirmation. More...
 
 confirmRefuseSubscribers ()
 Refuse subscriber confirmation. More...
 
 assignSubscribers ()
 Do assignment of subscription request. More...
 
 confirmAssignFromWaitingList ()
 Assign from waiting list (confirmatoin) More...
 
 assignFromWaitingList ()
 Assign from waiting list. More...
 
 confirmRefuseFromList ()
 Refuse from waiting list (confirmation) More...
 

Protected Member Functions

 getMailMemberRoles ()
 
 checkRbacOrPositionAccessBool (string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)
 No support for positions in sessions Check if rbac or position access is granted. More...
 
 initParticipantTemplate ()
 
 initWaitingList ()
 
 initParticipantTableGUI ()
 
 initSubscriberTable ()
 
 updateMembers ()
 
 confirmDeleteParticipants ()
 Show confirmation screen for participants deletion. More...
 
 deleteParticipants ()
 
 canAddOrSearchUsers ()
 Check if current user is allowed to add / search users. More...
 
 getMemberTabName ()
 
 getMailContextOptions ()
 
- Protected Member Functions inherited from ilMembershipGUI
 initParticipantsFromPost ()
 
 initMemberIdFromGet ()
 
 initSubscribersFromPost ()
 
 initWaitingListIdsFromPost ()
 
 getLanguage ()
 
 getCtrl ()
 
 getLogger ()
 
 getMailMemberRoles ()
 
 checkPermissionBool (string $a_permission, string $a_cmd='', string $a_type='', int $a_ref_id=0)
 
 checkRbacOrPositionAccessBool (string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)
 
 checkPermission (string $a_permission, string $a_cmd="")
 Check permission If not granted redirect to parent gui. More...
 
 checkRbacOrPermissionAccess (string $a_rbac_perm, string $a_pos_perm)
 check rbac or position access More...
 
 canAddOrSearchUsers ()
 Check if current user is allowed to add / search users. More...
 
 participants ()
 Show participant table, subscriber table, wating list table;. More...
 
 participantsApplyFilter ()
 Apply filter for participant table. More...
 
 participantsResetFilter ()
 reset participants filter More...
 
 editMember ()
 Edit one participant. More...
 
 editParticipants (array $post_participants=array())
 Edit participants. More...
 
 updateLPFromStatus (int $usr_id, bool $has_passed)
 
 confirmDeleteParticipants ()
 Show confirmation screen for participants deletion. More...
 
 deleteParticipants ()
 
 sendMailToSelectedUsers ()
 
 getMailContextOptions ()
 
 membersMap ()
 Members map. More...
 
 mailMembersBtn ()
 
 showParticipantsToolbar ()
 Show participants toolbar. More...
 
 showMemberExportToolbarButton (ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
 
 showMailToMemberToolbarButton (ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
 Show mail to member toolbar button. More...
 
 getDefaultCommand ()
 
 getMemberTabName ()
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 parseSubscriberTable ()
 Parse table of subscription request. More...
 
 initSubscriberTable ()
 
 refuseSubscribers ()
 
 parseWaitingListTable ()
 Parse table of subscription request. More...
 
 refuseFromList ()
 refuse from waiting list More...
 
 addToClipboard ()
 Add selected users to user clipboard. More...
 
 getDefaultRole ()
 
 activateSubTab (string $a_sub_tab)
 
 printMembers ()
 
 printMembersOutput ()
 print members output More...
 
 printForMembersOutput ()
 print members output More...
 
 jump2UsersGallery ()
 
 initAttendanceList (bool $a_for_members=false)
 

Protected Attributes

array $requested_visible_participants = []
 
array $requested_participated = []
 
array $requested_registered = []
 
array $requested_contact = []
 
array $requested_excused = []
 
array $requested_mark = []
 
array $requested_comment = []
 
array $requested_notification = []
 
array $requested_participants = []
 
- Protected Attributes inherited from ilMembershipGUI
GlobalHttpState $http
 
Factory $refinery
 
ilLanguage $lng
 
ilCtrlInterface $ctrl
 
ilLogger $logger
 
ilGlobalTemplateInterface $tpl
 
ilAccessHandler $access
 
ilParticipants $participants = null
 
ilObjUser $user
 
ilErrorHandling $error
 
ilTabsGUI $tabs
 
ilToolbarGUI $toolbar
 
ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
ilTree $tree
 
array $member_data = []
 

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 GUI class for membership features

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

@ilCtrl_Calls ilSessionMembershipGUI: ilMailMemberSearchGUI, ilUsersGalleryGUI, ilRepositorySearchGUI @ilCtrl_Calls ilSessionMembershipGUI: ilSessionOverviewGUI @ilCtrl_Calls ilSessionMembershipGUI: ilMemberExportGUI

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

Constructor & Destructor Documentation

◆ __construct()

ilSessionMembershipGUI::__construct ( ilObjectGUI  $repository_gui,
ilObject  $repository_obj 
)

Reimplemented from ilMembershipGUI.

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

45 {
46 parent::__construct($repository_gui, $repository_obj);
47
48 if ($this->http->wrapper()->post()->has('visible_participants')) {
49 $this->requested_visible_participants = (array) $this->http->wrapper()->post()->retrieve(
50 'visible_participants',
51 $this->refinery->custom()->transformation(function ($v) {
52 return $v;
53 })
54 );
55 } elseif ($this->http->wrapper()->query()->has('visible_participants')) {
56 $this->requested_visible_participants = (array) $this->http->wrapper()->query()->retrieve(
57 'visible_participants',
58 $this->refinery->custom()->transformation(function ($v) {
59 return $v;
60 })
61 );
62 }
63
64 if ($this->http->wrapper()->post()->has('participated')) {
65 $this->requested_participated = (array) $this->http->wrapper()->post()->retrieve(
66 'participated',
67 $this->refinery->custom()->transformation(function ($v) {
68 return $v;
69 })
70 );
71 }
72
73 if ($this->http->wrapper()->post()->has('registered')) {
74 $this->requested_registered = (array) $this->http->wrapper()->post()->retrieve(
75 'registered',
76 $this->refinery->custom()->transformation(function ($v) {
77 return $v;
78 })
79 );
80 }
81
82 if ($this->http->wrapper()->post()->has('contact')) {
83 $this->requested_contact = (array) $this->http->wrapper()->post()->retrieve(
84 'contact',
85 $this->refinery->custom()->transformation(function ($v) {
86 return $v;
87 })
88 );
89 }
90
91 if ($this->http->wrapper()->post()->has('excused')) {
92 $this->requested_excused = (array) $this->http->wrapper()->post()->retrieve(
93 'excused',
94 $this->refinery->custom()->transformation(function ($v) {
95 return $v;
96 })
97 );
98 }
99
100 if ($this->http->wrapper()->post()->has('mark')) {
101 $this->requested_mark = (array) $this->http->wrapper()->post()->retrieve(
102 'mark',
103 $this->refinery->custom()->transformation(function ($v) {
104 return $v;
105 })
106 );
107 }
108
109 if ($this->http->wrapper()->post()->has('comment')) {
110 $this->requested_comment = (array) $this->http->wrapper()->post()->retrieve(
111 'comment',
112 $this->refinery->custom()->transformation(function ($v) {
113 return $v;
114 })
115 );
116 }
117
118 if ($this->http->wrapper()->post()->has('notification')) {
119 $this->requested_notification = (array) $this->http->wrapper()->post()->retrieve(
120 'notification',
121 $this->refinery->custom()->transformation(function ($v) {
122 return $v;
123 })
124 );
125 }
126
127 if ($this->http->wrapper()->post()->has('participants')) {
128 $this->requested_participants = (array) $this->http->wrapper()->post()->retrieve(
129 'participants',
130 $this->refinery->custom()->transformation(function ($v) {
131 return $v;
132 })
133 );
134 }
135 }
static http()
Fetches the global http state from ILIAS.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ilMembershipGUI\$repository_gui, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\FileDelivery\http(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ canAddOrSearchUsers()

ilSessionMembershipGUI::canAddOrSearchUsers ( )
protected

Check if current user is allowed to add / search users.

Reimplemented from ilMembershipGUI.

Definition at line 302 of file class.ilSessionMembershipGUI.php.

302 : bool
303 {
304 return false;
305 }

◆ checkRbacOrPositionAccessBool()

ilSessionMembershipGUI::checkRbacOrPositionAccessBool ( string  $a_rbac_perm,
string  $a_pos_perm,
int  $a_ref_id = 0 
)
protected

No support for positions in sessions Check if rbac or position access is granted.

Reimplemented from ilMembershipGUI.

Definition at line 146 of file class.ilSessionMembershipGUI.php.

146 : bool
147 {
148 if (!$a_ref_id) {
149 $a_ref_id = $this->getParentObject()->getRefId();
150 }
151 return $this->checkPermissionBool($a_rbac_perm, "", "", $a_ref_id);
152 }
checkPermissionBool(string $a_permission, string $a_cmd='', string $a_type='', int $a_ref_id=0)

References ilMembershipGUI\checkPermissionBool(), and ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ confirmDeleteParticipants()

ilSessionMembershipGUI::confirmDeleteParticipants ( )
protected

Show confirmation screen for participants deletion.

Reimplemented from ilMembershipGUI.

Definition at line 237 of file class.ilSessionMembershipGUI.php.

237 : void
238 {
240
241 if (!count($participants)) {
242 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
243 $this->ctrl->redirect($this, 'participants');
244 }
245
246 $confirm = new ilConfirmationGUI();
247 $confirm->setFormAction($this->ctrl->getFormAction($this, 'confirmDeleteParticipants'));
248 $confirm->setHeaderText($this->lng->txt($this->getParentObject()->getType() . '_header_delete_members'));
249 $confirm->setConfirm($this->lng->txt('confirm'), 'deleteParticipants');
250 $confirm->setCancel($this->lng->txt('cancel'), 'participants');
251
252 foreach ($participants as $usr_id) {
253 $name = ilObjUser::_lookupName($usr_id);
254
255 $confirm->addItem(
256 'participants[]',
257 $name['user_id'],
258 $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
259 ilUtil::getImagePath('icon_usr.svg')
260 );
261 }
262
263 $this->tpl->setContent($confirm->getHTML());
264 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilParticipants $participants
static _lookupName(int $a_user_id)
lookup user name
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
if($format !==null) $name
Definition: metadata.php:247

References $name, ilMembershipGUI\$participants, $requested_participants, ilObjUser\_lookupName(), ILIAS\Repository\ctrl(), ilUtil\getImagePath(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ deleteParticipants()

ilSessionMembershipGUI::deleteParticipants ( )
protected

Reimplemented from ilMembershipGUI.

Definition at line 266 of file class.ilSessionMembershipGUI.php.

266 : void
267 {
268 $this->checkPermission('manage_members');
269
271
272 if (!is_array($participants) || !count($participants)) {
273 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
274 $this->ctrl->redirect($this, 'participants');
275 }
276
277 foreach ($participants as $part_id) {
278 // delete role assignment
279 $this->getMembersObject()->delete($part_id);
280 // delete further settings
281 $event_part = new ilEventParticipants($this->getParentObject()->getId());
282 $event_part->setUserId($part_id);
283 $event_part->setParticipated(false);
284 $event_part->setRegistered(false);
285 $event_part->setMark('');
286 $event_part->setComment('');
287 $event_part->updateUser();
288 }
289
290 $this->tpl->setOnScreenMessage('success', $this->lng->txt($this->getParentObject()->getType() . "_members_deleted"), true);
291 $this->ctrl->redirect($this, "participants");
292 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermission(string $a_permission, string $a_cmd="")
Check permission If not granted redirect to parent gui.

References ilMembershipGUI\$participants, $requested_participants, ilMembershipGUI\checkPermission(), ILIAS\Repository\ctrl(), ILIAS\Survey\Mode\getId(), ilMembershipGUI\getMembersObject(), ilMembershipGUI\getParentObject(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getAttendanceListUserData()

ilSessionMembershipGUI::getAttendanceListUserData ( int  $user_id,
array  $filters = [] 
)

Reimplemented from ilMembershipGUI.

Definition at line 307 of file class.ilSessionMembershipGUI.php.

307 : array
308 {
309 $data = $this->getMembersObject()->getEventParticipants()->getUser($user_id);
310 $data['registered'] = (bool) ($data['registered'] ?? false);
311 $data['participated'] = (bool) ($data['participated'] ?? false);
312
313 if ($filters && $filters["registered"] && !$data["registered"]) {
314 return [];
315 }
316
317
318 $data['registered'] = $data['registered'] ?
319 $this->lng->txt('yes') :
320 $this->lng->txt('no');
321 $data['participated'] = $data['participated'] ?
322 $this->lng->txt('yes') :
323 $this->lng->txt('no');
324
325 return $data;
326 }

References $data, ilMembershipGUI\getMembersObject(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getMailContextOptions()

ilSessionMembershipGUI::getMailContextOptions ( )
protected

Reimplemented from ilMembershipGUI.

Definition at line 333 of file class.ilSessionMembershipGUI.php.

333 : array
334 {
335 $context_options = [
337 'ref_id' => $this->getParentObject()->getRefId(),
338 'ts' => time()
339 ];
340
341 return $context_options;
342 }

References ilMailFormCall\CONTEXT_KEY, ilMembershipGUI\getParentObject(), and ilSessionMailTemplateParticipantContext\ID.

+ Here is the call graph for this function:

◆ getMailMemberRoles()

ilSessionMembershipGUI::getMailMemberRoles ( )
protected

Reimplemented from ilMembershipGUI.

Definition at line 137 of file class.ilSessionMembershipGUI.php.

138 {
139 return new ilMailMemberSessionRoles();
140 }
Class ilAbstractMailMemberRoles.
Class ilMailMemberSessionRoles.

◆ getMemberTabName()

ilSessionMembershipGUI::getMemberTabName ( )
protected

Reimplemented from ilMembershipGUI.

Definition at line 328 of file class.ilSessionMembershipGUI.php.

328 : string
329 {
330 return $this->lng->txt($this->getParentObject()->getType() . '_members');
331 }

References ilMembershipGUI\getParentObject(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ getPrintMemberData()

ilSessionMembershipGUI::getPrintMemberData ( array  $a_members)

Definition at line 294 of file class.ilSessionMembershipGUI.php.

294 : array
295 {
296 return $a_members;
297 }

◆ initParticipantTableGUI()

ilSessionMembershipGUI::initParticipantTableGUI ( )
protected

Definition at line 174 of file class.ilSessionMembershipGUI.php.

175 {
177 $this,
178 $this->getParentObject(),
179 'participants'
180 );
181 $table->init();
182 return $table;
183 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ initParticipantTemplate()

ilSessionMembershipGUI::initParticipantTemplate ( )
protected

Definition at line 154 of file class.ilSessionMembershipGUI.php.

154 : void
155 {
156 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_edit_members.html', 'Modules/Session');
157 }

◆ initSubscriberTable()

ilSessionMembershipGUI::initSubscriberTable ( )
protected

Reimplemented from ilMembershipGUI.

Definition at line 185 of file class.ilSessionMembershipGUI.php.

186 {
187 $subscriber = new ilSubscriberTableGUI($this, $this->getParentObject(), true, false);
188 $subscriber->setTitle($this->lng->txt('group_new_registrations'));
189 return $subscriber;
190 }
GUI class for course/group subscriptions.

References ilMembershipGUI\getParentObject(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initWaitingList()

ilSessionMembershipGUI::initWaitingList ( )
protected

Definition at line 159 of file class.ilSessionMembershipGUI.php.

160 {
161 $wait = new ilSessionWaitingList($this->getParentObject()->getId());
162 return $wait;
163 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Survey\Mode\getId(), and ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ updateMembers()

ilSessionMembershipGUI::updateMembers ( )
protected

Definition at line 192 of file class.ilSessionMembershipGUI.php.

192 : void
193 {
194 $this->checkPermission('manage_members');
195
196 $part = ilParticipants::getInstance($this->getParentObject()->getRefId());
197
198
199 $wait = new ilSessionWaitingList($this->getParentObject()->getId());
200 $waiting = $wait->getUserIds();
201
202 foreach ($this->requested_visible_participants as $part_id) {
203 if (in_array($part_id, $waiting)) {
204 // so not update users on waiting list
205 continue;
206 }
207
208 $participated = (bool) ($this->requested_participated[$part_id] ?? false);
209 $registered = (bool) ($this->requested_registered[$part_id] ?? false);
210 $contact = (bool) ($this->requested_contact[$part_id] ?? false);
211 $excused = (bool) ($this->requested_excused[$part_id] ?? false);
212
213 $part_id = (int) $part_id;
214
215 if ($part->isAssigned($part_id) && !$participated && !$registered) {
216 $part->delete($part_id);
217 }
218 if (!$part->isAssigned($part_id) && ($participated || $registered)) {
219 $part->add($part_id, ilParticipants::IL_SESS_MEMBER);
220 }
221 $event_part = new ilEventParticipants($this->getParentObject()->getId());
222 $event_part->setUserId($part_id);
223 $event_part->setMark(ilUtil::stripSlashes($this->requested_mark[$part_id]));
224 $event_part->setComment(ilUtil::stripSlashes($this->requested_comment[$part_id]));
225 $event_part->setNotificationEnabled((bool) ($this->requested_notification[$part_id] ?? false));
226 $event_part->setParticipated($participated);
227 $event_part->setRegistered($registered);
228 $event_part->setContact($contact);
229 $event_part->setExcused($excused);
230 $event_part->updateUser();
231 }
232
233 $this->tpl->setOnScreenMessage('success', $this->getLanguage()->txt('settings_saved'), true);
234 $this->getCtrl()->redirect($this, 'participants');
235 }
static getInstance(int $a_ref_id)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")

References ilMembershipGUI\checkPermission(), ilMembershipGUI\getCtrl(), ILIAS\Survey\Mode\getId(), ilParticipants\getInstance(), ilMembershipGUI\getLanguage(), ilMembershipGUI\getParentObject(), ilParticipants\IL_SESS_MEMBER, ILIAS\Repository\int(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

Field Documentation

◆ $requested_comment

array ilSessionMembershipGUI::$requested_comment = []
protected

Definition at line 40 of file class.ilSessionMembershipGUI.php.

◆ $requested_contact

array ilSessionMembershipGUI::$requested_contact = []
protected

Definition at line 37 of file class.ilSessionMembershipGUI.php.

◆ $requested_excused

array ilSessionMembershipGUI::$requested_excused = []
protected

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

◆ $requested_mark

array ilSessionMembershipGUI::$requested_mark = []
protected

Definition at line 39 of file class.ilSessionMembershipGUI.php.

◆ $requested_notification

array ilSessionMembershipGUI::$requested_notification = []
protected

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

◆ $requested_participants

array ilSessionMembershipGUI::$requested_participants = []
protected

◆ $requested_participated

array ilSessionMembershipGUI::$requested_participated = []
protected

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

◆ $requested_registered

array ilSessionMembershipGUI::$requested_registered = []
protected

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

◆ $requested_visible_participants

array ilSessionMembershipGUI::$requested_visible_participants = []
protected

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


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