ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilLearningSequenceMembershipGUI Class Reference

GUI class for learning sequence membership features. More...

+ Inheritance diagram for ilLearningSequenceMembershipGUI:
+ Collaboration diagram for ilLearningSequenceMembershipGUI:

Public Member Functions

 __construct (ilObjectGUI $repository_gui, protected ilObject $obj, protected ilObjUserTracking $obj_user_tracking, protected ilPrivacySettings $privacy_settings, protected ilRbacReview $rbac_review, protected ilSetting $settings, protected ilToolbarGUI $toolbar, protected ILIAS\HTTP\Wrapper\RequestWrapper $request_wrapper, protected ArrayBasedRequestWrapper $post_wrapper, protected ILIAS\Refinery\Factory $refinery, protected ILIAS\UI\Factory $ui_factory)
 
 filterUserIdsByRbacOrPositionOfCurrentUser (array $a_user_ids)
 Filter user ids by access. More...
 
 assignMembers (array $user_ids, string $type)
 
 getParentObject ()
 
 getLocalTypeRole (bool $translation=false)
 
 readMemberData (array $usr_ids, array $columns=null)
 
 getPrintMemberData (array $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

 printMembers ()
 
 getDefaultCommand ()
 
 updateParticipantsStatus ()
 save in participants table More...
 
 initParticipantTableGUI ()
 
 initEditParticipantTableGUI (array $participants)
 
 initParticipantTemplate ()
 Init participant view template. More...
 
 initWaitingList ()
 
 getDefaultRole ()
 
 getMailMemberRoles ()
 
 setSubTabs (ilTabsGUI $tabs)
 
 showParticipantsToolbar ()
 
- 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...
 
 getMailButtonLabel ()
 
 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)
 

Additional Inherited Members

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

ilLearningSequenceMembershipGUI::__construct ( ilObjectGUI  $repository_gui,
protected ilObject  $obj,
protected ilObjUserTracking  $obj_user_tracking,
protected ilPrivacySettings  $privacy_settings,
protected ilRbacReview  $rbac_review,
protected ilSetting  $settings,
protected ilToolbarGUI  $toolbar,
protected ILIAS\HTTP\Wrapper\RequestWrapper  $request_wrapper,
protected ArrayBasedRequestWrapper  $post_wrapper,
protected ILIAS\Refinery\Factory  $refinery,
protected ILIAS\UI\Factory  $ui_factory 
)

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

References ILIAS\MetaData\Repository\Validation\Data\__construct().

46  {
47  parent::__construct($repository_gui, $obj);
48  }
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ assignMembers()

ilLearningSequenceMembershipGUI::assignMembers ( array  $user_ids,
string  $type 
)
Parameters
array<int>$user_ids

Definition at line 96 of file class.ilLearningSequenceMembershipGUI.php.

References ILIAS\Repository\ctrl(), ilLoggerFactory\getLogger(), getParentObject(), ilParticipants\IL_LSO_ADMIN, ilParticipants\IL_LSO_MEMBER, ILIAS\Repository\int(), ILIAS\Repository\lng(), and ilLearningSequenceMembershipMailNotification\TYPE_ADMISSION_MEMBER.

96  : bool
97  {
98  $object = $this->getParentObject();
99  $members = $this->getParentObject()->getLSParticipants();
100 
101  if (count($user_ids) == 0) {
102  $this->lng->loadLanguageModule('search');
103  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('search_err_user_not_exist'), true);
104  return false;
105  }
106 
107  $assigned = false;
108  foreach ($user_ids as $new_member) {
109  $new_member = (int) $new_member;
110 
111  if ($members->isAssigned($new_member)) {
112  continue;
113  }
114 
115  switch ($type) {
116  case $object->getDefaultAdminRole():
117  $members->add($new_member, ilParticipants::IL_LSO_ADMIN);
118  $members->sendNotification(
120  $new_member
121  );
122  $assigned = true;
123  break;
124  case $object->getDefaultMemberRole():
125  $members->add($new_member, ilParticipants::IL_LSO_MEMBER);
126  $members->sendNotification(
128  $new_member
129  );
130  $assigned = true;
131  break;
132  default:
133  if (in_array($type, $object->getLocalLearningSequenceRoles(true))) {
134  $members->add($new_member, ilParticipants::IL_LSO_MEMBER);
135  $members->updateRoleAssignments($new_member, array($type));
136  } else {
137  ilLoggerFactory::getLogger('lso')->notice(
138  'Can not find role with id .' . $type . ' to assign users.'
139  );
140  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("lso_cannot_find_role"), true);
141  return false;
142  }
143 
144  $members->sendNotification(
146  $new_member
147  );
148  $assigned = true;
149  break;
150  }
151  }
152 
153  if ($assigned) {
154  $this->tpl->setOnScreenMessage('success', $this->lng->txt("lso_msg_member_assigned"), true);
155  } else {
156  $this->tpl->setOnScreenMessage('success', $this->lng->txt('lso_users_already_assigned'), true);
157  }
158 
159  $this->ctrl->redirect($this, 'participants');
160  return $assigned;
161  }
static getLogger(string $a_component_id)
Get component logger.
+ Here is the call graph for this function:

