ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilOrgUnitStaffGUI Class Reference

Class ilOrgUnitStaffGUI. More...

+ Collaboration diagram for ilOrgUnitStaffGUI:

Public Member Functions

 __construct (ilObjOrgUnitGUI $parent_gui)
 
 executeCommand ()
 
 showStaff ()
 
 showOtherRoles ()
 
 showStaffRec ()
 
 addStaff ()
 
 addOtherRoles ()
 
 getStaffTableHTML ($recursive=false, $table_cmd="showStaff")
 
 getOtherRolesTableHTML ()
 
 fromSuperiorToEmployee ()
 
 fromEmployeeToSuperior ()
 
 confirmRemoveUser ($cmd)
 
 removeFromSuperiors ()
 
 removeFromEmployees ()
 
 removeFromRole ()
 
 setTabs ()
 

Protected Member Functions

 addStaffToolbar ()
 
 addOtherRolesToolbar ()
 

Protected Attributes

 $tabs_gui
 
 $toolbar
 
 $ctrl
 
 $tpl
 
 $parent_gui
 
 $parent_obj
 
 $lng
 
 $ilAccess
 
 $rbacreview
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitStaffGUI::__construct ( ilObjOrgUnitGUI  $parent_gui)
Parameters
ilObjOrgUnitGUI$parent_gui

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

References $DIC, $ilAccess, $ilCtrl, $lng, $parent_gui, $rbacreview, $tpl, and setTabs().

59  {
60  global $DIC;
61  $tpl = $DIC['tpl'];
62  $ilCtrl = $DIC['ilCtrl'];
63  $ilTabs = $DIC['ilTabs'];
64  $lng = $DIC['lng'];
65  $ilAccess = $DIC['ilAccess'];
66  $ilToolbar = $DIC['ilToolbar'];
67  $rbacreview = $DIC['rbacreview'];
68 
69  $this->tpl = $tpl;
70  $this->ctrl = $ilCtrl;
71  $this->parent_gui = $parent_gui;
72  $this->parent_object = $parent_gui->object;
73  $this->tabs_gui = $this->parent_gui->tabs_gui;
74  $this->toolbar = $ilToolbar;
75  $this->lng = $lng;
76  $this->ilAccess = $ilAccess;
77  $this->toolbar = $ilToolbar;
78  $this->rbacreview = $rbacreview;
79 
80  $this->tabs_gui->setTabActive("orgu_staff");
81  $this->setTabs();
82  }
global $DIC
Definition: saml.php:7
Class ilAccessHandler.
global $ilCtrl
Definition: ilias.php:18
+ Here is the call graph for this function:

Member Function Documentation

◆ addOtherRoles()

ilOrgUnitStaffGUI::addOtherRoles ( )

Definition at line 245 of file class.ilOrgUnitStaffGUI.php.

References $_POST, $users, ilObjUser\_lookupId(), array, ilAccess\checkAccess(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

246  {
247  if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
248  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
249  $this->ctrl->redirect($this->parent_gui, "");
250  }
251 
252  $users = explode(',', $_POST['user_login']);
253  $user_ids = array();
254  foreach ($users as $user) {
255  $user_id = ilObjUser::_lookupId($user);
256  if ($user_id) {
257  $user_ids[] = $user_id;
258  }
259  }
260  $role_id = isset($_POST['user_type']) ? $_POST['user_type'] : 0;
261  foreach ($user_ids as $user_id) {
262  $this->parent_object->assignUserToLocalRole($role_id, $user_id);
263  }
264  ilUtil::sendSuccess($this->lng->txt("users_successfuly_added"), true);
265  $this->ctrl->redirect($this, "showOtherRoles");
266  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupId($a_user_str)
Lookup id by login.
Class ilAccessHandler.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ addOtherRolesToolbar()

ilOrgUnitStaffGUI::addOtherRolesToolbar ( )
protected

Definition at line 192 of file class.ilOrgUnitStaffGUI.php.

References array, and ilRepositorySearchGUI\fillAutoCompleteToolbar().

Referenced by showOtherRoles().

193  {
194  $arrLocalRoles = $this->rbacreview->getLocalRoles($this->parent_object->getRefId());
195  $types = array();
196  foreach ($arrLocalRoles as $role_id) {
197  $ilObjRole = new ilObjRole($role_id);
198  if (!preg_match("/il_orgu_/", $ilObjRole->getUntranslatedTitle())) {
199  $types[$role_id] = $ilObjRole->getPresentationTitle();
200  }
201  }
202  $this->ctrl->setParameterByClass('ilRepositorySearchGUI', 'addusertype', 'other');
204  'auto_complete_name' => $this->lng->txt('user'),
205  'user_type' => $types,
206  'submit_name' => $this->lng->txt('add')
207  ));
208  }
Class ilObjRole.
Create styles array
The data for the language used.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addStaff()

