ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilObjOrgUnitGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
26 {
27  const TAB_POSITIONS = 'positions';
28  const TAB_ORGU_TYPES = 'orgu_types';
29  const TAB_SETTINGS = "settings";
30  const TAB_STAFF = 'orgu_staff';
31  const TAB_GLOBAL_SETTINGS = 'global_settings';
32  const TAB_EXPORT = 'export';
36  public $ctrl;
40  public $tpl;
44  public $tabs_gui;
48  protected $ilAccess;
52  protected $toolbar;
56  protected $ilLocator;
60  public $tree;
64  public $object;
68  protected $ilLog;
72  public $ilias;
73  const CMD_EDIT_SETTINGS = 'editSettings';
74 
75 
76  public function __construct()
77  {
78  global $DIC;
79  $tpl = $DIC['tpl'];
80  $ilCtrl = $DIC['ilCtrl'];
81  $ilAccess = $DIC['ilAccess'];
82  $ilToolbar = $DIC['ilToolbar'];
83  $ilLocator = $DIC['ilLocator'];
84  $tree = $DIC['tree'];
85  $lng = $DIC['lng'];
86  $ilLog = $DIC['ilLog'];
87  $ilias = $DIC['ilias'];
88  parent::__construct(array(), $_GET["ref_id"], true, false);
89 
90  $this->tpl = $tpl;
91  $this->ctrl = $ilCtrl;
92  $this->ilAccess = $ilAccess;
93  $this->ilLocator = $ilLocator;
94  $this->tree = $tree;
95  $this->toolbar = $ilToolbar;
96  $this->ilLog = $ilLog;
97  $this->ilias = $ilias;
98  $this->type = 'orgu';
99 
100  $lng->loadLanguageModule("orgu");
101  $this->tpl->addCss('./Modules/OrgUnit/templates/default/orgu.css');
102  }
103 
104 
105  public function executeCommand()
106  {
107  $cmd = $this->ctrl->getCmd();
108  $next_class = $this->ctrl->getNextClass($this);
109  parent::prepareOutput();
110 
111  //Otherwise move-Objects would not work
112  if ($cmd != "cut") {
113  $this->showTree();
114  }
115 
116  switch ($next_class) {
117  case 'ilorgunitglobalsettingsgui':
118  $this->tabs_gui->activateTab(self::TAB_GLOBAL_SETTINGS);
119  $global_settings = new ilOrgUnitGlobalSettingsGUI();
120  $this->ctrl->forwardCommand($global_settings);
121  break;
122  case "illocalusergui":
124  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
125  $this->ctrl->redirect($this);
126  }
127  $this->tabs_gui->activateTab('administrate_users');
128  $ilLocalUserGUI = new ilLocalUserGUI($this);
129  $this->ctrl->forwardCommand($ilLocalUserGUI);
130  break;
131  case "ilorgunitsimpleimportgui":
132  $this->tabs_gui->activateTab("view");
133  $this->setContentSubTabs();
134  $this->tabs_gui->setSubTabActive('import');
135  $ilOrgUnitSimpleImportGUI = new ilOrgUnitSimpleImportGUI($this);
136  $this->ctrl->forwardCommand($ilOrgUnitSimpleImportGUI);
137  break;
138  case "ilorgunitsimpleuserimportgui":
139  $ilOrgUnitSimpleUserImportGUI = new ilOrgUnitSimpleUserImportGUI($this);
140  $this->ctrl->forwardCommand($ilOrgUnitSimpleUserImportGUI);
141  break;
142  case "ilorgunitstaffgui":
143  case "ilrepositorysearchgui":
144  $this->tabs_gui->activateTab(self::TAB_STAFF);
145  $ilOrgUnitStaffGUI = new ilOrgUnitStaffGUI($this);
146  $this->ctrl->forwardCommand($ilOrgUnitStaffGUI);
147  break;
148  case "ilobjusergui":
149  switch ($cmd) {
150  case "create":
151  $ilObjUserGUI = new ilObjUserGUI("", (int) $_GET['ref_id'], true, false);
152  $ilObjUserGUI->setCreationMode(true);
153  $this->ctrl->forwardCommand($ilObjUserGUI);
154  $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
155  break;
156  case "save":
157  $ilObjUserGUI = new ilObjUserGUI("", $_GET['ref_id'], true, false);
158  $ilObjUserGUI->setCreationMode(true);
159  $this->ctrl->forwardCommand($ilObjUserGUI);
160  $this->tabs_gui->clearTargets();
161  $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
162  break;
163  case "view":
164  case "update":
165  $ilObjUserGUI = new ilObjUserGUI("", (int) $_GET['obj_id'], false, false);
166  $ilObjUserGUI->setCreationMode(false);
167  $this->ctrl->forwardCommand($ilObjUserGUI);
168  $this->tabs_gui->clearTargets();
169  $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
170  break;
171  case "cancel":
172  $this->ctrl->redirectByClass("illocalusergui", "index");
173  break;
174  }
175  break;
176  case "ilobjuserfoldergui":
177  switch ($cmd) {
178  case "view":
179  $this->ctrl->redirectByClass("illocalusergui", "index");
180  break;
181  default:
182  $ilObjUserFolderGUI = new ilObjUserFolderGUI("", (int) $_GET['ref_id'], true, false);
183  $ilObjUserFolderGUI->setUserOwnerId((int) $_GET['ref_id']);
184  $ilObjUserFolderGUI->setCreationMode(true);
185  $this->ctrl->forwardCommand($ilObjUserFolderGUI);
186  $this->tabs_gui->clearTargets();
187  $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
188  break;
189  }
190  break;
191  case "ilinfoscreengui":
192  $this->tabs_gui->activateTab("info_short");
193  if (!$this->ilAccess->checkAccess("read", "", $this->ref_id)
194  and !$this->ilAccess->checkAccess("visible", "", $this->ref_id)) {
195  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
196  }
197  $info = new ilInfoScreenGUI($this);
198  $amd_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'orgu', $this->object->getId(), 'orgu_type', $this->object->getOrgUnitTypeId());
199  $amd_gui->setInfoObject($info);
200  $amd_gui->parse();
201  $this->ctrl->forwardCommand($info);
202  break;
203  case 'ilpermissiongui':
204  $this->tabs_gui->activateTab('perm_settings');
205  $ilPermissionGUI = new ilPermissionGUI($this);
206  $this->ctrl->forwardCommand($ilPermissionGUI);
207  break;
208  case "ilcommonactiondispatchergui":
210  $this->ctrl->forwardCommand($gui);
211  break;
212  case 'illearningprogressgui':
213  case 'illplistofprogressgui':
214  $this->tabs_gui->clearTargets();
215  $this->tabs_gui->setBackTarget($this->lng->txt('backto_staff'), $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", 'showStaff'));
216  if (!ilObjOrgUnitAccess::_checkAccessToUserLearningProgress($this->object->getRefid(), $_GET['obj_id'])) {
217  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
218  $this->ctrl->redirectByClass("ilOrgUnitStaffGUI", "showStaff");
219  }
220  $this->ctrl->saveParameterByClass("illearningprogressgui", "obj_id");
221  $this->ctrl->saveParameterByClass("illearningprogressgui", "recursive");
222  $new_gui = new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_ORG_UNIT, $_GET["ref_id"], $_GET['obj_id']);
223  $this->ctrl->forwardCommand($new_gui);
224  break;
225  case 'ilorgunitexportgui':
226  $this->tabs_gui->activateTab(self::TAB_EXPORT);;
227  $ilOrgUnitExportGUI = new ilOrgUnitExportGUI($this);
228  $ilOrgUnitExportGUI->addFormat('xml');
229  $this->ctrl->forwardCommand($ilOrgUnitExportGUI);
230  break;
231  case strtolower(ilTranslationGUI::class):
232  $this->tabs_gui->activateTab(self::TAB_SETTINGS);
233  $this->setSubTabsSettings('edit_translations');
234  $ilTranslationGui = new ilTranslationGUI($this);
235  $this->ctrl->forwardCommand($ilTranslationGui);
236  break;
237  case strtolower(ilOrgUnitTypeGUI::class):
238  $this->tabs_gui->activateTab(self::TAB_ORGU_TYPES);
239  $types_gui = new ilOrgUnitTypeGUI($this);
240  $this->ctrl->forwardCommand($types_gui);
241  break;
242  case strtolower(ilOrgUnitPositionGUI::class):
243  $this->tabs_gui->activateTab(self::TAB_POSITIONS);
244  $types_gui = new ilOrgUnitPositionGUI($this);
245  $this->ctrl->forwardCommand($types_gui);
246  break;
247  case strtolower(ilOrgUnitUserAssignmentGUI::class):
248  $this->tabs_gui->activateTab(self::TAB_STAFF);
249  $ilOrgUnitUserAssignmentGUI = new ilOrgUnitUserAssignmentGUI();
250  $this->ctrl->forwardCommand($ilOrgUnitUserAssignmentGUI);
251  break;
252  default:
253  switch ($cmd) {
254  case '':
255  case 'view':
256  case 'render':
257  case 'cancel':
258  case 'cancelDelete':
259  $this->view();
260  break;
261  case 'performPaste':
262  $this->performPaste();
263  break;
264  case 'paste':
265  $this->performPaste();
266  break;
267  case 'performPasteIntoMultipleObjects':
269  break;
270  case 'create':
271  parent::createObject();
272  break;
273  case 'save':
274  parent::saveObject();
275  break;
276  case 'delete':
277  $this->tabs_gui->clearTargets();
278  $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this));
279  parent::deleteObject();
280  break;
281  case 'confirmedDelete':
282  parent::confirmedDeleteObject();
283  break;
284  case 'cut':
285  $this->tabs_gui->clearTargets();
286  $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this));
287  parent::cutObject();
288  break;
289  case 'clear':
290  parent::clearObject();
291  break;
292  case 'enableAdministrationPanel':
293  parent::enableAdministrationPanelObject();
294  break;
295  case 'disableAdministrationPanel':
296  parent::disableAdministrationPanelObject();
297  break;
298  case 'getAsynchItemList':
299  parent::getAsynchItemListObject();
300  break;
301  case self::CMD_EDIT_SETTINGS:
302  $this->tabs_gui->activateTab(self::TAB_SETTINGS);
303  $this->setSubTabsSettings('edit_settings');
304  $this->editSettings();
305  break;
306  case 'updateSettings':
307  $this->tabs_gui->activateTab(self::TAB_SETTINGS);
308  $this->setSubTabsSettings('edit_settings');
309  $this->updateSettings();
310  break;
311  case 'editAdvancedSettings':
312  $this->tabs_gui->activateTab(self::TAB_SETTINGS);
313  $this->setSubTabsSettings('edit_advanced_settings');
314  $this->editAdvancedSettings();
315  break;
316  case 'updateAdvancedSettings':
317  $this->tabs_gui->activateTab(self::TAB_SETTINGS);
318  $this->setSubTabsSettings('edit_advanced_settings');
319  $this->updateAdvancedSettings();
320  break;
321  case 'importFile':
322  $this->importFileObject();
323  break;
324  case 'cancelMoveLink':
325  $this->cancelMoveLinkObject();
326  break;
327  }
328  break;
329  }
330  }
331 
332 
336  protected function afterSave(ilObject $a_new_object)
337  {
338  ilUtil::sendSuccess($this->lng->txt("object_added"), true);
339  $this->ctrl->setParameter($this, "ref_id", $a_new_object->getRefId());
341  $this->getReturnLocation(
342  "save",
343  $this->ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS, "", false, false)
344  )
345  );
346  }
347 
348 
349  public function view()
350  {
351  if (!$this->rbacsystem->checkAccess("read", $_GET["ref_id"])) {
352  if ($this->rbacsystem->checkAccess("visible", $_GET["ref_id"])) {
353  ilUtil::sendFailure($this->lng->txt("msg_no_perm_read"));
354  $this->ctrl->redirectByClass('ilinfoscreengui', '');
355  }
356 
357  $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->WARNING);
358  }
359 
360  parent::renderObject();
361  $this->tabs_gui->activateTab("view_content");
362  $this->tabs_gui->removeSubTab("page_editor");
363  $this->tabs_gui->removeSubTab("ordering"); // Mantis 0014728
364  }
365 
366 
377  protected function initCreationForms($a_new_type)
378  {
379  $forms = array(
380  self::CFORM_NEW => $this->initCreateForm($a_new_type),
381  self::CFORM_IMPORT => $this->initImportForm($a_new_type),
382  );
383 
384  return $forms;
385  }
386 
387 
388  public function showPossibleSubObjects()
389  {
390  $gui = new ilObjectAddNewItemGUI($this->object->getRefId());
392  $gui->setCreationUrl("ilias.php?ref_id=" . $_GET["ref_id"]
393  . "&admin_mode=settings&cmd=create&baseClass=ilAdministrationGUI");
394  $gui->render();
395  }
396 
397 
398  public function showTree()
399  {
400  $tree = new ilOrgUnitExplorerGUI("orgu_explorer", "ilObjOrgUnitGUI", "showTree", new ilTree(1));
401  $tree->setTypeWhiteList($this->getTreeWhiteList());
402  if (!$tree->handleCommand()) {
403  $this->tpl->setLeftNavContent($tree->getHTML());
404  }
405  $this->ctrl->setParameterByClass("ilObjOrgUnitGUI", "ref_id", $_GET["ref_id"]);
406  }
407 
408 
409  protected function getTreeWhiteList()
410  {
411  $whiteList = array( "orgu" );
412  $pls = ilOrgUnitExtension::getActivePluginIdsForTree();
413 
414  return array_merge($whiteList, $pls);
415  }
416 
417 
421  public function setTitleAndDescription()
422  {
423  # all possible create permissions
424  parent::setTitleAndDescription();
425  if ($this->object->getTitle() == "__OrgUnitAdministration") {
426  $this->tpl->setTitle($this->lng->txt("objs_orgu"));
427  $this->tpl->setDescription($this->lng->txt("objs_orgu"));
428  }
429 
430  // Check for custom icon of type
431  if ($this->ilias->getSetting('custom_icons')) {
432  $icons_cache = ilObjOrgUnit::getIconsCache();
433  $icon_file = (isset($icons_cache[$this->object->getId()])) ? $icons_cache[$this->object->getId()] : '';
434  if ($icon_file) {
435  $this->tpl->setTitleIcon($icon_file, $this->lng->txt("obj_"
436  . $this->object->getType()));
437  }
438  }
439  }
440 
441 
445  protected function addAdminLocatorItems($a_do_not_add_object = false)
446  {
447  $path = $this->tree->getPathFull($_GET["ref_id"], ilObjOrgUnit::getRootOrgRefId());
448  // add item for each node on path
449  foreach ((array) $path as $key => $row) {
450  if ($row["title"] == "__OrgUnitAdministration") {
451  $row["title"] = $this->lng->txt("objs_orgu");
452  }
453  $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $row["child"]);
454  $this->ilLocator->addItem($row["title"], $this->ctrl->getLinkTargetByClass("ilobjorgunitgui", "view"), ilFrameTargetInfo::_getFrame("MainContent"), $row["child"]);
455  $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $_GET["ref_id"]);
456  }
457  }
458 
459 
464  protected function redirectToRefId($a_ref_id, $a_cmd = "")
465  {
466  $obj_type = ilObject::_lookupType($a_ref_id, true);
467  if ($obj_type != "orgu") {
468  parent::redirectToRefId($a_ref_id, $a_cmd);
469  } else {
470  $this->ctrl->setParameterByClass("ilObjOrgUnitGUI", "ref_id", $a_ref_id);
471  $this->ctrl->redirectByClass("ilObjOrgUnitGUI", $a_cmd);
472  }
473  }
474 
475 
479  public function getTabs()
480  {
481  $read_access_ref_id = $this->rbacsystem->checkAccess('visible,read', $this->object->getRefId());
482  if ($read_access_ref_id) {
483  $this->tabs_gui->addTab("view_content", $this->lng->txt("content"), $this->ctrl->getLinkTarget($this, ""));
484  $this->tabs_gui->addTab("info_short", "Info", $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
485  }
486 
487  // Tabs for OrgUnits exclusive root!
488  if ($this->object->getRefId() != ilObjOrgUnit::getRootOrgRefId()) {
489  if (ilObjOrgUnitAccess::_checkAccessStaff($this->object->getRefId())) {
490  // $this->tabs_gui->addTab('legacy_staff', 'legacy_staff', $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "showStaff"));
491  $this->tabs_gui->addTab(self::TAB_STAFF, $this->lng->txt(self::TAB_STAFF), $this->ctrl->getLinkTargetByClass(ilOrgUnitUserAssignmentGUI::class, ilOrgUnitUserAssignmentGUI::CMD_INDEX));
492  }
493  if ($read_access_ref_id) {
494  $this->tabs_gui->addTab(self::TAB_SETTINGS, $this->lng->txt(self::TAB_SETTINGS), $this->ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS));
495  $this->tabs_gui->addTab("administrate_users", $this->lng->txt("administrate_users"), $this->ctrl->getLinkTargetByClass("ilLocalUserGUI", "index"));
496  }
497  }
498 
499  if ($read_access_ref_id) {
500  if ($this->object->getRefId() == ilObjOrgUnit::getRootOrgRefId()) {
501  $this->tabs_gui->addTab(self::TAB_GLOBAL_SETTINGS, $this->lng->txt('settings'), $this->ctrl->getLinkTargetByClass(ilOrgUnitGlobalSettingsGUI::class));
502  }
503  $this->tabs_gui->addTab(self::TAB_EXPORT, $this->lng->txt(self::TAB_EXPORT), $this->ctrl->getLinkTargetByClass(ilOrgUnitExportGUI::class));
504 
505  // Add OrgUnit types and positions tabs
506  if ($this->object->getRefId() == ilObjOrgUnit::getRootOrgRefId()) {
507  $this->tabs_gui->addTab(self::TAB_ORGU_TYPES, $this->lng->txt(self::TAB_ORGU_TYPES), $this->ctrl->getLinkTargetByClass(ilOrgUnitTypeGUI::class));
508  $this->tabs_gui->addTab(self::TAB_POSITIONS, $this->lng->txt(self::TAB_POSITIONS), $this->ctrl->getLinkTargetByClass(ilOrgUnitPositionGUI::class));
509  }
510  }
511  parent::getTabs();
512  }
513 
514 
518  protected function setSubTabsSettings($active_tab_id)
519  {
520  $next_class = $this->ctrl->getNextClass($this);
521  $cmd = $this->ctrl->getCmd();
522  $this->tabs_gui->addSubTab('edit_settings', $this->lng->txt(self::TAB_SETTINGS), $this->ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS));
523  $this->tabs_gui->addSubTab("edit_translations", $this->lng->txt("obj_multilinguality"), $this->ctrl->getLinkTargetByClass("iltranslationgui", "editTranslations"));
524 
525  $ilOrgUnitType = $this->object->getOrgUnitType();
526  if ($ilOrgUnitType instanceof ilOrgUnitType) {
527  if (count($ilOrgUnitType->getAssignedAdvancedMDRecords(true))) {
528  $this->tabs_gui->addSubTab('edit_advanced_settings', $this->lng->txt('orgu_adv_settings'), $this->ctrl->getLinkTarget($this, 'editAdvancedSettings'));
529  }
530  }
531 
532  $this->tabs_gui->setSubTabActive($active_tab_id);
533  switch ($next_class) {
534  case 'iltranslationgui':
535  $this->tabs_gui->setSubTabActive("edit_translations");
536  break;
537  case '':
538  switch ($cmd) {
539  case self::CMD_EDIT_SETTINGS:
540  $this->tabs_gui->setSubTabActive('edit_settings');
541  break;
542  case 'editAdvancedSettings':
543  case 'updateAdvancedSettings':
544  $this->tabs_gui->setSubTabActive('edit_advanced_settings');
545  break;
546  }
547  break;
548  }
549 
550  return;
551  }
552 
553 
557  public function setContentSubTabs()
558  {
560  //only display the import tab at the first level
561  if ($this->rbacsystem->checkAccess("visible, read", $_GET["ref_id"]) and $this->object->getRefId()
563  $this->tabs_gui->addSubTab("import", $this->lng->txt("import"), $this->ctrl->getLinkTargetByClass("ilOrgUnitSimpleImportGUI", "chooseImport"));
564  }
565  }
566 
567 
573  protected function initAdvancedSettingsForm()
574  {
575  $form = new ilPropertyFormGUI();
576  $form->setFormAction($this->ctrl->getFormAction($this));
577  $form->addCommandButton('updateAdvancedSettings', $this->lng->txt('save'));
578  $form->addCommandButton(self::CMD_EDIT_SETTINGS, $this->lng->txt('cancel'));
579 
580  return $form;
581  }
582 
583 
587  protected function editAdvancedSettings()
588  {
589  if (!$this->ilAccess->checkAccess("write", "", $this->ref_id)) {
590  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
591  $this->ctrl->redirect($this);
592  }
593  $form = $this->initAdvancedSettingsForm();
594  $gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'orgu', $this->object->getId(), 'orgu_type', $this->object->getOrgUnitTypeId());
595  $gui->setPropertyForm($form);
596  $gui->parse();
597  $this->tpl->setContent($form->getHTML());
598  }
599 
600 
604  protected function updateAdvancedSettings()
605  {
606  if (!$this->ilAccess->checkAccess("write", "", $this->ref_id)) {
607  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
608  $this->ctrl->redirect($this);
609  }
610  $form = $this->initAdvancedSettingsForm();
611  $gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'orgu', $this->object->getId(), 'orgu_type', $this->object->getOrgUnitTypeId());
612  $gui->setPropertyForm($form);
613  $form->checkInput();
614  $gui->parse();
615  if ($gui->importEditFormPostValues()) {
616  $gui->writeEditForm();
617  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
618  $this->ctrl->redirect($this, 'editAdvancedSettings');
619  } else {
620  $this->tpl->setContent($form->getHTML());
621  }
622  }
623 
624 
625  public function editSettings()
626  {
627  if (!$this->ilAccess->checkAccess("write", "", $this->ref_id)) {
628  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
629  $this->ctrl->redirect($this);
630  }
631  $form = new ilObjOrgUnitSettingsFormGUI($this, $this->object);
632  $this->tpl->setContent($form->getHTML());
633  }
634 
635 
636  public function updateSettings()
637  {
638  if (!$this->ilAccess->checkAccess("write", "", $this->ref_id)) {
639  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
640  $this->ctrl->redirect($this);
641  }
642  $form = new ilObjOrgUnitSettingsFormGUI($this, $this->object);
643  if ($form->saveObject()) {
644  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
645  $this->ctrl->redirect($this, self::CMD_EDIT_SETTINGS);
646  } else {
647  $this->tpl->setContent($form->getHTML());
648  }
649  }
650 
651 
655  public function showAdministrationPanel(&$tpl)
656  {
657  parent::showAdministrationPanel($tpl);
658  //an ugly encapsulation violation in order to remove the "verknüpfen"/"link" and copy button.
660  if (!$toolbar = $tpl->admin_panel_commands_toolbar) {
661  return;
662  }
663  if (is_array($toolbar->items)) {
664  foreach ($toolbar->items as $key => $item) {
665  if ($item["cmd"] == "link" || $item["cmd"] == "copy"
666  || $item["cmd"] == "download") {
667  unset($toolbar->items[$key]);
668  }
669  }
670  }
671  }
672 
673 
674  public static function _goto($ref_id)
675  {
676  global $DIC;
677  $ilCtrl = $DIC['ilCtrl'];
678  $ilCtrl->initBaseClass("ilAdministrationGUI");
679  $ilCtrl->setTargetScript("ilias.php");
680  $ilCtrl->setParameterByClass("ilObjOrgUnitGUI", "ref_id", $ref_id);
681  $ilCtrl->setParameterByClass("ilObjOrgUnitGUI", "admin_mode", self::TAB_SETTINGS);
682  $ilCtrl->setParameterByClass("IlObjPluginDispatchGUI", "admin_mode", self::TAB_SETTINGS);
683  $ilCtrl->redirectByClass(array( "ilAdministrationGUI", "ilObjOrgUnitGUI" ), "view");
684  }
685 
686 
687  protected function getTreeSelectorGUI($cmd)
688  {
689  global $DIC;
690  $tree = $DIC['tree'];
691  $explorer = new ilOrgUnitExplorerGUI("rep_exp_sel", $this, "showPasteTree", $tree);
692  $explorer->setAjax(false);
693  $explorer->setSelectMode('nodes[]', false);
694 
695  return $explorer;
696  }
697 
698 
702  public function getAdminTabs()
703  {
704  $this->getTabs();
705  }
706 
707 
711  public function performPaste()
712  {
713  if (!in_array($_SESSION['clipboard']['cmd'], array( 'cut' ))) {
714  $message = __METHOD__ . ": cmd was not 'cut' ; may be a hack attempt!";
715  $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING);
716  }
717  if ($_SESSION['clipboard']['cmd'] == 'cut') {
718  if (isset($_GET['ref_id']) && (int) $_GET['ref_id']) {
719  $_POST['nodes'] = array( $_GET['ref_id'] );
721  }
722  }
723  $this->ctrl->returnToParent($this);
724  }
725 
726 
730  public function doUserAutoCompleteObject()
731  {
732  }
733 
734  //
735  // METHODS for local user administration.
736  //
741  public function &__initTableGUI()
742  {
743  return parent::__initTableGUI();
744  }
745 
746 
751  public function __setTableGUIBasicData(&$tbl, &$result_set, $a_from = "")
752  {
753  return parent::__setTableGUIBasicData($tbl, $result_set, $a_from);
754  }
755 
756 
757  public function cancelMoveLinkObject()
758  {
759  global $DIC;
760  $parent_ref_id = $_SESSION["clipboard"]["parent"];
761  unset($_SESSION['clipboard']);
762  $DIC->ctrl()->setParameter($this, 'ref_id', $parent_ref_id);
763  $DIC->ctrl()->redirect($this);
764  }
765 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
setSubTabsSettings($active_tab_id)
Class ilInfoScreenGUI.
$_SESSION["AccountId"]
This class represents a property form user interface.
Class ilOrgUnitType.
global $DIC
Definition: saml.php:7
setPropertyForm($form)
set property form object
$_GET["client_id"]
$tbl
Definition: example_048.php:81
static _checkAccessStaff($ref_id)
afterSave(ilObject $a_new_object)
__setTableGUIBasicData(&$tbl, &$result_set, $a_from="")
Class ilLocalUserGUI.
Class ilOrgUnitUserAssignmentGUI.
Class ilOrgUnitPositionGUI.
Class ilObjOrgUnit GUI class.
initCreationForms($a_new_type)
initCreationForms
logging
Definition: class.ilLog.php:18
Class ilOrgUnitSimpleImportGUI.
initAdvancedSettingsForm()
Initialize the form for editing advanced meta data.
Class ilAccessHandler.
Class ilOrgUnitExportGUI.
setContentSubTabs()
Set content sub tabs.
global $ilCtrl
Definition: ilias.php:18
initImportForm($a_new_type)
Init object import form.
catch(Exception $e) $message
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...
setInfoObject($info)
get info sections
if(isset($_POST['submit'])) $form
Class ilTranslationGUI.
updateAdvancedSettings()
Update Advanced Metadata.
setTitleAndDescription()
called by prepare output
static _checkAccessAdministrateUsers($ref_id)
redirection script todo: (a better solution should control the processing via a xml file) ...
importFileObject($parent_id=null, $a_catch_errors=true)
Import.
Class ilOrgUnitTypeGUI.
initCreateForm($a_new_type)
Init object creation form.
editAdvancedSettings()
Edit Advanced Metadata.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getRootOrgRefId()
performPaste()
Prepare $_POST for the generic method performPasteIntoMultipleObjectsObject
redirectToRefId($a_ref_id, $a_cmd="")
static _getFrame($a_class, $a_type='')
Get content frame name.
Class ilOrgUnitStaffGUI.
Create new PHPExcel object
obj_idprivate
Render add new item selector.
Class ilObjOrgUnitSettingsFormGUI.
Class ilObjUserFolderGUI.
getRefId()
get reference id public
Class ilOrgUnitSimpleUserImportGUI.
Class ilOrgUnitExplorerGUI.
Class ilContainerGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
showAdministrationPanel(&$tpl)
show administration panel
Class ilObjUserGUI.
$info
Definition: index.php:5
static redirect($a_script)
static _checkAccessToUserLearningProgress($ref_id, $usr_id)
$key
Definition: croninfo.php:18
Class ilObjUserTrackingGUI.
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
$_POST["username"]
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
addAdminLocatorItems($a_do_not_add_object=false)
addStandardContainerSubTabs($a_include_view=true)
Add standar container subtabs for view, manage, oderdering and text/media editor link.