◆ filterUserIdsByRbacOrPositionOfCurrentUser()

ilLearningSequenceMembershipGUI::filterUserIdsByRbacOrPositionOfCurrentUser ( array  $a_user_ids)

Filter user ids by access.

Parameters
int[]$a_user_ids
Returns
int[]

Definition at line 83 of file class.ilLearningSequenceMembershipGUI.php.

References ILIAS\Repository\access(), and getParentObject().

Referenced by getAttendanceListUserData().

83  : array
84  {
85  return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
86  'manage_members',
87  'manage_members',
88  $this->getParentObject()->getRefId(),
89  $a_user_ids
90  );
91  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getAttendanceListUserData()

ilLearningSequenceMembershipGUI::getAttendanceListUserData ( int  $user_id,
array  $filters = [] 
)
Returns
array<string, mixed>

Definition at line 283 of file class.ilLearningSequenceMembershipGUI.php.

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

283  : array
284  {
285  $data = array();
286 
287  if ($this->filterUserIdsByRbacOrPositionOfCurrentUser([$user_id])) {
288  $data = $this->member_data[$user_id];
289  if (array_key_exists('access_time', $data)) {
290  $data['access'] = $data['access_time'];
291  }
292  $data['progress'] = $this->lng->txt($data['progress']);
293  }
294 
295  return $data;
296  }
filterUserIdsByRbacOrPositionOfCurrentUser(array $a_user_ids)
Filter user ids by access.
+ Here is the call graph for this function:

◆ getDefaultCommand()

ilLearningSequenceMembershipGUI::getDefaultCommand ( )
protected

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

References $r, and ilMembershipGUI\$refinery.

72  : string
73  {
75  return $this->request_wrapper->retrieve("back_cmd", $r->byTrying([$r->kindlyTo()->string(), $r->always("members")]));
76  }
$r

◆ getDefaultRole()

ilLearningSequenceMembershipGUI::getDefaultRole ( )
protected

Definition at line 265 of file class.ilLearningSequenceMembershipGUI.php.

References getParentObject().

Referenced by showParticipantsToolbar().

265  : ?int
266  {
267  return $this->getParentObject()->getDefaultMemberRole();
268  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLocalTypeRole()

ilLearningSequenceMembershipGUI::getLocalTypeRole ( bool  $translation = false)
Returns
array<string, int>

Definition at line 244 of file class.ilLearningSequenceMembershipGUI.php.

References getParentObject().

244  : array
245  {
246  return $this->getParentObject()->getLocalLearningSequenceRoles($translation);
247  }
+ Here is the call graph for this function:

◆ getMailMemberRoles()

ilLearningSequenceMembershipGUI::getMailMemberRoles ( )
protected

◆ getParentObject()

ilLearningSequenceMembershipGUI::getParentObject ( )

Definition at line 209 of file class.ilLearningSequenceMembershipGUI.php.

Referenced by assignMembers(), filterUserIdsByRbacOrPositionOfCurrentUser(), getDefaultRole(), getLocalTypeRole(), initEditParticipantTableGUI(), initParticipantTableGUI(), initWaitingList(), readMemberData(), setSubTabs(), and updateParticipantsStatus().

210  {
211  $obj = parent::getParentObject();
212  if (!$obj instanceof ilObjLearningSequence) {
213  throw new Exception('Invalid class type ' . get_class($obj) . ". Expected ilObjLearningSequence.");
214  }
215  return $obj;
216  }
+ Here is the caller graph for this function:

◆ getPrintMemberData()

ilLearningSequenceMembershipGUI::getPrintMemberData ( array  $members)
Returns
array<string, mixed>

Definition at line 273 of file class.ilLearningSequenceMembershipGUI.php.

References ilMembershipGUI\$member_data, ilMembershipGUI\getParentGUI(), and readMemberData().

273  : array
274  {
275  $member_data = $this->readMemberData($members, array());
276 
277  return $this->getParentGUI()->addCustomData($member_data);
278  }
readMemberData(array $usr_ids, array $columns=null)
+ Here is the call graph for this function:

◆ initEditParticipantTableGUI()

ilLearningSequenceMembershipGUI::initEditParticipantTableGUI ( array  $participants)
protected

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

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

219  {
221  $this,
222  $this->getParentObject(),
223  $this->getParentObject()->getLSParticipants(),
224  $this->privacy_settings
225  );
226 
227  $table->setTitle($this->lng->txt($this->getParentObject()->getType() . '_header_edit_members'));
228  $table->setData($this->readMemberData($participants));
229 
230  return $table;
231  }
readMemberData(array $usr_ids, array $columns=null)
ilParticipants $participants
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:

