ILIAS  release_7 Revision v7.30-3-g800a261c036
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, ilObject $repository_obj, ilObjUserTracking $obj_user_tracking, ilPrivacySettings $privacy_settings, ilLanguage $lng, ilCtrl $ctrl, ilAccess $access, ilRbacReview $rbac_review, ilSetting $settings, ilToolbarGUI $toolbar)
 
 getDefaultCommand ()
 Get default command. More...
 
 filterUserIdsByRbacOrPositionOfCurrentUser ($user_ids)
 Filter user ids by access. More...
 
 assignMembers (array $user_ids, string $type)
 
 getLocalTypeRole ($a_translation=false)
 
 readMemberData (array $user_ids, array $columns=null)
 Required for member table guis. More...
 
 getPrintMemberData (array $members)
 
 getAttendanceListUserData (int $user_id)
 
 getMembersObject ()
 Get member object. More...
 
- Public Member Functions inherited from ilMembershipGUI
 __construct (ilObjectGUI $repository_gui, ilObject $repository_obj)
 Constructor. More...
 
 getParentGUI ()
 Get parent gui. More...
 
 getParentObject ()
 Get parent object. More...
 
 getMembersObject ()
 Get member object. More...
 
 filterUserIdsByRbacOrPositionOfCurrentUser ($a_user_ids)
 Filter user ids by access. More...
 
 updateParticipants ()
 update members More...
 
 createMailSignature ()
 
 addMemberTab (ilTabsGUI $tabs, $a_is_participant=false)
 add member tab More...
 
 readMemberData (array $usr_ids, array $columns)
 Required for member table guis. More...
 
 getLocalRoles ()
 Get parent roles. More...
 
 confirmAssignSubscribers ()
 Show subscription confirmation. More...
 
 confirmRefuseSubscribers ()
 Refuse subscriber confirmation. More...
 
 assignSubscribers ()
 Do assignment of subscription request @global type $rbacsystem @global type $ilErr. More...
 
 confirmAssignFromWaitingList ()
 Assign from waiting list (confirmatoin) More...
 
 assignFromWaitingList ()
 Assign from waiting list @global type $rbacsystem. More...
 
 confirmRefuseFromList ()
 Refuse from waiting list (confirmation) More...
 

Protected Member Functions

 printMembers ()
 Print members. More...
 
 updateParticipantsStatus ()
 save in participants table More...
 
 initParticipantTableGUI ()
 
 initEditParticipantTableGUI (array $participants)
 
 initParticipantTemplate ()
 Init participant view template. More...
 
 updateLPFromStatus ()
 
 initWaitingList ()
 
 getDefaultRole ()
 
 getMailMemberRoles ()
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 showParticipantsToolbar ()
 Show participants toolbar. More...
 
