ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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
5
29{
30 const TAB_POSITIONS = 'positions';
31 const TAB_ORGU_TYPES = 'orgu_types';
32 const TAB_SETTINGS = "settings";
33 const TAB_STAFF = 'orgu_staff';
34 const TAB_GLOBAL_SETTINGS = 'global_settings';
35 const TAB_EXPORT = 'export';
36 const TAB_VIEW_CONTENT = 'view_content';
40 public $ctrl;
44 public $tpl;
48 public $tabs_gui;
52 protected $ilAccess;
56 protected $toolbar;
60 protected $ilLocator;
64 public $tree;
68 public $object;
72 protected $ilLog;
76 public $ilias;
77 const CMD_EDIT_SETTINGS = 'editSettings';
78
79
80 public function __construct()
81 {
82 global $DIC;
83 $tpl = $DIC['tpl'];
84 $ilCtrl = $DIC['ilCtrl'];
85 $ilAccess = $DIC['ilAccess'];
86 $ilToolbar = $DIC['ilToolbar'];
87 $ilLocator = $DIC['ilLocator'];
88 $tree = $DIC['tree'];
89 $lng = $DIC['lng'];
90 $ilLog = $DIC['ilLog'];
91 $ilias = $DIC['ilias'];
92 parent::__construct(array(), $_GET["ref_id"], true, false);
93
94 $this->tpl = $tpl;
95 $this->ctrl = $ilCtrl;
96 $this->ilAccess = $ilAccess;
97 $this->ilLocator = $ilLocator;
98 $this->tree = $tree;
99 $this->toolbar = $ilToolbar;
100 $this->ilLog = $ilLog;
101 $this->ilias = $ilias;
102 $this->type = 'orgu';
103
104 $lng->loadLanguageModule("orgu");
105 $this->tpl->addCss('./Modules/OrgUnit/templates/default/orgu.css');
106
107 $DIC->globalScreen()->tool()->context()->current()->addAdditionalData(OrgUnitToolProvider::SHOW_ORGU_TREE, true);
108 }
109
115 public function executeCommand()
116 {
117 $cmd = $this->ctrl->getCmd();
118 $next_class = $this->ctrl->getNextClass($this);
119 parent::prepareOutput();
120
121 switch ($next_class) {
122 case 'ilorgunitglobalsettingsgui':
123 $this->tabs_gui->activateTab(self::TAB_GLOBAL_SETTINGS);
124 $global_settings = new ilOrgUnitGlobalSettingsGUI();
125 $this->ctrl->forwardCommand($global_settings);
126 break;
127 case "illocalusergui":
129 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
130 $this->ctrl->redirect($this);
131 }
132 $this->tabs_gui->activateTab('administrate_users');
133 $ilLocalUserGUI = new ilLocalUserGUI($this);
134 $this->ctrl->forwardCommand($ilLocalUserGUI);
135 break;
136 case "ilorgunitsimpleimportgui":
137 $this->tabs_gui->activateTab("view");
138 $this->setContentSubTabs();
139 $this->tabs_gui->setSubTabActive('import');
140 $ilOrgUnitSimpleImportGUI = new ilOrgUnitSimpleImportGUI($this);
141 $this->ctrl->forwardCommand($ilOrgUnitSimpleImportGUI);
142 break;
143 case "ilorgunitsimpleuserimportgui":
144 $ilOrgUnitSimpleUserImportGUI = new ilOrgUnitSimpleUserImportGUI($this);
145 $this->ctrl->forwardCommand($ilOrgUnitSimpleUserImportGUI);
146 break;
147 case "ilorgunitstaffgui":
148 case "ilrepositorysearchgui":
149 $this->tabs_gui->activateTab(self::TAB_STAFF);
150 $ilOrgUnitStaffGUI = new ilOrgUnitStaffGUI($this);
151 $this->ctrl->forwardCommand($ilOrgUnitStaffGUI);
152 break;
153 case "ilobjusergui":
154 switch ($cmd) {
155 case "create":
156 $ilObjUserGUI = new ilObjUserGUI("", (int) $_GET['ref_id'], true, false);
157 $ilObjUserGUI->setCreationMode(true);
158 $this->ctrl->forwardCommand($ilObjUserGUI);
159 $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
160 break;
161 case "save":
162 $ilObjUserGUI = new ilObjUserGUI("", $_GET['ref_id'], true, false);
163 $ilObjUserGUI->setCreationMode(true);
164 $this->ctrl->forwardCommand($ilObjUserGUI);
165 $this->tabs_gui->clearTargets();
166 $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
167 break;
168 case "view":
169 case "update":
170 $ilObjUserGUI = new ilObjUserGUI("", (int) $_GET['obj_id'], false, false);
171 $ilObjUserGUI->setCreationMode(false);
172 $this->ctrl->forwardCommand($ilObjUserGUI);
173 $this->tabs_gui->clearTargets();
174 $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
175 break;
176 case "cancel":
177 $this->ctrl->redirectByClass("illocalusergui", "index");
178 break;
179 }
180 break;
181 case "ilobjuserfoldergui":
182 switch ($cmd) {
183 case "view":
184 $this->ctrl->redirectByClass("illocalusergui", "index");
185 break;
186 default:
187 $ilObjUserFolderGUI = new ilObjUserFolderGUI("", (int) $_GET['ref_id'], true, false);
188 $ilObjUserFolderGUI->setUserOwnerId((int) $_GET['ref_id']);
189 $ilObjUserFolderGUI->setCreationMode(true);
190 $this->ctrl->forwardCommand($ilObjUserFolderGUI);
191 $this->tabs_gui->clearTargets();
192 $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTargetByClass("illocalusergui", 'index'));
193 break;
194 }
195 break;
196 case "ilinfoscreengui":
197 $this->tabs_gui->activateTab("info_short");
198 if (!$this->ilAccess->checkAccess("read", "", $this->ref_id) and !$this->ilAccess->checkAccess("visible", "", $this->ref_id)) {
199 $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
200 }
201 $info = new ilInfoScreenGUI($this);
202 $amd_gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_INFO, 'orgu', $this->object->getId(), 'orgu_type', $this->object->getOrgUnitTypeId());
203 $amd_gui->setInfoObject($info);
204 $amd_gui->parse();
205 $this->ctrl->forwardCommand($info);
206 break;
207 case 'ilpermissiongui':
208 $this->tabs_gui->activateTab('perm_settings');
209 $ilPermissionGUI = new ilPermissionGUI($this);
210 $this->ctrl->forwardCommand($ilPermissionGUI);
211 break;
212 case "ilcommonactiondispatchergui":
214 $this->ctrl->forwardCommand($gui);
215 break;
216 case 'illearningprogressgui':
217 case 'illplistofprogressgui':
218 $this->tabs_gui->clearTargets();
219 $this->tabs_gui->setBackTarget($this->lng->txt('backto_staff'), $this->ctrl->getLinkTargetByClass(ilOrgUnitUserAssignmentGUI::class, ilOrgUnitUserAssignmentGUI::CMD_INDEX));
220 if (!ilObjOrgUnitAccess::_checkAccessToUserLearningProgress($this->object->getRefid(), $_GET['obj_id'])) {
221 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
222 $this->ctrl->redirectByClass("ilOrgUnitStaffGUI", "showStaff");
223 }
224 $this->ctrl->saveParameterByClass("illearningprogressgui", "obj_id");
225 $this->ctrl->saveParameterByClass("illearningprogressgui", "recursive");
227 $this->ctrl->forwardCommand($new_gui);
228 break;
229 case 'ilorgunitexportgui':
230 if (!ilObjOrgUnitAccess::_checkAccessExport((int) $_GET['ref_id'])) {
231 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
232 $this->ctrl->redirect($this);
233 }
234 $this->tabs_gui->activateTab(self::TAB_EXPORT);;
235 $ilOrgUnitExportGUI = new ilOrgUnitExportGUI($this);
236 $ilOrgUnitExportGUI->addFormat('xml');
237 $this->ctrl->forwardCommand($ilOrgUnitExportGUI);
238 break;
239 case strtolower(ilTranslationGUI::class):
240 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
241 $this->setSubTabsSettings('edit_translations');
242 $ilTranslationGui = new ilTranslationGUI($this);
243 $this->ctrl->forwardCommand($ilTranslationGui);
244 break;
245 case strtolower(ilOrgUnitTypeGUI::class):
246 $this->tabs_gui->activateTab(self::TAB_ORGU_TYPES);
247 $types_gui = new ilOrgUnitTypeGUI($this);
248 $this->ctrl->forwardCommand($types_gui);
249 break;
250 case strtolower(ilOrgUnitPositionGUI::class):
251 $this->tabs_gui->activateTab(self::TAB_POSITIONS);
252 $types_gui = new ilOrgUnitPositionGUI($this);
253 $this->ctrl->forwardCommand($types_gui);
254 break;
255 case strtolower(ilOrgUnitUserAssignmentGUI::class):
256 $this->tabs_gui->activateTab(self::TAB_STAFF);
257 $ilOrgUnitUserAssignmentGUI = new ilOrgUnitUserAssignmentGUI();
258 $this->ctrl->forwardCommand($ilOrgUnitUserAssignmentGUI);
259 break;
260 default:
261 $this->tabs_gui->activateTab(self::TAB_VIEW_CONTENT);
262 switch ($cmd) {
263 case '':
264 case 'view':
265 case 'render':
266 case 'cancel':
267 case 'cancelDelete':
268 $this->view();
269 break;
270 case 'performPaste':
271 case 'paste':
272 $this->performPaste();
273 break;
274 case 'performPasteIntoMultipleObjects':
276 break;
277 case 'keepObjectsInClipboard':
279 break;
280 case 'create':
281 parent::createObject();
282 break;
283 case 'save':
284 parent::saveObject();
285 break;
286 case 'delete':
287 $this->tabs_gui->clearTargets();
288 $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this));
289 $this->deleteObject();
290 break;
291 case 'confirmedDelete':
292 $this->confirmedDeleteObject();
293 break;
294 case 'cut':
295 $this->tabs_gui->clearTargets();
296 $this->tabs_gui->setBackTarget($this->lng->txt("back"), $this->ctrl->getLinkTarget($this));
297 parent::cutObject();
298 break;
299 case 'clear':
300 parent::clearObject();
301 break;
302 case 'enableAdministrationPanel':
303 parent::enableAdministrationPanelObject();
304 break;
305 case 'disableAdministrationPanel':
306 parent::disableAdministrationPanelObject();
307 break;
308 case 'getAsynchItemList':
309 parent::getAsynchItemListObject();
310 break;
312 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
313 $this->setSubTabsSettings('edit_settings');
314 $this->editSettings();
315 break;
316 case 'updateSettings':
317 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
318 $this->setSubTabsSettings('edit_settings');
319 $this->updateSettings();
320 break;
321 case 'editAdvancedSettings':
322 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
323 $this->setSubTabsSettings('edit_advanced_settings');
324 $this->editAdvancedSettings();
325 break;
326 case 'updateAdvancedSettings':
327 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
328 $this->setSubTabsSettings('edit_advanced_settings');
329 $this->updateAdvancedSettings();
330 break;
331 case 'importFile':
332 $this->importFileObject();
333 break;
334 case 'cancelMoveLink':
335 $this->cancelMoveLinkObject();
336 break;
337 }
338 break;
339 }
340 }
341
342
346 protected function afterSave(ilObject $a_new_object)
347 {
348 ilUtil::sendSuccess($this->lng->txt("object_added"), true);
349 $this->ctrl->setParameter($this, "ref_id", $a_new_object->getRefId());
350 ilUtil::redirect($this->getReturnLocation("save", $this->ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS, "", false, false)));
351 }
352
353
354 public function view()
355 {
356 if (!$this->rbacsystem->checkAccess("read", $_GET["ref_id"])) {
357 if ($this->rbacsystem->checkAccess("visible", $_GET["ref_id"])) {
358 ilUtil::sendFailure($this->lng->txt("msg_no_perm_read"));
359 $this->ctrl->redirectByClass('ilinfoscreengui', '');
360 }
361
362 $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->WARNING);
363 }
364
365 parent::renderObject();
366 $this->tabs_gui->activateTab(self::TAB_VIEW_CONTENT);
367 $this->tabs_gui->removeSubTab("page_editor");
368 $this->tabs_gui->removeSubTab("ordering"); // Mantis 0014728
369 }
370
371
382 protected function initCreationForms($a_new_type)
383 {
384 $forms = array(
385 self::CFORM_NEW => $this->initCreateForm($a_new_type),
386 self::CFORM_IMPORT => $this->initImportForm($a_new_type),
387 );
388
389 return $forms;
390 }
391
392
393 public function showPossibleSubObjects()
394 {
395 $gui = new ilObjectAddNewItemGUI($this->object->getRefId());
397 //$gui->setCreationUrl("ilias.php?ref_id=" . $_GET["ref_id"] . "&admin_mode=settings&cmd=create&baseClass=ilAdministrationGUI&cmdClass=ilobjorgunitgui");
398 $gui->setCreationUrl($this->ctrl->getLinkTarget($this, 'create'));
399 $gui->render();
400 }
401
402
406 public function setTitleAndDescription()
407 {
408 # all possible create permissions
409 parent::setTitleAndDescription();
410 if ($this->object->getTitle() == "__OrgUnitAdministration") {
411 $this->tpl->setTitle($this->lng->txt("objs_orgu"));
412 $this->tpl->setDescription($this->lng->txt("objs_orgu"));
413 }
414
415 // Check for custom icon of type
416 if ($this->ilias->getSetting('custom_icons')) {
417 $icons_cache = ilObjOrgUnit::getIconsCache();
418 $icon_file = (isset($icons_cache[$this->object->getId()])) ? $icons_cache[$this->object->getId()] : '';
419 if ($icon_file) {
420 $this->tpl->setTitleIcon($icon_file, $this->lng->txt("obj_" . $this->object->getType()));
421 }
422 }
423 }
424
425
429 protected function addAdminLocatorItems($a_do_not_add_object = false)
430 {
431 $path = $this->tree->getPathFull($_GET["ref_id"], ilObjOrgUnit::getRootOrgRefId());
432 // add item for each node on path
433 foreach ((array) $path as $key => $row) {
434 if ($row["title"] == "__OrgUnitAdministration") {
435 $row["title"] = $this->lng->txt("objs_orgu");
436 }
437 $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $row["child"]);
438 $this->ilLocator->addItem($row["title"], $this->ctrl->getLinkTargetByClass("ilobjorgunitgui", "view"), ilFrameTargetInfo::_getFrame("MainContent"), $row["child"]);
439 $this->ctrl->setParameterByClass("ilobjorgunitgui", "ref_id", $_GET["ref_id"]);
440 }
441 }
442
443
448 protected function redirectToRefId($a_ref_id, $a_cmd = "")
449 {
450 $obj_type = ilObject::_lookupType($a_ref_id, true);
451 if ($obj_type != "orgu") {
452 parent::redirectToRefId($a_ref_id, $a_cmd);
453 } else {
454 $this->ctrl->setParameterByClass("ilObjOrgUnitGUI", "ref_id", $a_ref_id);
455 $this->ctrl->redirectByClass("ilObjOrgUnitGUI", $a_cmd);
456 }
457 }
458
459
463 public function getTabs()
464 {
465 $read_access_ref_id = $this->rbacsystem->checkAccess('visible,read', $this->object->getRefId());
466 if ($read_access_ref_id) {
467 $this->tabs_gui->addTab(self::TAB_VIEW_CONTENT, $this->lng->txt("content"), $this->ctrl->getLinkTarget($this, ""));
468 $this->tabs_gui->addTab("info_short", "Info", $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"));
469 }
470
471 // Tabs for OrgUnits exclusive root!
472 if ($this->object->getRefId() != ilObjOrgUnit::getRootOrgRefId()) {
473 if (ilObjOrgUnitAccess::_checkAccessStaff($this->object->getRefId())) {
474 // $this->tabs_gui->addTab('legacy_staff', 'legacy_staff', $this->ctrl->getLinkTargetByClass("ilOrgUnitStaffGUI", "showStaff"));
475 $this->tabs_gui->addTab(self::TAB_STAFF, $this->lng->txt(self::TAB_STAFF), $this->ctrl->getLinkTargetByClass(ilOrgUnitUserAssignmentGUI::class, ilOrgUnitUserAssignmentGUI::CMD_INDEX));
476 }
477 if (ilObjOrgUnitAccess::_checkAccessSettings($this->object->getRefId())) {
478 $this->tabs_gui->addTab(self::TAB_SETTINGS, $this->lng->txt(self::TAB_SETTINGS), $this->ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS));
479 }
480 if (ilObjOrgUnitAccess::_checkAccessAdministrateUsers($this->object->getRefId())) {
481 $this->tabs_gui->addTab("administrate_users", $this->lng->txt("administrate_users"), $this->ctrl->getLinkTargetByClass("ilLocalUserGUI", "index"));
482 }
483 }
484
485 if (ilObjOrgUnitAccess::_checkAccessSettings($this->object->getRefId())) {
486 if ($this->object->getRefId() == ilObjOrgUnit::getRootOrgRefId()) {
487 $this->tabs_gui->addTab(self::TAB_GLOBAL_SETTINGS, $this->lng->txt('settings'), $this->ctrl->getLinkTargetByClass(ilOrgUnitGlobalSettingsGUI::class));
488 }
489 $this->tabs_gui->addTab(self::TAB_EXPORT, $this->lng->txt(self::TAB_EXPORT), $this->ctrl->getLinkTargetByClass(ilOrgUnitExportGUI::class));
490
491 // Add OrgUnit types and positions tabs
492 if ($this->object->getRefId() == ilObjOrgUnit::getRootOrgRefId()) {
493 $this->tabs_gui->addTab(self::TAB_ORGU_TYPES, $this->lng->txt(self::TAB_ORGU_TYPES), $this->ctrl->getLinkTargetByClass(ilOrgUnitTypeGUI::class));
494 $this->tabs_gui->addTab(self::TAB_POSITIONS, $this->lng->txt(self::TAB_POSITIONS), $this->ctrl->getLinkTargetByClass(ilOrgUnitPositionGUI::class));
495 }
496 }
497 parent::getTabs();
498 }
499
500
504 protected function setSubTabsSettings($active_tab_id)
505 {
506 $next_class = $this->ctrl->getNextClass($this);
507 $cmd = $this->ctrl->getCmd();
508 $this->tabs_gui->addSubTab('edit_settings', $this->lng->txt(self::TAB_SETTINGS), $this->ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS));
509 $this->tabs_gui->addSubTab("edit_translations", $this->lng->txt("obj_multilinguality"), $this->ctrl->getLinkTargetByClass("iltranslationgui", "editTranslations"));
510
511 $ilOrgUnitType = $this->object->getOrgUnitType();
512 if ($ilOrgUnitType instanceof ilOrgUnitType) {
513 if (count($ilOrgUnitType->getAssignedAdvancedMDRecords(true))) {
514 $this->tabs_gui->addSubTab('edit_advanced_settings', $this->lng->txt('orgu_adv_settings'), $this->ctrl->getLinkTarget($this, 'editAdvancedSettings'));
515 }
516 }
517
518 $this->tabs_gui->setSubTabActive($active_tab_id);
519 switch ($next_class) {
520 case 'iltranslationgui':
521 $this->tabs_gui->setSubTabActive("edit_translations");
522 break;
523 case '':
524 switch ($cmd) {
526 $this->tabs_gui->setSubTabActive('edit_settings');
527 break;
528 case 'editAdvancedSettings':
529 case 'updateAdvancedSettings':
530 $this->tabs_gui->setSubTabActive('edit_advanced_settings');
531 break;
532 }
533 break;
534 }
535
536 return;
537 }
538
539
543 public function setContentSubTabs()
544 {
546 //only display the import tab at the first level
547 if ($this->rbacsystem->checkAccess("visible, read", $_GET["ref_id"]) and $this->object->getRefId() == ilObjOrgUnit::getRootOrgRefId()) {
548 $this->tabs_gui->addSubTab("import", $this->lng->txt("import"), $this->ctrl->getLinkTargetByClass("ilOrgUnitSimpleImportGUI", "chooseImport"));
549 }
550 }
551
552
558 protected function initAdvancedSettingsForm()
559 {
560 $form = new ilPropertyFormGUI();
561 $form->setFormAction($this->ctrl->getFormAction($this));
562 $form->addCommandButton('updateAdvancedSettings', $this->lng->txt('save'));
563 $form->addCommandButton(self::CMD_EDIT_SETTINGS, $this->lng->txt('cancel'));
564
565 return $form;
566 }
567
568
572 protected function editAdvancedSettings()
573 {
574 if (!$this->ilAccess->checkAccess("write", "", $this->ref_id)) {
575 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
576 $this->ctrl->redirect($this);
577 }
578 $form = $this->initAdvancedSettingsForm();
579 $gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'orgu', $this->object->getId(), 'orgu_type', $this->object->getOrgUnitTypeId());
580 $gui->setPropertyForm($form);
581 $gui->parse();
582 $this->tpl->setContent($form->getHTML());
583 }
584
585
589 protected function updateAdvancedSettings()
590 {
591 if (!$this->ilAccess->checkAccess("write", "", $this->ref_id)) {
592 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
593 $this->ctrl->redirect($this);
594 }
595 $form = $this->initAdvancedSettingsForm();
596 $gui = new ilAdvancedMDRecordGUI(ilAdvancedMDRecordGUI::MODE_EDITOR, 'orgu', $this->object->getId(), 'orgu_type', $this->object->getOrgUnitTypeId());
597 $gui->setPropertyForm($form);
598 $form->checkInput();
599 $gui->parse();
600 if ($gui->importEditFormPostValues()) {
601 $gui->writeEditForm();
602 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
603 $this->ctrl->redirect($this, 'editAdvancedSettings');
604 } else {
605 $this->tpl->setContent($form->getHTML());
606 }
607 }
608
609
610 public function editSettings()
611 {
612 if (!$this->ilAccess->checkAccess("write", "", $this->ref_id)) {
613 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
614 $this->ctrl->redirect($this);
615 }
616 $form = new ilObjOrgUnitSettingsFormGUI($this, $this->object);
617 $this->tpl->setContent($form->getHTML());
618 }
619
620
621 public function updateSettings()
622 {
623 if (!$this->ilAccess->checkAccess("write", "", $this->ref_id)) {
624 ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
625 $this->ctrl->redirect($this);
626 }
627 $form = new ilObjOrgUnitSettingsFormGUI($this, $this->object);
628 if ($form->saveObject()) {
629 ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
630 $this->ctrl->redirect($this, self::CMD_EDIT_SETTINGS);
631 } else {
632 $this->tpl->setContent($form->getHTML());
633 }
634 }
635
636
640 public function showAdministrationPanel()
641 {
642 parent::showAdministrationPanel();
643 global $DIC;
644 //an ugly encapsulation violation in order to remove the "verknüpfen"/"link" and copy button.
646 if (!$toolbar = $DIC->ui()->mainTemplate()->admin_panel_commands_toolbar) {
647 return;
648 }
649 if (is_array($toolbar->items)) {
650 foreach ($toolbar->items as $key => $item) {
651 if ($item["cmd"] == "link" || $item["cmd"] == "copy"
652 || $item["cmd"] == "download"
653 ) {
654 unset($toolbar->items[$key]);
655 }
656 }
657 }
658 }
659
660
661 public static function _goto($ref_id)
662 {
663 global $DIC;
664 $ilCtrl = $DIC['ilCtrl'];
665 $ilCtrl->initBaseClass("ilAdministrationGUI");
666 $ilCtrl->setParameterByClass("ilObjOrgUnitGUI", "ref_id", $ref_id);
667 $ilCtrl->setParameterByClass("ilObjOrgUnitGUI", "admin_mode", self::TAB_SETTINGS);
668 $ilCtrl->setParameterByClass("IlObjPluginDispatchGUI", "admin_mode", self::TAB_SETTINGS);
669 $ilCtrl->redirectByClass(array("ilAdministrationGUI", "ilObjOrgUnitGUI"), "view");
670 }
671
672
673 protected function getTreeSelectorGUI($cmd)
674 {
675 global $DIC;
676 $tree = $DIC['tree'];
677 $explorer = new ilOrgUnitExplorerGUI("rep_exp_sel", $this, "showPasteTree", $tree);
678 $explorer->setAjax(false);
679 $explorer->setSelectMode('nodes[]', false);
680
681 return $explorer;
682 }
683
684
688 public function getAdminTabs()
689 {
690 $this->getTabs();
691 }
692
693
697 public function performPaste()
698 {
699 if (!in_array($_SESSION['clipboard']['cmd'], array('cut'))) {
700 $message = __METHOD__ . ": cmd was not 'cut' ; may be a hack attempt!";
701 $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING);
702 }
703 if ($_SESSION['clipboard']['cmd'] == 'cut') {
704 if (isset($_GET['ref_id']) && (int) $_GET['ref_id']) {
705 $this->pasteObject();
706 }
707 }
708 $this->ctrl->returnToParent($this);
709 }
710
711
715 public function doUserAutoCompleteObject()
716 {
717 }
718
719 //
720 // METHODS for local user administration.
721 //
726 public function &__initTableGUI()
727 {
728 return parent::__initTableGUI();
729 }
730
735 public function confirmedDeleteObject()
736 {
737 global $DIC;
738
739 $ids = filter_input(INPUT_POST, 'id', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
740 if (count($ids) > 0) {
742 ilUtil::sendSuccess($DIC->language()->txt("info_deleted"), true);
743 }
744 $this->ctrl->returnToParent($this);
745 }
746
747
754 public function deleteObject($a_error = false)
755 {
757 require_once("./Services/Repository/classes/class.ilRepUtilGUI.php");
758 $ru = new ilRepUtilGUI($this);
759
760 $arr_ref_ids = [];
761 //Delete via Manage (more than one)
762 if (is_array($_POST['id']) && count($_POST['id']) > 0) {
763 $arr_ref_ids = $_POST['id'];
764 } elseif ($_GET['item_ref_id'] > 0) {
765 $arr_ref_ids = [$_GET['item_ref_id']];
766 }
767
768 if (!$ru->showDeleteConfirmation($arr_ref_ids, false)) {
769 $ilCtrl->returnToParent($this);
770 }
771 }
772
773
778 public function __setTableGUIBasicData(&$tbl, &$result_set, $a_from = "")
779 {
780 return parent::__setTableGUIBasicData($tbl, $result_set, $a_from);
781 }
782
783
784 public function cancelMoveLinkObject()
785 {
786 global $DIC;
787 $parent_ref_id = $_SESSION["clipboard"]["parent"];
788 unset($_SESSION['clipboard']);
789 $DIC->ctrl()->setParameter($this, 'ref_id', $parent_ref_id);
790 $DIC->ctrl()->redirect($this);
791 }
792}
$_GET["client_id"]
$_POST["username"]
$_SESSION["AccountId"]
An exception for terminatinating execution or to throw for unit testing.
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)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Class ilContainerGUI.
addStandardContainerSubTabs($a_include_view=true)
Add standar container subtabs for view, manage, oderdering and text/media editor link.
pasteObject()
paste object from clipboard to current place Depending on the chosen command the object(s) are linked...
keepObjectsInClipboardObject()
Keep objects in the clipboard.
showAdministrationPanel()
show administration panel
static _getFrame($a_class, $a_type='')
Get content frame name.
Class ilInfoScreenGUI.
Class ilObjUserTrackingGUI.
Class ilLocalUserGUI.
logging
Definition: class.ilLog.php:19
static _checkAccessToUserLearningProgress($ref_id, $usr_id)
static _checkAccessStaff($ref_id)
static _checkAccessExport(int $ref_id)
static _checkAccessSettings(int $ref_id)
static _checkAccessAdministrateUsers($ref_id)
Class ilObjOrgUnit GUI class.
confirmedDeleteObject()
confirmed deletion of org units -> org units are deleted immediately, without putting them to the tra...
__setTableGUIBasicData(&$tbl, &$result_set, $a_from="")
redirectToRefId($a_ref_id, $a_cmd="")
afterSave(ilObject $a_new_object)
@inheritDoc
updateAdvancedSettings()
Update Advanced Metadata.
setContentSubTabs()
Set content sub tabs.
setTitleAndDescription()
called by prepare output
editAdvancedSettings()
Edit Advanced Metadata.
cancelMoveLinkObject()
Cancel move|link empty clipboard and return to parent.
addAdminLocatorItems($a_do_not_add_object=false)
showPossibleSubObjects()
show possible sub objects selection list
performPaste()
@description Prepare $_POST for the generic method performPasteIntoMultipleObjectsObject
setSubTabsSettings($active_tab_id)
deleteObject($a_error=false)
Display deletion confirmation screen for Org Units.
initCreationForms($a_new_type)
initCreationForms
initAdvancedSettingsForm()
Initialize the form for editing advanced meta data.
Class ilObjOrgUnitSettingsFormGUI.
static getRootOrgRefId()
Class ilObjUserFolderGUI.
Class ilObjUserGUI.
Render add new item selector.
initImportForm($a_new_type)
Init object import form.
importFileObject($parent_id=null, $a_catch_errors=true)
Import.
initCreateForm($a_new_type)
Init object creation form.
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
Class ilObject Basic functions for all objects.
getRefId()
get reference id @access public
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilOrgUnitExplorerGUI.
Class ilOrgUnitExportGUI.
Class ilOrgUnitPositionGUI.
Class ilOrgUnitSimpleImportGUI.
Class ilOrgUnitSimpleUserImportGUI.
Class ilOrgUnitStaffGUI.
Class ilOrgUnitTypeGUI.
Class ilOrgUnitType.
Class ilOrgUnitUserAssignmentGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
This class represents a property form user interface.
Repository GUI Utilities.
static removeObjectsFromSystem($a_ref_ids, $a_from_recovery_folder=false)
remove objects from trash bin and all entries therefore every object needs a specific deleteObject() ...
Class ilTranslationGUI.
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilCtrl
Definition: ilias.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
redirection script todo: (a better solution should control the processing via a xml file)
$message
Definition: xapiexit.php:14
$DIC
Definition: xapitoken.php:46