◆ initParticipantTableGUI()

ilLearningSequenceMembershipGUI::initParticipantTableGUI ( )
protected

Definition at line 195 of file class.ilLearningSequenceMembershipGUI.php.

References ILIAS\Repository\access(), getParentObject(), ILIAS\Repository\lng(), and ILIAS\Repository\settings().

196  {
198  $this,
199  $this->getParentObject(),
200  $this->obj_user_tracking,
201  $this->privacy_settings,
202  $this->lng,
203  $this->access,
204  $this->rbac_review,
205  $this->settings
206  );
207  }
+ Here is the call graph for this function:

◆ initParticipantTemplate()

ilLearningSequenceMembershipGUI::initParticipantTemplate ( )
protected

Init participant view template.

Definition at line 236 of file class.ilLearningSequenceMembershipGUI.php.

236  : void
237  {
238  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.lso_edit_members.html', 'Modules/LearningSequence');
239  }

◆ initWaitingList()

ilLearningSequenceMembershipGUI::initWaitingList ( )
protected

Definition at line 260 of file class.ilLearningSequenceMembershipGUI.php.

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

261  {
262  return new ilLearningSequenceWaitingList($this->getParentObject()->getId());
263  }
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:

◆ printMembers()

ilLearningSequenceMembershipGUI::printMembers ( )
protected

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

References $DIC, ilMembershipGUI\checkPermission(), ilMembershipGUI\checkRbacOrPositionAccessBool(), ILIAS\Repository\ctrl(), ilMembershipGUI\initAttendanceList(), and ILIAS\Repository\lng().

50  : void
51  {
52  $this->checkPermission('read');
53  if ($this->checkRbacOrPositionAccessBool('manage_members', 'manage_members')) {
54  $back_cmd = 'participants';
55  } else {
56  $back_cmd = 'jump2UsersGallery';
57  }
58 
59  global $DIC;
60  $ilTabs = $DIC['ilTabs'];
61  $ilTabs->clearTargets();
62  $ilTabs->setBackTarget(
63  $this->lng->txt('back'),
64  $this->ctrl->getLinkTarget($this, $back_cmd)
65  );
66 
67  $list = $this->initAttendanceList();
68  $form = $list->initForm('printMembersOutput');
69  $this->tpl->setContent($form->getHTML());
70  }
checkPermission(string $a_permission, string $a_cmd="")
Check permission If not granted redirect to parent gui.
global $DIC
Definition: feed.php:28
initAttendanceList(bool $a_for_members=false)
checkRbacOrPositionAccessBool(string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)
+ Here is the call graph for this function:

◆ readMemberData()

ilLearningSequenceMembershipGUI::readMemberData ( array  $usr_ids,
array  $columns = null 
)
Parameters
array<int|string>$user_ids
string[]$columns
Returns
array<int|string, array>

Definition at line 254 of file class.ilLearningSequenceMembershipGUI.php.

References getParentObject().

Referenced by getPrintMemberData(), and initEditParticipantTableGUI().