- Protected Member Functions inherited from ilMembershipGUI
 getLanguage ()
 
 getCtrl ()
 
 getLogger ()
 
 getMailMemberRoles ()
 
 checkPermissionBool ($a_permission, $a_cmd='', $a_type='', $a_ref_id=0)
 Check permission. More...
 
 checkRbacOrPositionAccessBool ($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
 Check if rbac or position access is granted. More...
 
 checkPermission ($a_permission, $a_cmd="")
 Check permission If not granted redirect to parent gui. More...
 
 checkRbacOrPermissionAccess ($a_rbac_perm, $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 ($post_participants=array())
 Edit participants. More...
 
 confirmDeleteParticipants ()
 Show confirmation screen for participants deletion. More...
 
 deleteParticipants ()
 
 sendMailToSelectedUsers ()
 Send mail to selected users. More...
 
 getMailContextOptions ()
 
 membersMap ()
 Members map. More...
 
 mailMembersBtn ()
 Mail to members view @global type $ilToolbar. More...
 
 showParticipantsToolbar ()
 Show participants toolbar. More...
 
 showMemberExportToolbarButton (ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
 Show member export button. More...
 
 showMailToMemberToolbarButton (ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
 Show mail to member toolbar button. More...
 
 getDefaultCommand ()
 Get default command. More...
 
 getMemberTabName ()
 Get member tab name. More...
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 parseSubscriberTable ()
 Parse table of subscription request. More...
 
 initSubscriberTable ()
 
 refuseSubscribers ()
 Refuse subscribers @global type $rbacsystem. More...
 
 parseWaitingListTable ()
 Parse table of subscription request. More...
 
 refuseFromList ()
 refuse from waiting list More...
 
 addToClipboard ()
 Add selected users to user clipboard. More...
 
 getDefaultRole ()
 
 printMembers ()
 Print members. More...
 
 printMembersOutput ()
 print members output More...
 
 printForMembersOutput ()
 print members output More...
 
 jump2UsersGallery ()
 

Additional Inherited Members

- Protected Attributes inherited from ilMembershipGUI
 $lng = null
 
 $ctrl = null
 
 $logger = null
 
 $tpl
 
 $access
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLearningSequenceMembershipGUI::__construct ( ilObjectGUI  $repository_gui,
ilObject  $repository_obj,
ilObjUserTracking  $obj_user_tracking,
ilPrivacySettings  $privacy_settings,
ilLanguage  $lng,
ilCtrl  $ctrl,
ilAccess  $access,
ilRbacReview  $rbac_review,
ilSetting  $settings,
ilToolbarGUI  $toolbar 
)

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

29 {
30 parent::__construct($repository_gui, $repository_obj);
31
32 $this->obj_user_tracking = $obj_user_tracking;
33 $this->privacy_settings = $privacy_settings;
34 $this->lng = $lng;
35 $this->ctrl = $ctrl;
36 $this->access = $access;
37 $this->rbac_review = $rbac_review;
38 $this->settings = $settings;
39 $this->obj = $repository_obj;
40 $this->toolbar = $toolbar;
41 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
settings()
Definition: settings.php:2

References ilMembershipGUI\$access, ilMembershipGUI\$ctrl, ilMembershipGUI\$lng, ilMembershipGUI\$repository_gui, ILIAS\GlobalScreen\Provider\__construct(), and settings().

+ Here is the call graph for this function:

Member Function Documentation

◆ assignMembers()

ilLearningSequenceMembershipGUI::assignMembers ( array  $user_ids,
string  $type 
)

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

87 {
88 $object = $this->getParentObject();
89 $members = $this->getParentObject()->getLSParticipants();
90
91 if (count($user_ids) == 0) {
92 $this->lng->loadLanguageModule('search');
93 ilUtil::sendFailure($this->lng->txt('search_err_user_not_exist'), true);
94 return false;
95 }
96
97 $assigned = false;
98 foreach ($user_ids as $new_member) {
99 if ($members->isAssigned($new_member)) {
100 continue;
101 }
102
103 switch ($type) {
104 case $object->getDefaultAdminRole():
105 $members->add($new_member, IL_LSO_ADMIN);
106 $members->sendNotification(
108 $new_member
109 );
110 $assigned = true;
111 break;
112 case $object->getDefaultMemberRole():
113 $members->add($new_member, IL_LSO_MEMBER);
114 $members->sendNotification(
116 $new_member
117 );
118 $assigned = true;
119 break;
120 default:
121 if (in_array($type, $object->getLocalLearningSequenceRoles(true))) {
122 $members->add($new_member, IL_LSO_MEMBER);
123 $members->updateRoleAssignments($new_member, array($type));
124 } else {
125 ilLoggerFactory::getLogger('lso')->notice('Can not find role with id .' . $type . ' to assign users.');
126 ilUtil::sendFailure($this->lng->txt("lso_cannot_find_role"), true);
127 return false;
128 }
129
130 $members->sendNotification(
132 $new_member
133 );
134 $assigned = true;
135 break;
136 }
137 }
138
139 if ($assigned) {
140 ilUtil::sendSuccess($this->lng->txt("lso_msg_member_assigned"), true);
141 } else {
142 ilUtil::sendSuccess($this->lng->txt('lso_users_already_assigned'), true);
143 }
144
145 $this->ctrl->redirect($this, 'participants');
146 }
const IL_LSO_ADMIN
const IL_LSO_MEMBER
static getLogger($a_component_id)
Get component logger.
getParentObject()
Get parent object.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$type

References $type, ilLoggerFactory\getLogger(), ilMembershipGUI\getParentObject(), IL_LSO_ADMIN, IL_LSO_MEMBER, ilUtil\sendFailure(), and ilLearningSequenceMembershipMailNotification\TYPE_ADMISSION_MEMBER.

+ Here is the call graph for this function:

◆ filterUserIdsByRbacOrPositionOfCurrentUser()

ilLearningSequenceMembershipGUI::filterUserIdsByRbacOrPositionOfCurrentUser (   $user_ids)

Filter user ids by access.

Parameters
int[]$a_user_ids
Returns
int[]

Reimplemented from ilMembershipGUI.

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

77 {
78 return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
79 'manage_members',
80 'manage_members',
81 $this->getParentObject()->getRefId(),
82 $user_ids
83 );
84 }

References ilMembershipGUI\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)

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

242 : array
243 {
244 $data = array();
245
246 if ($this->filterUserIdsByRbacOrPositionOfCurrentUser([$user_id])) {
247 $data = $this->member_data[$user_id];
248 $data['access'] = $data['access_time'];
249 $data['progress'] = $this->lng->txt($data['progress']);
250 }
251
252 return $data;
253 }
filterUserIdsByRbacOrPositionOfCurrentUser($user_ids)
Filter user ids by access.
$data
Definition: storeScorm.php:23

References $data, and filterUserIdsByRbacOrPositionOfCurrentUser().

+ Here is the call graph for this function:

◆ getDefaultCommand()

ilLearningSequenceMembershipGUI::getDefaultCommand ( )

Get default command.

Returns
string

Reimplemented from ilMembershipGUI.

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

66 {
67 $back_cmd = $_GET['back_cmd'];
68 return $back_cmd;
69 }
$_GET["client_id"]

References $_GET.

◆ getDefaultRole()

ilLearningSequenceMembershipGUI::getDefaultRole ( )
protected
Returns
null

Reimplemented from ilMembershipGUI.

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

229 : int
230 {
231 return $this->getParentObject()->getDefaultMemberRole();
232 }

References ilMembershipGUI\getParentObject().

Referenced by showParticipantsToolbar().

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

◆ getLocalTypeRole()

ilLearningSequenceMembershipGUI::getLocalTypeRole (   $a_translation = false)

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

210 {
211 return $this->getParentObject()->getLocalLearningSequenceRoles($a_translation);
212 }

References ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ getMailMemberRoles()

ilLearningSequenceMembershipGUI::getMailMemberRoles ( )
protected
Returns
\ilMailMemberLearningSequenceRoles

Reimplemented from ilMembershipGUI.

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

◆ getMembersObject()

ilLearningSequenceMembershipGUI::getMembersObject ( )

Get member object.

Returns
ilParticipants

Reimplemented from ilMembershipGUI.

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

256 {
257 if ($this->participants instanceof ilParticipants) {
258 return $this->participants;
259 }
260 return $this->participants = ilParticipants::getInstance($this->getParentObject()->getRefId());
261 }
participants()
Show participant table, subscriber table, wating list table;.
static getInstance($a_ref_id)
Get instance by ref_id.

References ilParticipants\getInstance(), ilMembershipGUI\getParentObject(), and ilMembershipGUI\participants().

+ Here is the call graph for this function:

◆ getPrintMemberData()

ilLearningSequenceMembershipGUI::getPrintMemberData ( array  $members)

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

234 : array
235 {
236 $member_data = $this->readMemberData($members, array());
237 $member_data = $this->getParentGUI()->addCustomData($member_data);
238
239 return $member_data;
240 }
readMemberData(array $user_ids, array $columns=null)
Required for member table guis.
getParentGUI()
Get parent gui.

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

+ Here is the call graph for this function:

◆ initEditParticipantTableGUI()

ilLearningSequenceMembershipGUI::initEditParticipantTableGUI ( array  $participants)
protected

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

185 {
187 $this,
188 $this->getParentObject(),
189 $this->getParentObject()->getLSParticipants(),
190 $this->privacy_settings,
191 $this->lng,
192 $this->ctrl
193 );
194
195 $table->setTitle($this->lng->txt($this->getParentObject()->getType() . '_header_edit_members'));
196 $table->setData($this->readMemberData($participants));
197
198 return $table;
199 }

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

+ Here is the call graph for this function:

◆ initParticipantTableGUI()

ilLearningSequenceMembershipGUI::initParticipantTableGUI ( )
protected

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

171 {
173 $this,
174 $this->getParentObject(),
175 $this->obj_user_tracking,
176 $this->privacy_settings,
177 $this->lng,
178 $this->access,
179 $this->rbac_review,
180 $this->settings
181 );
182 }

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

+ Here is the call graph for this function:

◆ initParticipantTemplate()

ilLearningSequenceMembershipGUI::initParticipantTemplate ( )
protected

Init participant view template.

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

205 {
206 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.lso_edit_members.html', 'Modules/LearningSequence');
207 }

◆ initWaitingList()

ilLearningSequenceMembershipGUI::initWaitingList ( )
protected

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

References ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

◆ printMembers()

ilLearningSequenceMembershipGUI::printMembers ( )
protected

Print members.

Todo:
: refactor to own class

Reimplemented from ilMembershipGUI.

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

44 {
45 $this->checkPermission('read');
46 if ($this->checkRbacOrPositionAccessBool('manage_members', 'manage_members')) {
47 $back_cmd = 'participants';
48 } else {
49 $back_cmd = 'jump2UsersGallery';
50 }
51
52 global $DIC;
53 $ilTabs = $DIC['ilTabs'];
54 $ilTabs->clearTargets();
55 $ilTabs->setBackTarget(
56 $this->lng->txt('back'),
57 $this->ctrl->getLinkTarget($this, $back_cmd)
58 );
59
60 $list = $this->initAttendanceList();
61 $form = $list->initForm('printMembersOutput');
62 $this->tpl->setContent($form->getHTML());
63 }
checkPermission($a_permission, $a_cmd="")
Check permission If not granted redirect to parent gui.
checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
Check if rbac or position access is granted.
global $DIC
Definition: goto.php:24

References $DIC, ilMembershipGUI\checkPermission(), and ilMembershipGUI\checkRbacOrPositionAccessBool().

+ Here is the call graph for this function:

◆ readMemberData()

ilLearningSequenceMembershipGUI::readMemberData ( array  $usr_ids,
array  $columns = null 
)

Required for member table guis.

Has to be refactored and should be locate in ilObjCourse, ilObjGroup instead of GUI

Returns
array

Reimplemented from ilMembershipGUI.

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

215 {
216 return $this->getParentObject()->readMemberData($user_ids, $columns);
217 }
if(! $in) $columns
Definition: Utf8Test.php:45

References $columns, and ilMembershipGUI\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 271 of file class.ilLearningSequenceMembershipGUI.php.

272 {
274 'manage_members',
275 'manage_members',
276 $this->getParentObject()->getRefId()
277 );
278
279 if ($access) {
280 $tabs->addSubTabTarget(
281 $this->getParentObject()->getType() . "_member_administration",
282 $this->ctrl->getLinkTarget($this, 'participants'),
283 "members",
284 get_class($this)
285 );
286
287 $tabs->addSubTabTarget(
288 $this->getParentObject()->getType() . '_members_gallery',
289 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
290 'view',
291 'ilUsersGalleryGUI'
292 );
293 } elseif ($this->getParentObject()->getShowMembers()) {
294 $tabs->addSubTabTarget(
295 $this->getParentObject()->getType() . '_members_gallery',
296 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilUsersGalleryGUI')),
297 'view',
298 'ilUsersGalleryGUI'
299 );
300 }
301 }
addSubTabTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
DEPRECATED.

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

+ Here is the call graph for this function:

◆ showParticipantsToolbar()

ilLearningSequenceMembershipGUI::showParticipantsToolbar ( )
protected

Show participants toolbar.

Reimplemented from ilMembershipGUI.

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

304 {
305 $toolbar_entries = [
306 'auto_complete_name' => $this->lng->txt('user'),
307 'user_type' => $this->getParentGUI()->getLocalRoles(),
308 'user_type_default' => $this->getDefaultRole(),
309 'submit_name' => $this->lng->txt('add'),
310 'add_search' => true,
311 ];
312
313
314 $search_params = ['crs', 'grp'];
315 $parent_container = $this->obj->getParentObjectInfo(
316 (int) $this->obj->getRefId(),
317 $search_params
318 );
319 if (!is_null($parent_container)) {
320 $container_id = $parent_container['ref_id'];
321 $toolbar_entries['add_from_container'] = $container_id;
322 }
323
325 $this,
326 $this->toolbar,
327 $toolbar_entries
328 );
329
330 $this->toolbar->addSeparator();
331
332 $this->toolbar->addButton(
333 $this->lng->txt($this->getParentObject()->getType() . "_print_list"),
334 $this->ctrl->getLinkTarget($this, 'printMembers')
335 );
336
337 $this->showMailToMemberToolbarButton($this->toolbar, 'participants', false);
338 }
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
Show mail to member toolbar button.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with

References ilRepositorySearchGUI\fillAutoCompleteToolbar(), getDefaultRole(), ilMembershipGUI\getParentGUI(), and ilMembershipGUI\showMailToMemberToolbarButton().

+ Here is the call graph for this function:

◆ updateLPFromStatus()

ilLearningSequenceMembershipGUI::updateLPFromStatus ( )
protected

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

220 {
221 return null;
222 }

◆ updateParticipantsStatus()

ilLearningSequenceMembershipGUI::updateParticipantsStatus ( )
protected

save in participants table

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

152 {
153 $members = $this->getParentObject()->getLSParticipants();
154
155 $participants = (array) $_POST['visible_member_ids'];
156 $notification = (array) $_POST['notification'];
157
158 foreach ($participants as $participant) {
159 if ($members->isAdmin($participant)) {
160 $members->updateNotification($participant, in_array($participant, $notification));
161 continue;
162 }
163 $members->updateNotification($participant, false);
164 }
165
166 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
167 $this->ctrl->redirect($this, 'participants');
168 }
$_POST["username"]

References $_POST, and ilMembershipGUI\getParentObject().

+ Here is the call graph for this function:

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