ILIAS  trunk Revision v11.0_alpha-1851-ga8564da6fed
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilSessionMembershipGUI Class Reference

GUI class for membership features. 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 ()
 
 getParticipantTableTitle ()
 
 initSubscriberTable ()
 
 updateMembers ()
 
 confirmDeleteParticipants ()
 
 deleteParticipants ()
 
 canAddOrSearchUsers ()
 
 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...
 
 getParticipantTableTitle ()
 
 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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

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

Member Function Documentation

◆ canAddOrSearchUsers()

ilSessionMembershipGUI::canAddOrSearchUsers ( )
protected

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

328  : bool
329  {
330  return false;
331  }

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

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

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

145  : bool
146  {
147  if (!$a_ref_id) {
148  $a_ref_id = $this->getParentObject()->getRefId();
149  }
150  return $this->checkPermissionBool($a_rbac_perm, "", "", $a_ref_id);
151  }
checkPermissionBool(string $a_permission, string $a_cmd='', string $a_type='', int $a_ref_id=0)
+ Here is the call graph for this function:

◆ confirmDeleteParticipants()

ilSessionMembershipGUI::confirmDeleteParticipants ( )
protected

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

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

263  : void
264  {
266 
267  if (!count($participants)) {
268  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('no_checkbox'), true);
269  $this->ctrl->redirect($this, 'participants');
270  }
271 
272  $confirm = new ilConfirmationGUI();
273  $confirm->setFormAction($this->ctrl->getFormAction($this, 'confirmDeleteParticipants'));
274  $confirm->setHeaderText($this->lng->txt($this->getParentObject()->getType() . '_header_delete_members'));
275  $confirm->setConfirm($this->lng->txt('confirm'), 'deleteParticipants');
276  $confirm->setCancel($this->lng->txt('cancel'), 'participants');
277 
278  foreach ($participants as $usr_id) {
279  $name = ilObjUser::_lookupName($usr_id);
280 
281  $confirm->addItem(
282  'participants[]',
283  $name['user_id'],
284  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
285  ilUtil::getImagePath('standard/icon_usr.svg')
286  );
287  }
288 
289  $this->tpl->setContent($confirm->getHTML());
290  }
static _lookupName(int $a_user_id)
lookup user name
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ilParticipants $participants
+ Here is the call graph for this function:

◆ deleteParticipants()

ilSessionMembershipGUI::deleteParticipants ( )
protected

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

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

292  : void
293  {
294  $this->checkPermission('manage_members');
295 
297 
298  if (!is_array($participants) || !count($participants)) {
299  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("no_checkbox"), true);
300  $this->ctrl->redirect($this, 'participants');
301  }
302 
303  foreach ($participants as $part_id) {
304  // delete role assignment
305  $this->getMembersObject()->delete($part_id);
306  // delete further settings
307  $event_part = new ilEventParticipants($this->getParentObject()->getId());
308  $event_part->setUserId($part_id);
309  $event_part->setParticipated(false);
310  $event_part->setRegistered(false);
311  $event_part->setMark('');
312  $event_part->setComment('');
313  $event_part->updateUser();
314  }
315 
316  $this->tpl->setOnScreenMessage('success', $this->lng->txt($this->getParentObject()->getType() . "_members_deleted"), true);
317  $this->ctrl->redirect($this, "participants");
318  }
checkPermission(string $a_permission, string $a_cmd="")
Check permission If not granted redirect to parent gui.
ilParticipants $participants
class ilEventParticipants
+ Here is the call graph for this function:

◆ getAttendanceListUserData()

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

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

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

333  : array
334  {
335  $data = $this->getMembersObject()->getEventParticipants()->getUser($user_id);
336  $data['registered'] = (bool) ($data['registered'] ?? false);
337  $data['participated'] = (bool) ($data['participated'] ?? false);
338 
339  if ($filters && $filters["registered"] && !$data["registered"]) {
340  return [];
341  }
342 
343 
344  $data['registered'] = $data['registered'] ?
345  $this->lng->txt('yes') :
346  $this->lng->txt('no');
347  $data['participated'] = $data['participated'] ?
348  $this->lng->txt('yes') :
349  $this->lng->txt('no');
350 
351  return $data;
352  }
+ Here is the call graph for this function:

◆ getMailContextOptions()

ilSessionMembershipGUI::getMailContextOptions ( )
protected

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

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

359  : array
360  {
361  $context_options = [
363  'ref_id' => $this->getParentObject()->getRefId(),
364  'ts' => time()
365  ];
366 
367  return $context_options;
368  }
+ Here is the call graph for this function:

◆ getMailMemberRoles()

ilSessionMembershipGUI::getMailMemberRoles ( )
protected

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

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

◆ getMemberTabName()

ilSessionMembershipGUI::getMemberTabName ( )
protected

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

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

354  : string
355  {
356  return $this->lng->txt($this->getParentObject()->getType() . '_members');
357  }
+ Here is the call graph for this function:

◆ getParticipantTableTitle()

ilSessionMembershipGUI::getParticipantTableTitle ( )
protected

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

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