254  : array
255  {
256  return $this->getParentObject()->readMemberData($usr_ids, $columns);
257  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubTabs()

ilLearningSequenceMembershipGUI::setSubTabs ( ilTabsGUI  $tabs)
protected

Definition at line 303 of file class.ilLearningSequenceMembershipGUI.php.

References ilMembershipGUI\$access, ilTabsGUI\addSubTabTarget(), ilMembershipGUI\checkRbacOrPositionAccessBool(), ILIAS\Repository\ctrl(), and getParentObject().

303  : void
304  {
306  'manage_members',
307  'manage_members',
308  $this->getParentObject()->getRefId()
309  );
310 
311  if ($access) {
312  $tabs->addSubTabTarget(
313  $this->getParentObject()->getType() . "_member_administration",
314  $this->ctrl->getLinkTarget($this, 'participants'),
315  "members",
316  get_class($this)
317  );
318 
319  $tabs->addSubTabTarget(
320  $this->getParentObject()->getType() . '_members_gallery',
321  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
322  'view',
323  'ilUsersGalleryGUI'
324  );
325  } elseif ($this->getParentObject()->getShowMembers()) {
326  $tabs->addSubTabTarget(
327  $this->getParentObject()->getType() . '_members_gallery',
328  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
329  'view',
330  'ilUsersGalleryGUI'
331  );
332  }
333  }
addSubTabTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)
ilAccessHandler $access
checkRbacOrPositionAccessBool(string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)
+ Here is the call graph for this function:

◆ showParticipantsToolbar()

ilLearningSequenceMembershipGUI::showParticipantsToolbar ( )
protected

Definition at line 335 of file class.ilLearningSequenceMembershipGUI.php.

References ILIAS\Repository\ctrl(), ilRepositorySearchGUI\fillAutoCompleteToolbar(), getDefaultRole(), ilMembershipGUI\getParentGUI(), ILIAS\Repository\lng(), ilMembershipGUI\showMailToMemberToolbarButton(), and ILIAS\Repository\toolbar().

335  : void
336  {
337  $toolbar_entries = [
338  'auto_complete_name' => $this->lng->txt('user'),
339  'user_type' => $this->getParentGUI()->getLocalRoles(),
340  'user_type_default' => $this->getDefaultRole(),
341  'submit_name' => $this->lng->txt('add'),
342  'add_search' => true
343  ];
344 
345  $search_params = ['crs', 'grp'];
346  $parent_container = $this->obj->getParentObjectInfo(
347  $this->obj->getRefId(),
348  $search_params
349  );
350  if (!is_null($parent_container)) {
351  $container_id = $parent_container['ref_id'];
352  $toolbar_entries['add_from_container'] = $container_id;
353  }
354 
356  $this,
357  $this->toolbar,
358  $toolbar_entries
359  );
360 
361  $this->toolbar->addSeparator();
362 
363  $this->toolbar->addComponent(
364  $this->ui_factory->button()->standard(
365  $this->lng->txt($this->getParentObject()->getType() . "_print_list"),
366  $this->ctrl->getLinkTarget($this, 'printMembers')
367  )
368  );
369 
370  $this->showMailToMemberToolbarButton($this->toolbar, 'participants');
371  }
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, ?string $a_back_cmd=null, bool $a_separator=false)
Show mail to member toolbar button.
static fillAutoCompleteToolbar(object $parent_object, ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
array( auto_complete_name = $lng->txt(&#39;user&#39;), auto_complete_size = 15, user_type = array(ilCoursePar...
+ Here is the call graph for this function:

◆ updateParticipantsStatus()

ilLearningSequenceMembershipGUI::updateParticipantsStatus ( )
protected

save in participants table

Definition at line 166 of file class.ilLearningSequenceMembershipGUI.php.

References ilMembershipGUI\$participants, ILIAS\Repository\ctrl(), getParentObject(), ILIAS\Repository\lng(), ILIAS\Repository\refinery(), and ilParticipants\updateNotification().

166  : void
167  {
168  $members = $this->getParentObject()->getLSParticipants();
169 
170  $participants = $this->post_wrapper->retrieve(
171  "visible_member_ids",
172  $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())
173  );
174 
175  $notification = [];
176  if ($this->post_wrapper->has('notification')) {
177  $notification = $this->post_wrapper->retrieve(
178  "notification",
179  $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())
180  );
181  }
182 
183  foreach ($participants as $participant) {
184  if ($members->isAdmin($participant)) {
185  $members->updateNotification($participant, in_array($participant, $notification));
186  continue;
187  }
188  $members->updateNotification($participant, false);
189  }
190 
191  $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
192  $this->ctrl->redirect($this, 'participants');
193  }
updateNotification(int $a_usr_id, bool $a_notification)
Update notification status.
ilParticipants $participants
+ Here is the call graph for this function:

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