ilOrgUnitStaffGUI::addStaff ( )

Definition at line 211 of file class.ilOrgUnitStaffGUI.php.

References $_POST, $users, ilObjUser\_lookupId(), array, ilAccess\checkAccess(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

212  {
213  if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
214  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
215  $this->ctrl->redirect($this->parent_gui, "");
216  }
217 
218  $users = explode(',', $_POST['user_login']);
219  $user_ids = array();
220  foreach ($users as $user) {
221  $user_id = ilObjUser::_lookupId($user);
222  if ($user_id) {
223  $user_ids[] = $user_id;
224  }
225  }
226 
227  if (!count($user_ids)) {
228  ilUtil::sendFailure($this->lng->txt("user_not_found"), true);
229  $this->ctrl->redirect($this, "showStaff");
230  }
231 
232  $user_type = isset($_POST['user_type']) ? $_POST['user_type'] : 0;
233  if ($user_type == "employee") {
234  $this->parent_object->assignUsersToEmployeeRole($user_ids);
235  } elseif ($user_type == "superior") {
236  $this->parent_object->assignUsersToSuperiorRole($user_ids);
237  } else {
238  throw new Exception("The post request didn't specify wether the user_ids should be assigned to the employee or the superior role.");
239  }
240 
241  ilUtil::sendSuccess($this->lng->txt("users_successfuly_added"), true);
242  $this->ctrl->redirect($this, "showStaff");
243  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static _lookupId($a_user_str)
Lookup id by login.
Class ilAccessHandler.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ addStaffToolbar()

ilOrgUnitStaffGUI::addStaffToolbar ( )
protected

Definition at line 177 of file class.ilOrgUnitStaffGUI.php.

References array, and ilRepositorySearchGUI\fillAutoCompleteToolbar().

Referenced by showStaff().

178  {
179  $types = array(
180  "employee" => $this->lng->txt("employee"),
181  "superior" => $this->lng->txt("superior")
182  );
183  $this->ctrl->setParameterByClass('ilRepositorySearchGUI', 'addusertype', 'staff');
185  'auto_complete_name' => $this->lng->txt('user'),
186  'user_type' => $types,
187  'submit_name' => $this->lng->txt('add')
188  ));
189  }
Create styles array
The data for the language used.
static fillAutoCompleteToolbar($parent_object, ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
fill toolbar with
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmRemoveUser()

ilOrgUnitStaffGUI::confirmRemoveUser (   $cmd)

Definition at line 338 of file class.ilOrgUnitStaffGUI.php.

References $_GET, ilObjUser\_lookupName(), ilAccess\checkAccess(), ilUtil\getImagePath(), and ilUtil\sendFailure().

Referenced by executeCommand().

339  {
340  if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
341  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
342  $this->ctrl->redirect($this->parent_gui, "");
343  }
344  switch ($cmd) {
345  case "confirmRemoveFromRole":
346  $this->tabs_gui->activateSubTab("show_other_roles");
347  $nextcmd = "removeFromRole";
348  $paramname = "obj_id-role_id";
349  $param = $_GET["obj_id"] . '-' . $_GET["role_id"];
350  break;
351  case "confirmRemoveFromSuperiors":
352  $this->tabs_gui->activateSubTab("show_staff");
353  $nextcmd = "removeFromSuperiors";
354  $paramname = "obj_id";
355  $param = $_GET["obj_id"];
356  break;
357  case "confirmRemoveFromEmployees":
358  $this->tabs_gui->activateSubTab("show_staff");
359  $nextcmd = "removeFromEmployees";
360  $paramname = "obj_id";
361  $param = $_GET["obj_id"];
362  break;
363  }
364  include_once('./Services/Utilities/classes/class.ilConfirmationGUI.php');
365  $confirm = new ilConfirmationGUI();
366  $confirm->setFormAction($this->ctrl->getFormAction($this, $nextcmd));
367  $confirm->setHeaderText($this->lng->txt('orgu_staff_deassign'));
368  $confirm->setConfirm($this->lng->txt('confirm'), $nextcmd);
369  $confirm->setCancel($this->lng->txt('cancel'), 'showStaff');
370  $arrUser = ilObjUser::_lookupName($_GET["obj_id"]);
371  $confirm->addItem(
372  $paramname,
373  $param,
374  $arrUser['lastname'] . ', ' . $arrUser['firstname'] . ' [' . $arrUser['login']
375  . ']',
376  ilUtil::getImagePath('icon_usr.svg')
377  );
378  $this->tpl->setContent($confirm->getHTML());
379  }
static _lookupName($a_user_id)
lookup user name
$_GET["client_id"]
Class ilAccessHandler.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
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.
Confirmation screen class.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilOrgUnitStaffGUI::executeCommand ( )
Returns
bool
Exceptions
Exception
ilCtrlException
ilException

