ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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

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

46 {
48 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ilMembershipGUI\$repository_gui, and ILIAS\GlobalScreen\Provider\__construct().

+ 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 111 of file class.ilLearningSequenceMembershipGUI.php.

111 : bool
112 {
113 $object = $this->getParentObject();
114 $members = $this->getParentObject()->getLSParticipants();
115
116 if (count($user_ids) == 0) {
117 $this->lng->loadLanguageModule('search');
118 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('search_err_user_not_exist'), true);
119 return false;
120 }
121
122 $assigned = false;
123 foreach ($user_ids as $new_member) {
124 $new_member = (int) $new_member;
125
126 if ($members->isAssigned($new_member)) {
127 continue;
128 }
129
130 switch ($type) {
131 case $object->getDefaultAdminRole():
132 $members->add($new_member, ilParticipants::IL_LSO_ADMIN);
133 $members->sendNotification(
135 $new_member
136 );
137 $assigned = true;
138 break;
139 case $object->getDefaultMemberRole():
140 $members->add($new_member, ilParticipants::IL_LSO_MEMBER);
141 $members->sendNotification(
143 $new_member
144 );
145 $assigned = true;
146 break;
147 default:
148 if (in_array($type, $object->getLocalLearningSequenceRoles(true))) {
149 $members->add($new_member, ilParticipants::IL_LSO_MEMBER);
150 $members->updateRoleAssignments($new_member, array($type));
151 } else {
152 ilLoggerFactory::getLogger('lso')->notice(
153 'Can not find role with id .' . $type . ' to assign users.'
154 );
155 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("lso_cannot_find_role"), true);
156 return false;
157 }
158
159 $members->sendNotification(
161 $new_member
162 );
163 $assigned = true;
164 break;
165 }
166 }
167
168 if ($assigned) {
169 $this->tpl->setOnScreenMessage('success', $this->lng->txt("lso_msg_member_assigned"), true);
170 } else {
171 $this->tpl->setOnScreenMessage('success', $this->lng->txt('lso_users_already_assigned'), true);
172 }
173
174 $this->ctrl->redirect($this, 'participants');
175 return $assigned;
176 }
static getLogger(string $a_component_id)
Get component logger.

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.

+ 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[]

Reimplemented from ilMembershipGUI.

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

98 : array
99 {
100 return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
101 'manage_members',
102 'manage_members',
103 $this->getParentObject()->getRefId(),
104 $a_user_ids
105 );
106 }

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

Referenced by getAttendanceListUserData().

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

Reimplemented from ilMembershipGUI.

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

305 : array
306 {
307 $data = array();
308
310 $data = $this->member_data[$user_id];
311 if (array_key_exists('access_time', $data)) {
312 $data['access'] = $data['access_time'];
313 }
314 $data['progress'] = $this->lng->txt($data['progress']);
315 }
316
317 return $data;
318 }
filterUserIdsByRbacOrPositionOfCurrentUser(array $a_user_ids)
Filter user ids by access.

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

+ Here is the call graph for this function:

◆ getDefaultCommand()

ilLearningSequenceMembershipGUI::getDefaultCommand ( )
protected

Reimplemented from ilMembershipGUI.

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

87 : string
88 {
89 $r = $this->refinery;
90 return $this->request_wrapper->retrieve("back_cmd", $r->byTrying([$r->kindlyTo()->string(), $r->always("members")]));
91 }

References ilMembershipGUI\$refinery.

◆ getDefaultRole()

ilLearningSequenceMembershipGUI::getDefaultRole ( )
protected

Reimplemented from ilMembershipGUI.

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

287 : ?int
288 {
289 return $this->getParentObject()->getDefaultMemberRole();
290 }

References getParentObject().

Referenced by showParticipantsToolbar().

+ 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 266 of file class.ilLearningSequenceMembershipGUI.php.

266 : array
267 {
268 return $this->getParentObject()->getLocalLearningSequenceRoles($translation);
269 }

References getParentObject().

+ Here is the call graph for this function:

◆ getMailMemberRoles()

