ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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

 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 ()
 
 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...
 
 showParticipantsToolbar ()
 Show participants toolbar. More...
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 checkPermission ($a_permission, $a_cmd="")
 Check permission has no manage members. More...
 
 checkPermissionBool ($a_permission, $a_cmd='', $a_type='', $a_ref_id=0)
 
 canAddOrSearchUsers ()
 Check if current user is allowed to add / search users. More...
 
 jump2UsersGallery ()
 Workaround for unavailable gallery. More...
 
- Protected Member Functions inherited from ilMembershipGUI
 getLanguage ()
 
 getCtrl ()
 
 getLogger ()
 
 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...
 
 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...
 
 setSubTabs (ilTabsGUI $tabs)
 Set sub tabs. More...
 
 parseSubscriberTable ()
 Parse table of subscription request. More...
 
 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

Check if current user is allowed to add / search users.

Returns
bool

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

References checkPermissionBool().

265  {
266  return $this->checkPermissionBool('write');
267  }
checkPermissionBool($a_permission, $a_cmd='', $a_type='', $a_ref_id=0)
+ Here is the call graph for this function:

◆ checkPermission()

ilSessionMembershipGUI::checkPermission (   $a_permission,
  $a_cmd = "" 
)
protected

Check permission has no manage members.

Parameters
string$a_permission
string$a_cmd

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

Referenced by deleteParticipants(), and updateMembers().

241  {
242  if ($a_permission == 'manage_members') {
243  $a_permission = 'write';
244  }
245  return parent::checkPermission($a_permission, $a_cmd);
246  }
+ Here is the caller graph for this function:

◆ checkPermissionBool()

ilSessionMembershipGUI::checkPermissionBool (   $a_permission,
  $a_cmd = '',
  $a_type = '',
  $a_ref_id = 0 
)
protected

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

References $a_type.

Referenced by canAddOrSearchUsers(), and checkRbacOrPositionAccessBool().

253  {
254  if ($a_permission == 'manage_members') {
255  $a_permission = 'write';
256  }
257  return parent::checkPermissionBool($a_permission, $a_cmd, $a_type, $a_ref_id);
258  }
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

◆ 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 26 of file class.ilSessionMembershipGUI.php.

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

27  {
28  if (!$a_ref_id) {
29  $a_ref_id = $this->getParentObject()->getRefId();
30  }
31  return $this->checkPermissionBool($a_rbac_perm, $a_ref_id);
32  }
checkPermissionBool($a_permission, $a_cmd='', $a_type='', $a_ref_id=0)
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 111 of file class.ilSessionMembershipGUI.php.

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

112  {
113  $participants = (array) $_POST['participants'];
114 
115  if (!count($participants)) {
116  ilUtil::sendFailure($this->lng->txt('no_checkbox'), true);
117  $this->ctrl->redirect($this, 'participants');
118  }
119 
120  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
121  $confirm = new ilConfirmationGUI();
122  $confirm->setFormAction($this->ctrl->getFormAction($this, 'confirmDeleteParticipants'));
123  $confirm->setHeaderText($this->lng->txt($this->getParentObject()->getType() . '_header_delete_members'));
124  $confirm->setConfirm($this->lng->txt('confirm'), 'deleteParticipants');
125  $confirm->setCancel($this->lng->txt('cancel'), 'participants');
126 
127  foreach ($participants as $usr_id) {
128  $name = ilObjUser::_lookupName($usr_id);
129 
130  $confirm->addItem(
131  'participants[]',
132  $name['user_id'],
133  $name['lastname'] . ', ' . $name['firstname'] . ' [' . $name['login'] . ']',
134  ilUtil::getImagePath('icon_usr.svg')
135  );
136  }
137 
138  $this->tpl->setContent($confirm->getHTML());
139  }
static _lookupName($a_user_id)
lookup user name
if($format !==null) $name
Definition: metadata.php:146
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Create styles array
The data for the language used.
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 149 of file class.ilSessionMembershipGUI.php.

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