Definition at line 90 of file class.ilOrgUnitStaffGUI.php.

References confirmRemoveUser(), showOtherRoles(), showStaff(), and showStaffRec().

91  {
92  $next_class = $this->ctrl->getNextClass($this);
93  $cmd = $this->ctrl->getCmd();
94 
95  switch ($next_class) {
96  case 'ilrepositorysearchgui':
97  $repo = new ilRepositorySearchGUI();
98  $this->ctrl->forwardCommand($repo);
99  break;
100  default:
101  switch ($cmd) {
102  case 'showStaff':
103  $this->tabs_gui->activateSubTab("show_staff");
104  $this->showStaff();
105  break;
106  case 'showOtherRoles':
107  $this->tabs_gui->activateSubTab("show_other_roles");
108  $this->showOtherRoles();
109  break;
110  case 'showStaffRec':
111  $this->tabs_gui->activateSubTab("show_staff_rec");
112  $this->showStaffRec();
113  break;
114  case 'confirmRemoveFromRole':
115  case 'confirmRemoveFromEmployees':
116  case 'confirmRemoveFromSuperiors':
117  $this->confirmRemoveUser($cmd);
118  break;
119  case 'addStaff':
120  case 'addOtherRoles':
121  case 'fromSuperiorToEmployee':
122  case 'fromEmployeeToSuperior':
123  case 'removeFromSuperiors':
124  case 'removeFromEmployees':
125  case 'removeFromRole':
126  $this->$cmd();
127  break;
128  default:
129  throw new ilException("Unknown command for command class ilOrgUnitStaffGUI: " . $cmd);
130  break;
131  }
132  break;
133  }
134 
135 
136  return true;
137  }
+ Here is the call graph for this function:

◆ fromEmployeeToSuperior()

ilOrgUnitStaffGUI::fromEmployeeToSuperior ( )

Definition at line 326 of file class.ilOrgUnitStaffGUI.php.