184  : string
185  {
186  /*
187  * TODO this exact logic is also in ilSessionParticipantsTableGUI and ilMembershipGUI,
188  * should be centralized.
189  */
190  if ($member_ref = $this->tree->checkForParentType(
191  $this->getParentObject()->getRefId(),
192  'grp'
193  )) {
194  $member_ref_id = $member_ref;
195  } elseif ($member_ref = $this->tree->checkForParentType(
196  $this->getParentObject()->getRefId(),
197  'crs'
198  )) {
199  $member_ref_id = $member_ref;
200  } else {
201  $this->logger->warning('Cannot find parent course or group for ref_id: ' . $this->getParentObject()->getRefId());
202  $member_ref_id = $this->getParentObject()->getRefId();
203  }
204 
205  return sprintf(
206  $this->lng->txt('sess_mem_tbl_header'),
207  ilObjectFactory::getInstanceByRefId($member_ref_id)->getTitle(),
208  );
209  }
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
+ Here is the call graph for this function:

◆ getPrintMemberData()

ilSessionMembershipGUI::getPrintMemberData ( array  $a_members)

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

320  : array
321  {
322  return $a_members;
323  }

◆ initParticipantTableGUI()

ilSessionMembershipGUI::initParticipantTableGUI ( )
protected

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

References ilMembershipGUI\getParentObject().

174  {
175  $table = new ilSessionParticipantsTableGUI(
176  $this,
177  $this->getParentObject(),
178  'participants'
179  );
180  $table->init();
181  return $table;
182  }
+ Here is the call graph for this function:

◆ initParticipantTemplate()

ilSessionMembershipGUI::initParticipantTemplate ( )
protected

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

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

◆ initSubscriberTable()

ilSessionMembershipGUI::initSubscriberTable ( )
protected

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

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

212  {
213  $subscriber = new ilSubscriberTableGUI($this, $this->getParentObject(), true, false);
214  $subscriber->setTitle($this->lng->txt('group_new_registrations'));
215  return $subscriber;
216  }
GUI class for course/group subscriptions.
+ Here is the call graph for this function:

◆ initWaitingList()

ilSessionMembershipGUI::initWaitingList ( )
protected

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

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

159  {
160  $wait = new ilSessionWaitingList($this->getParentObject()->getId());
161  return $wait;
162  }
+ Here is the call graph for this function:

◆ updateMembers()

ilSessionMembershipGUI::updateMembers ( )
protected

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

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

218  : void
219  {
220  $this->checkPermission('manage_members');
221 
222  $part = ilParticipants::getInstance($this->getParentObject()->getRefId());
223 
224 
225  $wait = new ilSessionWaitingList($this->getParentObject()->getId());
226  $waiting = $wait->getUserIds();
227 
228  foreach ($this->requested_visible_participants as $part_id) {
229  if (in_array($part_id, $waiting)) {
230  // so not update users on waiting list
231  continue;
232  }
233 
234  $participated = (bool) ($this->requested_participated[$part_id] ?? false);
235  $registered = (bool) ($this->requested_registered[$part_id] ?? false);
236  $contact = (bool) ($this->requested_contact[$part_id] ?? false);
237  $excused = (bool) ($this->requested_excused[$part_id] ?? false);
238 
239  $part_id = (int) $part_id;
240 
241  if ($part->isAssigned($part_id) && !$participated && !$registered) {
242  $part->delete($part_id);
243  }
244  if (!$part->isAssigned($part_id) && ($participated || $registered)) {
245  $part->add($part_id, ilParticipants::IL_SESS_MEMBER);
246  }
247  $event_part = new ilEventParticipants($this->getParentObject()->getId());
248  $event_part->setUserId($part_id);
249  $event_part->setMark(ilUtil::stripSlashes($this->requested_mark[$part_id]));
250  $event_part->setComment(ilUtil::stripSlashes($this->requested_comment[$part_id]));
251  $event_part->setNotificationEnabled((bool) ($this->requested_notification[$part_id] ?? false));
252  $event_part->setParticipated($participated);
253  $event_part->setRegistered($registered);
254  $event_part->setContact($contact);
255  $event_part->setExcused($excused);
256  $event_part->updateUser();
257  }
258 
259  $this->tpl->setOnScreenMessage('success', $this->getLanguage()->txt('settings_saved'), true);
260  $this->getCtrl()->redirect($this, 'participants');
261  }
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
checkPermission(string $a_permission, string $a_cmd="")
Check permission If not granted redirect to parent gui.
static getInstance(int $a_ref_id)
class ilEventParticipants
+ Here is the call graph for this function:

Field Documentation

◆ $requested_comment

array ilSessionMembershipGUI::$requested_comment = []
protected

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

◆ $requested_contact

array ilSessionMembershipGUI::$requested_contact = []
protected

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

◆ $requested_excused

array ilSessionMembershipGUI::$requested_excused = []
protected

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

◆ $requested_mark

array ilSessionMembershipGUI::$requested_mark = []
protected

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

◆ $requested_notification

array ilSessionMembershipGUI::$requested_notification = []
protected

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

◆ $requested_participants

array ilSessionMembershipGUI::$requested_participants = []
protected

◆ $requested_participated

array ilSessionMembershipGUI::$requested_participated = []
protected

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

◆ $requested_registered

array ilSessionMembershipGUI::$requested_registered = []
protected

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

◆ $requested_visible_participants

array ilSessionMembershipGUI::$requested_visible_participants = []
protected

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


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