ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSessionMembershipGUI Class Reference

GUI class for membership features. More...

+ Inheritance diagram for ilSessionMembershipGUI:
+ Collaboration diagram for ilSessionMembershipGUI:

Public Member Functions

 getPrintMemberData ($a_members)
 
 getAttendanceListUserData ($a_user_id, $a_filters)
 Callback from attendance list. 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 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

 getMailMemberRoles ()
 
 checkRbacOrPositionAccessBool ($a_rbac_perm, $a_pos_perm, $a_ref_id=0)
 No support for positions in sessions Check if rbac or position access is granted. More...
 
 initParticipantTemplate ()
 Init participant view template. More...
 
 initWaitingList ()
 init waiting list More...
 
 initParticipantTableGUI ()
 
 initSubscriberTable ()
 
 updateMembers ()
 update entries from member table More...
 
 confirmDeleteParticipants ()
 Show confirmation screen for participants deletion. More...
 
 deleteParticipants ()
 Delete participants type $rbacreview type $rbacsystem type $ilAccess type $ilUser. More...
 
 canAddOrSearchUsers ()
 
 getMemberTabName ()
 Get member tab name. More...
 
 getMailContextOptions ()
 
- 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

Member Function Documentation

◆ canAddOrSearchUsers()

ilSessionMembershipGUI::canAddOrSearchUsers ( )
protected

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

226  {
227  return false;
228  }

◆ checkRbacOrPositionAccessBool()

ilSessionMembershipGUI::checkRbacOrPositionAccessBool (   $a_rbac_perm,
  $a_pos_perm,
  $a_ref_id = 0 
)
protected

No support for positions in sessions Check if rbac or position access is granted.

Parameters
string$a_rbac_perm
string$a_pos_perm
int$a_ref_id

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

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

36  {
37  if (!$a_ref_id) {
38  $a_ref_id = $this->getParentObject()->getRefId();
39  }
40  return $this->checkPermissionBool($a_rbac_perm, $a_ref_id);
41  }
checkPermissionBool($a_permission, $a_cmd='', $a_type='', $a_ref_id=0)
Check permission.
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ confirmDeleteParticipants()

ilSessionMembershipGUI::confirmDeleteParticipants ( )
protected

Show confirmation screen for participants deletion.

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

References $_POST, $name, ilObjUser\_lookupName(), ilUtil\getImagePath(), and ilUtil\sendFailure().