150  {
151  $this->checkPermission('write');
152 
153  $participants = (array) $_POST['participants'];
154 
155  if (!is_array($participants) or !count($participants)) {
156  ilUtil::sendFailure($this->lng->txt("no_checkbox"), true);
157  $this->ctrl->redirect($this, 'participants');
158  }
159 
160  foreach ($participants as $part_id) {
161  // delete role assignment
162  $this->getMembersObject()->delete($part_id);
163  // delete further settings
164  $event_part = new ilEventParticipants($this->getParentObject()->getId());
165  $event_part->setUserId($part_id);
166  $event_part->setParticipated(false);
167  $event_part->setRegistered(false);
168  $event_part->setMark('');
169  $event_part->setComment('');
170  $event_part->updateUser();
171  }
172 
173  ilUtil::sendSuccess($this->lng->txt($this->getParentObject()->getType() . "_members_deleted"), true);
174  $this->ctrl->redirect($this, "participants");
175 
176  return true;
177  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
getMembersObject()
Get member object.
checkPermission($a_permission, $a_cmd="")
Check permission has no manage members.
Create styles array
The data for the language used.
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 217 of file class.ilSessionMembershipGUI.php.

References $data, and ilMembershipGUI\getMembersObject().

218  {
219  $data = $this->getMembersObject()->getEventParticipants()->getUser($a_user_id);
220 
221  if ($a_filters && $a_filters["registered"] && !$data["registered"]) {
222  return;
223  }
224 
225  $data['registered'] = $data['registered'] ?
226  $this->lng->txt('yes') :
227  $this->lng->txt('no');
228  $data['participated'] = $data['participated'] ?
229  $this->lng->txt('yes') :
230  $this->lng->txt('no');
231 
232  return $data;
233  }
getMembersObject()
Get member object.
+ Here is the call graph for this function:

◆ getPrintMemberData()

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

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

206  {
207  return $a_members;
208  }

◆ initParticipantTableGUI()

ilSessionMembershipGUI::initParticipantTableGUI ( )
protected
Returns

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

References $table, and ilMembershipGUI\getParentObject().

59  {
61  $this,
62  $this->getParentObject(),
63  'participants'
64  );
65  $table->init();
66  return $table;
67  }
getParentObject()
Get parent object.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:

◆ initParticipantTemplate()

ilSessionMembershipGUI::initParticipantTemplate ( )
protected

Init participant view template.

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

40  {
41  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.sess_edit_members.html', 'Modules/Session');
42  }

◆ initWaitingList()

ilSessionMembershipGUI::initWaitingList ( )
protected

init waiting list

Returns
ilGroupWaitingList

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

References ilMembershipGUI\getParentObject().

49  {
50  include_once './Modules/Session/classes/class.ilSessionWaitingList.php';
51  $wait = new ilSessionWaitingList($this->getParentObject()->getId());
52  return $wait;
53  }
getParentObject()
Get parent object.
+ Here is the call graph for this function:

◆ jump2UsersGallery()

ilSessionMembershipGUI::jump2UsersGallery ( )
protected

Workaround for unavailable gallery.

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

References ilMembershipGUI\participants().

274  {
275  return $this->participants();
276  }
participants()
Show participant table, subscriber table, wating list table;.
+ Here is the call graph for this function:

◆ setSubTabs()

ilSessionMembershipGUI::setSubTabs ( ilTabsGUI  $tabs)
protected

Set sub tabs.

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

198  {
199  }

◆ showParticipantsToolbar()

ilSessionMembershipGUI::showParticipantsToolbar ( )
protected

Show participants toolbar.

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

References $GLOBALS.

184  {
185  $ilToolbar = $GLOBALS['DIC']->toolbar();
186  // print button
187 
188  $ilToolbar->addButton(
189  $this->lng->txt($this->getParentObject()->getType() . "_print_list"),
190  $this->ctrl->getLinkTarget($this, 'printMembers')
191  );
192  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.

◆ updateMembers()

ilSessionMembershipGUI::updateMembers ( )
protected

update entries from member table

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

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

73  {
74  $this->checkPermission('write');
75 
76  $part = ilParticipants::getInstance($this->getParentObject()->getRefId());
77 
78  foreach ((array) $_REQUEST['visible_participants'] as $part_id) {
79  $participated = (bool) $_POST['participated'][$part_id];
80  $registered = (bool) $_POST['registered'][$part_id];
81 
82  $this->getLogger()->debug('Participated: ' . (int) $participated);
83  $this->getLogger()->debug('Registered: ' . (int) $registered);
84 
85  if ($part->isAssigned($part_id)) {
86  if (!$participated && !$registered) {
87  $part->delete($part_id);
88  }
89  } else {
90  if ($participated || $registered) {
91  $part->add($part_id, IL_SESS_MEMBER);
92  }
93  }
94  $event_part = new ilEventParticipants($this->getParentObject()->getId());
95  $event_part->setUserId($part_id);
96  $event_part->setMark(ilUtil::stripSlashes($_POST['mark'][$part_id]));
97  $event_part->setComment(ilUtil::stripSlashes($_POST['comment'][$part_id]));
98  $event_part->setParticipated($participated);
99  $event_part->setRegistered($registered);
100  $event_part->updateUser();
101  }
102 
103  ilUtil::sendSuccess($this->getLanguage()->txt('settings_saved'), true);
104  $this->getCtrl()->redirect($this, 'participants');
105  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getInstance($a_ref_id)
Get instance by ref_id.
checkPermission($a_permission, $a_cmd="")
Check permission has no manage members.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
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: