ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 ()
 
 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)
 
 getPrintMemberData (array $members)
 
 getAttendanceListUserData (int $user_id)
 
 getMembersObject ()
 
- 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 type $rbacsystem type $ilErr. More...
 
 confirmAssignFromWaitingList ()
 Assign from waiting list (confirmatoin) More...
 
 assignFromWaitingList ()
 Assign from waiting list type $rbacsystem. More...
 
 confirmRefuseFromList ()
 Refuse from waiting list (confirmation) More...
 

Protected Member Functions

 printMembers ()
 
 updateParticipantsStatus ()
 save in participants table More...
 
 initParticipantTableGUI ()
 
 initEditParticipantTableGUI (array $participants)
 
 initParticipantTemplate ()
 Init participant view template. More...
 
 updateLPFromStatus ()
 
 initWaitingList ()
 
 getDefaultRole ()
 
 getMailMemberRoles ()
 
 setSubTabs (ilTabsGUI $tabs)
 
 showParticipantsToolbar ()
 
- 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 ()
 Get mail context options. More...
 
 membersMap ()
 Members map. More...
 
 mailMembersBtn ()
 Mail to members view 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 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.

References ilMembershipGUI\$access, ilMembershipGUI\$ctrl, ilMembershipGUI\$lng, and settings().

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  }
settings()
Definition: settings.php:2
+ 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.

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

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  }
$type
const IL_LSO_MEMBER
const IL_LSO_ADMIN
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getLogger($a_component_id)
Get component logger.
getParentObject()
Get parent object.
+ 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[]

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

References ilMembershipGUI\getParentObject().

Referenced by getAttendanceListUserData().

77  {
78  return $this->access->filterUserIdsByRbacOrPositionOfCurrentUser(
79  'manage_members',
80  'manage_members',
81  $this->getParentObject()->getRefId(),
82  $user_ids
83  );
84  }
getParentObject()
Get parent object.
+ 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.

References $data, and filterUserIdsByRbacOrPositionOfCurrentUser().

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: bench.php:6
+ Here is the call graph for this function:

◆ getDefaultCommand()

ilLearningSequenceMembershipGUI::getDefaultCommand ( )

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

References $_GET.

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

◆ getDefaultRole()

ilLearningSequenceMembershipGUI::getDefaultRole ( )
protected

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

References ilMembershipGUI\getParentObject().

Referenced by showParticipantsToolbar().

229  : int
230  {
231  return $this->getParentObject()->getDefaultMemberRole();
232  }
getParentObject()
Get parent object.
+ 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.

References ilMembershipGUI\getParentObject().

210  {
211  return $this->getParentObject()->getLocalLearningSequenceRoles($a_translation);
212  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ getMailMemberRoles()

ilLearningSequenceMembershipGUI::getMailMemberRoles ( )
protected

◆ getMembersObject()

ilLearningSequenceMembershipGUI::getMembersObject ( )

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

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

256  {
257  if ($this->participants instanceof ilParticipants) {
258  return $this->participants;
259  }
260  return $this->participants = ilParticipants::getInstance($this->getParentObject()->getRefId());
261  }
static getInstance($a_ref_id)
Get instance by ref_id.
participants()
Show participant table, subscriber table, wating list table;.
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ getPrintMemberData()

ilLearningSequenceMembershipGUI::getPrintMemberData ( array  $members)

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

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

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)
getParentGUI()
Get parent gui.
+ Here is the call graph for this function:

◆ initEditParticipantTableGUI()

ilLearningSequenceMembershipGUI::initEditParticipantTableGUI ( array  $participants)
protected

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

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

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  }
readMemberData(array $user_ids, array $columns=null)
getParentObject()
Get parent object.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:

◆ initParticipantTableGUI()

ilLearningSequenceMembershipGUI::initParticipantTableGUI ( )
protected

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

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

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  }
settings()
Definition: settings.php:2
getParentObject()
Get parent object.
+ 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

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

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

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  }
if(isset($_REQUEST['delete'])) $list
Definition: registry.php:41
global $DIC
Definition: saml.php:7
checkPermission($a_permission, $a_cmd="")
Check permission If not granted redirect to parent gui.
if(isset($_POST['submit'])) $form
checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
Check if rbac or position access is granted.
+ Here is the call graph for this function:

◆ readMemberData()

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

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

References $columns, and ilMembershipGUI\getParentObject().

Referenced by getPrintMemberData(), and initEditParticipantTableGUI().

215  {
216  return $this->getParentObject()->readMemberData($user_ids, $columns);
217  }
getParentObject()
Get parent object.
if(! $in) $columns
Definition: Utf8Test.php:45
+ 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 271 of file class.ilLearningSequenceMembershipGUI.php.

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

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.
getParentObject()
Get parent object.
checkRbacOrPositionAccessBool($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
Check if rbac or position access is granted.
+ Here is the call graph for this function:

◆ showParticipantsToolbar()

ilLearningSequenceMembershipGUI::showParticipantsToolbar ( )
protected

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

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

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  $search_params = ['crs', 'grp'];
314  $parent_container = $this->obj->getParentObjectInfo(
315  (int) $this->obj->getRefId(),
316  $search_params
317  );
318  if (!is_null($parent_container)) {
319  $container_id = $parent_container['ref_id'];
320  $toolbar_entries['add_from_container'] = $container_id;
321  }
322 
324  $this,
325  $this->toolbar,
326  $toolbar_entries
327  );
328 
329  $this->toolbar->addSeparator();
330 
331  $this->toolbar->addButton(
332  $this->lng->txt($this->getParentObject()->getType() . "_print_list"),
333  $this->ctrl->getLinkTarget($this, 'printMembers')
334  );
335 
336  $this->showMailToMemberToolbarButton($this->toolbar, 'participants', false);
337  }
showMailToMemberToolbarButton(ilToolbarGUI $toolbar, $a_back_cmd=null, $a_separator=false)
Show mail to member toolbar button.
getParentGUI()
Get parent gui.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
+ 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.

References $_POST, and ilMembershipGUI\getParentObject().

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  }
getParentObject()
Get parent object.
$_POST["username"]
+ Here is the call graph for this function:

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