143  {
144  $participants = (array) $_POST['participants'];
145 
146  if (!count($participants)) {
147  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
148  $this->ctrl->redirect($this, 'participants');
149  }
150 
151  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
152  $confirm = new ilConfirmationGUI();
153  $confirm->setFormAction($this->ctrl->getFormAction($this, 'confirmDeleteParticipants'));
154  $confirm->setHeaderText($this->lng->txt($this->getParentObject()->getType() . '_header_delete_members'));
155  $confirm->setConfirm($this->lng->txt('confirm'), 'deleteParticipants');
156  $confirm->setCancel($this->lng->txt('cancel'), 'participants');
157 
158  foreach ($participants as $usr_id) {
159  $name = ilObjUser::_lookupName($usr_id);
160 
161  $confirm->addItem(
162  'participants[]',
163  $name['user_id'],
164  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
165  ilUtil::getImagePath('icon_usr.svg')
166  );
167  }
168 
169  $this->tpl->setContent($confirm->getHTML());
170  }
static _lookupName($a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:230
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
Confirmation screen class.
+ Here is the call graph for this function:

◆ deleteParticipants()

ilSessionMembershipGUI::deleteParticipants ( )
protected

Delete participants type $rbacreview type $rbacsystem type $ilAccess type $ilUser.

Returns
boolean

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

References $_POST, ilMembershipGUI\checkPermission(), ilMembershipGUI\getMembersObject(), ilMembershipGUI\getParentObject(), and ilUtil\sendFailure().

181  {
182  $this->checkPermission('manage_members');
183 
184  $participants = (array) $_POST['participants'];
185 
186  if (!is_array($participants) or !count($participants)) {
187  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
188  $this->ctrl->redirect($this, 'participants');
189  }
190 
191  foreach ($participants as $part_id) {
192  // delete role assignment
193  $this->getMembersObject()->delete($part_id);
194  // delete further settings
195  $event_part = new ilEventParticipants($this->getParentObject()->getId());
196  $event_part->setUserId($part_id);
197  $event_part->setParticipated(false);
198  $event_part->setRegistered(false);
199  $event_part->setMark('');
200  $event_part->setComment('');
201  $event_part->updateUser();
202  }
203 
204  ilUtil::sendSuccess($this->lng->txt($this->getParentObject()->getType() . "_members_deleted"), true);
205  $this->ctrl->redirect($this, "participants");
206 
207  return true;
208  }
getMembersObject()
Get member object.
checkPermission($a_permission, $a_cmd="")
Check permission If not granted redirect to parent gui.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getParentObject()
Get parent object.
$_POST["username"]
+ Here is the call graph for this function:

◆ getAttendanceListUserData()

ilSessionMembershipGUI::getAttendanceListUserData (   $a_user_id,
  $a_filters 
)

Callback from attendance list.

Parameters
int$a_user_id
Returns
array

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

References $data, and ilMembershipGUI\getMembersObject().

238  {
239  $data = $this->getMembersObject()->getEventParticipants()->getUser($a_user_id);
240 
241  if ($a_filters && $a_filters["registered"] && !$data["registered"]) {
242  return;
243  }
244 
245  $data['registered'] = $data['registered'] ?
246  $this->lng->txt('yes') :
247  $this->lng->txt('no');
248  $data['participated'] = $data['participated'] ?
249  $this->lng->txt('yes') :
250  $this->lng->txt('no');
251 
252  return $data;
253  }
$data
Definition: storeScorm.php:23
getMembersObject()
Get member object.
+ Here is the call graph for this function:

◆ getMailContextOptions()

ilSessionMembershipGUI::getMailContextOptions ( )
protected

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

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

270  {
271  $context_options = [];
272 
273  $context_options =
274  [
276  'ref_id' => $this->getParentObject()->getRefId(),
277  'ts' => time()
278  ];
279  return $context_options;
280  }
const CONTEXT_KEY
Session parameter for the context.
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ getMailMemberRoles()

ilSessionMembershipGUI::getMailMemberRoles ( )
protected
Returns
ilAbstractMailMemberRoles|null

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

23  {
24  return new ilMailMemberSessionRoles();
25  }
Class ilMailMemberSessionRoles.

◆ getMemberTabName()

ilSessionMembershipGUI::getMemberTabName ( )
protected

Get member tab name.

Returns
string

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

References ilMembershipGUI\getParentObject().

260  {
261  return $this->lng->txt($this->getParentObject()->getType() . '_members');
262  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ getPrintMemberData()

ilSessionMembershipGUI::getPrintMemberData (   $a_members)
Parameters
array$a_members
Returns
array

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

217  {
218  return $a_members;
219  }

◆ initParticipantTableGUI()

ilSessionMembershipGUI::initParticipantTableGUI ( )
protected
Returns

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

References ilMembershipGUI\getParentObject().

68  {
69  $table = new ilSessionParticipantsTableGUI(
70  $this,
71  $this->getParentObject(),
72  'participants'
73  );
74  $table->init();
75  return $table;
76  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ initParticipantTemplate()

ilSessionMembershipGUI::initParticipantTemplate ( )
protected

Init participant view template.

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

49  {
50  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_edit_members.html', 'Modules/Session');
51  }

◆ initSubscriberTable()

ilSessionMembershipGUI::initSubscriberTable ( )
protected
Returns

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

References ilMembershipGUI\getParentObject().

82  {
83  $subscriber = new ilSubscriberTableGUI($this, $this->getParentObject(), true, false);
84  $subscriber->setTitle($this->lng->txt('group_new_registrations'));
85  return $subscriber;
86  }
GUI class for course/group subscriptions.
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ initWaitingList()

ilSessionMembershipGUI::initWaitingList ( )
protected

init waiting list

Returns
ilGroupWaitingList

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

References ilMembershipGUI\getParentObject().

58  {
59  include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
60  $wait = new ilSessionWaitingList($this->getParentObject()->getId());
61  return $wait;
62  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ updateMembers()

ilSessionMembershipGUI::updateMembers ( )
protected

update entries from member table

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

References $_POST, ilMembershipGUI\checkPermission(), ilMembershipGUI\getCtrl(), ilParticipants\getInstance(), ilMembershipGUI\getLanguage(), ilMembershipGUI\getParentObject(), IL_SESS_MEMBER, and ilUtil\stripSlashes().

93  {
94  $this->checkPermission('manage_members');
95 
96  $part = ilParticipants::getInstance($this->getParentObject()->getRefId());
97 
98 
99  $wait = new ilSessionWaitingList($this->getParentObject()->getId());
100  $waiting = $wait->getUserIds();
101 
102  foreach ((array) $_REQUEST['visible_participants'] as $part_id) {
103  if (in_array($part_id, $waiting)) {
104  // so not update users on waiting list
105  continue;
106  }
107 
108  $participated = (bool) $_POST['participated'][$part_id];
109  $registered = (bool) $_POST['registered'][$part_id];
110  $contact = (bool) $_POST['contact'][$part_id];
111  $excused = (bool) $_POST['excused'][$part_id];
112 
113  if ($part->isAssigned($part_id)) {
114  if (!$participated && !$registered && !$contact) {
115  $part->delete($part_id);
116  }
117  } else {
118  if ($participated || $registered || $contact) {
119  $part->add($part_id, IL_SESS_MEMBER);
120  }
121  }
122  $event_part = new ilEventParticipants($this->getParentObject()->getId());
123  $event_part->setUserId($part_id);
124  $event_part->setMark(ilUtil::stripSlashes($_POST['mark'][$part_id]));
125  $event_part->setComment(ilUtil::stripSlashes($_POST['comment'][$part_id]));
126  $event_part->setNotificationEnabled($_POST['notification'][$part_id]);
127  $event_part->setParticipated($participated);
128  $event_part->setRegistered($registered);
129  $event_part->setContact($contact);
130  $event_part->setExcused($excused);
131  $event_part->updateUser();
132  }
133 
134  ilUtil::sendSuccess($this->getLanguage()->txt('settings_saved'), true);
135  $this->getCtrl()->redirect($this, 'participants');
136  }
checkPermission($a_permission, $a_cmd="")
Check permission If not granted redirect to parent gui.
static getInstance($a_ref_id)
Get instance by ref_id.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
getParentObject()
Get parent object.
const IL_SESS_MEMBER
$_POST["username"]
+ Here is the call graph for this function:

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