ilLearningSequenceMembershipGUI::getMailMemberRoles ( )
protected

◆ getParentObject()

ilLearningSequenceMembershipGUI::getParentObject ( )

Reimplemented from ilMembershipGUI.

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

232 {
233 $obj = parent::getParentObject();
234 if (!$obj instanceof ilObjLearningSequence) {
235 throw new Exception('Invalid class type ' . get_class($obj) . ". Expected ilObjLearningSequence.");
236 }
237 return $obj;
238 }

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

+ Here is the caller graph for this function:

◆ getPrintMemberData()

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

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

295 : array
296 {
297 $member_data = $this->readMemberData($members, array());
298
299 return $this->getParentGUI()->addCustomData($member_data);
300 }
readMemberData(array $usr_ids, ?array $columns=null)

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

+ Here is the call graph for this function:

◆ initEditParticipantTableGUI()

ilLearningSequenceMembershipGUI::initEditParticipantTableGUI ( array  $participants)
protected

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

241 {
243 $this,
244 $this->getParentObject(),
245 $this->getParentObject()->getLSParticipants(),
246 $this->privacy_settings
247 );
248
249 $table->setTitle($this->lng->txt($this->getParentObject()->getType() . '_header_edit_members'));
250 $table->setData($this->readMemberData($participants));
251
252 return $table;
253 }
ilParticipants $participants

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

+ Here is the call graph for this function:

◆ initParticipantTableGUI()

ilLearningSequenceMembershipGUI::initParticipantTableGUI ( )
protected

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

217 {
219 $this,
220 $this->getParentObject(),
221 $this->obj_user_tracking,
222 $this->privacy_settings,
223 $this->lng,
224 $this->access,
225 $this->rbac_review,
226 $this->settings,
227 $this->profile
228 );
229 }

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

+ Here is the call graph for this function:

◆ initParticipantTemplate()

ilLearningSequenceMembershipGUI::initParticipantTemplate ( )
protected

Init participant view template.

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

258 : void
259 {
260 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.lso_edit_members.html', 'components/ILIAS/LearningSequence');
261 }

◆ initWaitingList()

ilLearningSequenceMembershipGUI::initWaitingList ( )
protected

◆ members()

ilLearningSequenceMembershipGUI::members ( )
protected

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

50 : void
51 {
52 $may_manage_members = $this->checkRbacOrPositionAccessBool(
53 'manage_members',
54 'manage_members',
55 $this->getParentObject()->getRefId()
56 );
57
58 if ($may_manage_members) {
59 $this->participants();
60 } else {
61 $this->jump2UsersGallery();
62 }
63 }
participants()
Show participant table, subscriber table, wating list table;.
checkRbacOrPositionAccessBool(string $a_rbac_perm, string $a_pos_perm, int $a_ref_id=0)

References ilMembershipGUI\checkRbacOrPositionAccessBool(), getParentObject(), ilMembershipGUI\jump2UsersGallery(), and ilMembershipGUI\participants().

+ Here is the call graph for this function:

◆ printMembers()

ilLearningSequenceMembershipGUI::printMembers ( )
protected
Todo:
: refactor to own class

Reimplemented from ilMembershipGUI.

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

65 : void
66 {
67 $this->checkPermission('read');
68 if ($this->checkRbacOrPositionAccessBool('manage_members', 'manage_members')) {
69 $back_cmd = 'participants';
70 } else {
71 $back_cmd = 'jump2UsersGallery';
72 }
73
74 global $DIC;
75 $ilTabs = $DIC['ilTabs'];
76 $ilTabs->clearTargets();
77 $ilTabs->setBackTarget(
78 $this->lng->txt('back'),
79 $this->ctrl->getLinkTarget($this, $back_cmd)
80 );
81
82 $list = $this->initAttendanceList();
83 $form = $list->initForm('printMembersOutput');
84 $this->tpl->setContent($form->getHTML());
85 }
checkPermission(string $a_permission, string $a_cmd="")
Check permission If not granted redirect to parent gui.
initAttendanceList(bool $a_for_members=false)
global $DIC
Definition: shib_login.php:26

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