References $_GET, array, ilAccess\checkAccess(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

327  {
328  if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
329  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
330  $this->ctrl->redirect($this->parent_gui, "");
331  }
332  $this->parent_object->deassignUserFromEmployeeRole($_GET["obj_id"]);
333  $this->parent_object->assignUsersToSuperiorRole(array( $_GET["obj_id"] ));
334  ilUtil::sendSuccess($this->lng->txt("user_changed_successful"), true);
335  $this->ctrl->redirect($this, "showStaff");
336  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
Class ilAccessHandler.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ fromSuperiorToEmployee()

ilOrgUnitStaffGUI::fromSuperiorToEmployee ( )

Definition at line 313 of file class.ilOrgUnitStaffGUI.php.

References $_GET, array, ilAccess\checkAccess(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

314  {
315  if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
316  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
317  $this->ctrl->redirect($this->parent_gui, "");
318  }
319  $this->parent_object->deassignUserFromSuperiorRole($_GET["obj_id"]);
320  $this->parent_object->assignUsersToEmployeeRole(array( $_GET["obj_id"] ));
321  ilUtil::sendSuccess($this->lng->txt("user_changed_successful"), true);
322  $this->ctrl->redirect($this, "showStaff");
323  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_GET["client_id"]
Class ilAccessHandler.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ getOtherRolesTableHTML()

ilOrgUnitStaffGUI::getOtherRolesTableHTML ( )

Definition at line 291 of file class.ilOrgUnitStaffGUI.php.

References $DIC, $html, $lng, and $rbacreview.

Referenced by showOtherRoles().

292  {
293  global $DIC;
294  $lng = $DIC['lng'];
295  $rbacreview = $DIC['rbacreview'];
296  $arrLocalRoles = $rbacreview->getLocalRoles($this->parent_object->getRefId());
297  $html = "";
298  foreach ($arrLocalRoles as $role_id) {
299  $ilObjRole = new ilObjRole($role_id);
300  if (!preg_match("/il_orgu_/", $ilObjRole->getUntranslatedTitle())) {
301  $other_roles_table = new ilOrgUnitOtherRolesTableGUI($this, 'other_role_' . $role_id, $role_id);
302  $other_roles_table->readData();
303  $html .= $other_roles_table->getHTML() . "<br/>";
304  }
305  }
306  if (!$html) {
307  $html = $lng->txt("no_roles");
308  }
309 
310  return $html;
311  }
Class ilObjRole.
global $DIC
Definition: saml.php:7
Class ilOrgUnitOtherRolesTableGUI.
$html
Definition: example_001.php:87
+ Here is the caller graph for this function:

◆ getStaffTableHTML()

ilOrgUnitStaffGUI::getStaffTableHTML (   $recursive = false,
  $table_cmd = "showStaff" 
)
Parameters
bool$recursive
string$table_cmd
Returns
string the tables html.

Definition at line 275 of file class.ilOrgUnitStaffGUI.php.

References $DIC, $lng, and $rbacreview.

Referenced by showStaff(), and showStaffRec().

276  {
277  global $DIC;
278  $lng = $DIC['lng'];
279  $rbacreview = $DIC['rbacreview'];
280  $superior_table = new ilOrgUnitStaffTableGUI($this, $table_cmd, "superior", $recursive);
281  $superior_table->parseData();
282  $superior_table->setTitle($lng->txt("il_orgu_superior"));
283  $employee_table = new ilOrgUnitStaffTableGUI($this, $table_cmd, "employee", $recursive);
284  $employee_table->parseData();
285  $employee_table->setTitle($lng->txt("il_orgu_employee"));
286 
287  return $superior_table->getHTML() . $employee_table->getHTML();
288  }
global $DIC
Definition: saml.php:7
Class ilOrgUnitStaffTableGUI.
+ Here is the caller graph for this function:

◆ removeFromEmployees()

ilOrgUnitStaffGUI::removeFromEmployees ( )

Definition at line 397 of file class.ilOrgUnitStaffGUI.php.

References $_POST, ilAccess\checkAccess(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

398  {
399  if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
400  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
401  $this->ctrl->redirect($this->parent_gui, "");
402  }
403  $this->parent_object->deassignUserFromEmployeeRole($_POST["obj_id"]);
404  //if user is neither employee nor superior, remove orgunit from user->org_units
405  if (!$this->rbacreview->isAssigned($_POST["obj_id"], $this->parent_object->getSuperiorRole())) {
406  ilObjUser::_removeOrgUnit($_POST["obj_id"], $this->parent_object->getRefId());
407  }
408  ilUtil::sendSuccess($this->lng->txt("deassign_user_successful"), true);
409  $this->ctrl->redirect($this, "showStaff");
410  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilAccessHandler.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ removeFromRole()

ilOrgUnitStaffGUI::removeFromRole ( )

Definition at line 413 of file class.ilOrgUnitStaffGUI.php.

References $_POST, ilAccess\checkAccess(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

414  {
415  if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
416  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
417  $this->ctrl->redirect($this->parent_gui, "");
418  }
419  $arrObjIdRolId = explode("-", $_POST["obj_id-role_id"]);
420  $this->parent_object->deassignUserFromLocalRole($arrObjIdRolId[1], $arrObjIdRolId[0]);
421  ilUtil::sendSuccess($this->lng->txt("deassign_user_successful"), true);
422  $this->ctrl->redirect($this, "showOtherRoles");
423  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilAccessHandler.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ removeFromSuperiors()

ilOrgUnitStaffGUI::removeFromSuperiors ( )

Definition at line 381 of file class.ilOrgUnitStaffGUI.php.

References $_POST, ilAccess\checkAccess(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

382  {
383  if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
384  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
385  $this->ctrl->redirect($this->parent_gui, "");
386  }
387  $this->parent_object->deassignUserFromSuperiorRole($_POST["obj_id"]);
388  //if user is neither employee nor superior, remove orgunit from user->org_units
389  if (!$this->rbacreview->isAssigned($_POST["obj_id"], $this->parent_object->getEmployeeRole())) {
390  ilObjUser::_removeOrgUnit($_POST["obj_id"], $this->parent_object->getRefId());
391  }
392  ilUtil::sendSuccess($this->lng->txt("deassign_user_successful"), true);
393  $this->ctrl->redirect($this, "showStaff");
394  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilAccessHandler.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ setTabs()

ilOrgUnitStaffGUI::setTabs ( )

Definition at line 426 of file class.ilOrgUnitStaffGUI.php.

References ilAccess\checkAccess().

Referenced by __construct().

427  {
428  $this->tabs_gui->addSubTab("show_staff", sprintf($this->lng->txt("local_staff"), $this->parent_object->getTitle()), $this->ctrl->getLinkTarget($this, "showStaff"));
429  if ($this->ilAccess->checkAccess("view_learning_progress_rec", "", $this->parent_object->getRefId())) {
430  $this->tabs_gui->addSubTab("show_staff_rec", sprintf($this->lng->txt("rec_staff"), $this->parent_object->getTitle()), $this->ctrl->getLinkTarget($this, "showStaffRec"));
431  }
432  if ($this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
433  $this->tabs_gui->addSubTab("show_other_roles", sprintf($this->lng->txt("local_other_roles"), $this->parent_object->getTitle()), $this->ctrl->getLinkTarget($this, "showOtherRoles"));
434  }
435  }
Class ilAccessHandler.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showOtherRoles()

ilOrgUnitStaffGUI::showOtherRoles ( )

Definition at line 153 of file class.ilOrgUnitStaffGUI.php.

References addOtherRolesToolbar(), ilAccess\checkAccess(), getOtherRolesTableHTML(), and ilUtil\sendFailure().

Referenced by executeCommand().

154  {
155  if (!$this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
156  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
157  $this->ctrl->redirect($this->parent_gui, "");
158  }
159  if ($this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
160  $this->addOtherRolesToolbar();
161  }
162  $this->tpl->setContent($this->getOtherRolesTableHTML());
163  }
Class ilAccessHandler.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showStaff()

ilOrgUnitStaffGUI::showStaff ( )

Definition at line 139 of file class.ilOrgUnitStaffGUI.php.

References ilObjOrgUnitAccess\_checkAccessStaff(), addStaffToolbar(), ilAccess\checkAccess(), getStaffTableHTML(), and ilUtil\sendFailure().

Referenced by executeCommand().

140  {
141  if (!ilObjOrgUnitAccess::_checkAccessStaff($this->parent_object->getRefId())) {
142  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
143  $this->ctrl->redirect($this->parent_gui, "");
144  }
145  if ($this->ilAccess->checkAccess("write", "", $this->parent_object->getRefId())) {
146  $this->addStaffToolbar();
147  }
148  $this->ctrl->setParameter($this, "recursive", false);
149  $this->tpl->setContent($this->getStaffTableHTML(false, "showStaff"));
150  }
static _checkAccessStaff($ref_id)
Class ilAccessHandler.
checkAccess($a_permission, $a_cmd, $a_ref_id, $a_type="", $a_obj_id="", $a_tree_id="")
check access for an object (provide $a_type and $a_obj_id if available for better performance)(option...
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getStaffTableHTML($recursive=false, $table_cmd="showStaff")
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showStaffRec()

ilOrgUnitStaffGUI::showStaffRec ( )

Definition at line 166 of file class.ilOrgUnitStaffGUI.php.

References ilObjOrgUnitAccess\_checkAccessStaffRec(), getStaffTableHTML(), and ilUtil\sendFailure().

Referenced by executeCommand().

167  {
168  if (!ilObjOrgUnitAccess::_checkAccessStaffRec($this->parent_object->getRefId())) {
169  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
170  $this->ctrl->redirect($this->parent_gui, "");
171  }
172  $this->ctrl->setParameter($this, "recursive", true);
173  $this->tpl->setContent($this->getStaffTableHTML(true, "showStaffRec"));
174  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getStaffTableHTML($recursive=false, $table_cmd="showStaff")
static _checkAccessStaffRec($ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilOrgUnitStaffGUI::$ctrl
protected

Definition at line 27 of file class.ilOrgUnitStaffGUI.php.

◆ $ilAccess

ilOrgUnitStaffGUI::$ilAccess
protected

Definition at line 47 of file class.ilOrgUnitStaffGUI.php.

Referenced by __construct().

◆ $lng

ilOrgUnitStaffGUI::$lng
protected

◆ $parent_gui

ilOrgUnitStaffGUI::$parent_gui
protected

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

Referenced by __construct().

◆ $parent_obj

ilOrgUnitStaffGUI::$parent_obj
protected

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

◆ $rbacreview

ilOrgUnitStaffGUI::$rbacreview
protected

◆ $tabs_gui

ilOrgUnitStaffGUI::$tabs_gui
protected

Definition at line 19 of file class.ilOrgUnitStaffGUI.php.

◆ $toolbar

ilOrgUnitStaffGUI::$toolbar
protected

Definition at line 23 of file class.ilOrgUnitStaffGUI.php.

◆ $tpl

ilOrgUnitStaffGUI::$tpl
protected

Definition at line 31 of file class.ilOrgUnitStaffGUI.php.

Referenced by __construct().


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