+ 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 276 of file class.ilLearningSequenceMembershipGUI.php.

276 : array
277 {
278 return $this->getParentObject()->readMemberData($usr_ids, $columns);
279 }

References getParentObject().

Referenced by getPrintMemberData(), and initEditParticipantTableGUI().

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

◆ setSubTabs()

ilLearningSequenceMembershipGUI::setSubTabs ( ilTabsGUI  $tabs)
protected

Set sub tabs.

Reimplemented from ilMembershipGUI.

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

325 : void
326 {
328 'manage_members',
329 'manage_members',
330 $this->getParentObject()->getRefId()
331 );
332
333 if ($access) {
335 $this->getParentObject()->getType() . "_member_administration",
336 $this->ctrl->getLinkTarget($this, 'participants'),
337 "members",
338 get_class($this)
339 );
340
342 $this->getParentObject()->getType() . '_members_gallery',
343 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
344 'view',
345 'ilUsersGalleryGUI'
346 );
347 } elseif ($this->getParentObject()->getShowMembers()) {
349 $this->getParentObject()->getType() . '_members_gallery',
350 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
351 'view',
352 'ilUsersGalleryGUI'
353 );
354 }
355 }
ilAccessHandler $access
addSubTabTarget(string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)

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

+ Here is the call graph for this function:

◆ showParticipantsToolbar()

ilLearningSequenceMembershipGUI::showParticipantsToolbar ( )
protected

Show participants toolbar.

Reimplemented from ilMembershipGUI.

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

357 : void
358 {
359 $toolbar_entries = [
360 'auto_complete_name' => $this->lng->txt('user'),
361 'user_type' => $this->getParentGUI()->getLocalRoles(),
362 'user_type_default' => $this->getDefaultRole(),
363 'submit_name' => $this->lng->txt('add'),
364 'add_search' => true
365 ];
366
367 $search_params = ['crs', 'grp'];
368 $parent_container = $this->obj->getParentObjectInfo(
369 $this->obj->getRefId(),
370 $search_params
371 );
372 if (!is_null($parent_container)) {
373 $container_id = $parent_container['ref_id'];
374 $toolbar_entries['add_from_container'] = $container_id;
375 }
376
378 $this,
379 $this->toolbar,
380 $toolbar_entries
381 );
382
383 $this->toolbar->addSeparator();
384
385 $this->toolbar->addComponent(
386 $this->ui_factory->button()->standard(
387 $this->lng->txt($this->getParentObject()->getType() . "_print_list"),
388 $this->ctrl->getLinkTarget($this, 'printMembers')
389 )
390 );
391
392 $this->showMailToMemberToolbarButton($this->toolbar, 'participants');
393 }
return true
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('user'), auto_complete_size = 15, user_type = array(ilCoursePar...

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

+ Here is the call graph for this function:

◆ updateParticipantsStatus()

ilLearningSequenceMembershipGUI::updateParticipantsStatus ( )
protected

save in participants table

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

181 : void
182 {
183 $members = $this->getParentObject()->getLSParticipants();
184
185 $participants = $this->post_wrapper->retrieve(
186 "visible_member_ids",
187 $this->refinery->byTrying([
188 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int()),
189 $this->refinery->always([])
190 ])
191 );
192
193
194
195
196 $notification = [];
197 if ($this->post_wrapper->has('notification')) {
198 $notification = $this->post_wrapper->retrieve(
199 "notification",
200 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())
201 );
202 }
203
204 foreach ($participants as $participant) {
205 if ($members->isAdmin($participant)) {
206 $members->updateNotification($participant, in_array($participant, $notification));
207 continue;
208 }
209 $members->updateNotification($participant, false);
210 }
211
212 $this->tpl->setOnScreenMessage('success', $this->lng->txt('settings_saved'), true);
213 $this->ctrl->redirect($this, 'participants');
214 }
updateNotification(int $a_usr_id, bool $a_notification)
Update notification status.

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

+ Here is the call graph for this function:

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