19 declare(strict_types=1);
61 protected \ILIAS\DI\LoggingServices
$ilLog;
67 $this->ilLocator = $DIC[
'ilLocator'];
68 $this->tree = $DIC->repositoryTree();
69 $this->
toolbar = $DIC->toolbar();
70 $this->
ilLog = $DIC->logger();
71 $this->
ilias = $DIC[
'ilias'];
77 $to_int =
$dic[
'refinery']->kindlyTo()->int();
78 $this->ref_id =
$dic[
'query']->retrieve(
'ref_id', $to_int);
83 $this->
lng->loadLanguageModule(
"orgu");
84 $this->
lng->loadLanguageModule(
"content");
86 $DIC->globalScreen()->tool()->context()->current()->addAdditionalData(
87 OrgUnitToolProvider::SHOW_ORGU_TREE,
99 $cmd = $this->
ctrl->getCmd();
100 $next_class = $this->
ctrl->getNextClass($this);
101 parent::prepareOutput();
103 switch ($next_class) {
104 case 'ilorgunitglobalsettingsgui':
105 $this->tabs_gui->activateTab(self::TAB_GLOBAL_SETTINGS);
107 $this->
ctrl->forwardCommand($global_settings);
109 case "illocalusergui":
111 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
112 $this->
ctrl->redirect($this);
114 $this->tabs_gui->activateTab(
'administrate_users');
116 $this->
ctrl->forwardCommand($ilLocalUserGUI);
118 case "ilorgunitsimpleimportgui":
119 $this->tabs_gui->activateTab(
"view");
121 $this->tabs_gui->setSubTabActive(
'import');
123 $this->
ctrl->forwardCommand($ilOrgUnitSimpleImportGUI);
125 case "ilorgunitsimpleuserimportgui":
127 $this->
ctrl->forwardCommand($ilOrgUnitSimpleUserImportGUI);
132 $ilObjUserGUI =
new ilObjUserGUI(
"", $this->ref_id,
true,
false);
133 $ilObjUserGUI->setCreationMode(
true);
134 $this->
ctrl->forwardCommand($ilObjUserGUI);
135 $this->tabs_gui->setBackTarget(
136 $this->
lng->txt(
"back"),
137 $this->
ctrl->getLinkTargetByClass(
"illocalusergui",
'index')
141 $ilObjUserGUI =
new ilObjUserGUI(
"", $this->ref_id,
true,
false);
142 $ilObjUserGUI->setCreationMode(
true);
143 $this->
ctrl->forwardCommand($ilObjUserGUI);
144 $this->tabs_gui->clearTargets();
145 $this->tabs_gui->setBackTarget(
146 $this->
lng->txt(
"back"),
147 $this->
ctrl->getLinkTargetByClass(
"illocalusergui",
'index')
153 $ilObjUserGUI->setCreationMode(
false);
154 $this->
ctrl->forwardCommand($ilObjUserGUI);
155 $this->tabs_gui->clearTargets();
156 $this->tabs_gui->setBackTarget(
157 $this->
lng->txt(
"back"),
158 $this->
ctrl->getLinkTargetByClass(
"illocalusergui",
'index')
162 $this->
ctrl->redirectByClass(
"illocalusergui",
"index");
166 case "ilobjuserfoldergui":
169 $this->
ctrl->redirectByClass(
"illocalusergui",
"index");
173 $ilObjUserFolderGUI->setUserOwnerId($this->ref_id);
174 $ilObjUserFolderGUI->setCreationMode(
true);
175 $this->
ctrl->forwardCommand($ilObjUserFolderGUI);
176 $this->tabs_gui->clearTargets();
177 $this->tabs_gui->setBackTarget(
178 $this->
lng->txt(
"back"),
179 $this->
ctrl->getLinkTargetByClass(
"illocalusergui",
'index')
184 case "ilinfoscreengui":
185 $this->tabs_gui->activateTab(
"info_short");
190 ) and !$this->
ilAccess->checkAccess(
"visible",
"", $this->ref_id)) {
191 $this->
ilias->raiseError($this->
lng->txt(
"msg_no_perm_read"), $this->
ilias->error_obj->MESSAGE);
199 $this->
object->getOrgUnitTypeId()
203 $this->
ctrl->forwardCommand($info);
205 case 'ilpermissiongui':
206 $this->tabs_gui->activateTab(
'perm_settings');
208 $this->
ctrl->forwardCommand($ilPermissionGUI);
210 case "ilcommonactiondispatchergui":
214 case 'illearningprogressgui':
215 case 'illplistofprogressgui':
216 $this->tabs_gui->clearTargets();
217 $this->tabs_gui->setBackTarget(
218 $this->
lng->txt(
'backto_staff'),
219 $this->
ctrl->getLinkTargetByClass(
220 ilOrgUnitUserAssignmentGUI::class,
225 $this->
object->getRefid(),
228 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
229 $this->
ctrl->redirectByClass(
"ilOrgUnitUserAssignmentGUI",
"index");
231 $this->
ctrl->saveParameterByClass(
"illearningprogressgui",
"obj_id");
232 $this->
ctrl->saveParameterByClass(
"illearningprogressgui",
"recursive");
236 (
int)
$_GET[
'obj_id']
238 $this->
ctrl->forwardCommand($new_gui);
240 case 'ilorgunitexportgui':
242 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
243 $this->
ctrl->redirect($this);
245 $this->tabs_gui->activateTab(self::TAB_EXPORT);
247 $ilOrgUnitExportGUI->addFormat(
'xml');
248 $this->
ctrl->forwardCommand($ilOrgUnitExportGUI);
250 case strtolower(ilObjectTranslationGUI::class):
251 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
254 $translations_gui->supportContentTranslation(
false);
255 $this->
ctrl->forwardCommand($translations_gui);
257 case strtolower(ilOrgUnitTypeGUI::class):
258 $this->tabs_gui->activateTab(self::TAB_ORGU_TYPES);
260 $this->
ctrl->forwardCommand($types_gui);
262 case strtolower(ilOrgUnitPositionGUI::class):
263 $this->tabs_gui->activateTab(self::TAB_POSITIONS);
265 $this->
ctrl->forwardCommand($types_gui);
267 case strtolower(ilOrgUnitUserAssignmentGUI::class):
268 $this->tabs_gui->activateTab(self::TAB_STAFF);
270 $this->
ctrl->forwardCommand($ilOrgUnitUserAssignmentGUI);
272 case strtolower(ilPropertyFormGUI::class):
285 $this->tabs_gui->activateTab(self::TAB_VIEW_CONTENT);
299 case 'performPasteIntoMultipleObjects':
302 case 'keepObjectsInClipboard':
306 parent::createObject();
309 parent::saveObject();
312 $this->tabs_gui->clearTargets();
313 $this->tabs_gui->setBackTarget($this->
lng->txt(
"back"), $this->
ctrl->getLinkTarget($this));
316 case 'confirmedDelete':
320 $this->tabs_gui->clearTargets();
321 $this->tabs_gui->setBackTarget($this->
lng->txt(
"back"), $this->
ctrl->getLinkTarget($this));
325 parent::clearObject();
327 case 'enableAdministrationPanel':
328 parent::enableAdministrationPanelObject();
330 case 'disableAdministrationPanel':
331 parent::disableAdministrationPanelObject();
333 case self::CMD_EDIT_SETTINGS:
334 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
338 case 'updateSettings':
339 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
343 case 'editAdvancedSettings':
344 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
348 case 'updateAdvancedSettings':
349 $this->tabs_gui->activateTab(self::TAB_SETTINGS);
353 case 'routeImportCmd':
356 case 'cancelMoveLink':
361 case 'editAvailabilityPeriod':
362 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"cont_operation_not_allowed"),
true);
372 $new_object->writePath();
373 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
374 $this->
ctrl->setParameter($this,
"ref_id", $new_object->
getRefId());
378 $this->
ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS,
"")
384 if (!$this->rbacsystem->checkAccess(
"read", $this->ref_id)) {
385 if ($this->rbacsystem->checkAccess(
"visible", $this->ref_id)) {
386 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"msg_no_perm_read"));
387 $this->
ctrl->redirectByClass(
'ilinfoscreengui',
'');
390 $this->
ilias->raiseError($this->
lng->txt(
"msg_no_perm_read"), $this->
ilias->error_obj->WARNING);
397 $this->
tabs->activateSubTab(
"manage");
399 $this->
tabs->activateSubTab(
"view_content");
402 $container_view->setOutput();
406 if (! $this->
ctrl->isAsynch()) {
411 $container_view->setOutput();
414 $this->tabs_gui->activateTab(self::TAB_VIEW_CONTENT);
415 $this->tabs_gui->removeSubTab(
"page_editor");
416 $this->tabs_gui->removeSubTab(
"ordering");
422 if ($subtypes === []) {
428 array_keys($subtypes),
429 $this->
lng->txt(
'other'),
438 $subtypes = $this->obj_definition->getCreatableSubObjects(
441 $this->
object->getRefId()
446 fn($key) => $this->
access->checkAccess(
'create_' . $key,
'', $this->ref_id, $this->type),
456 # all possible create permissions 457 parent::setTitleAndDescription();
458 if ($this->
object->getTitle() ===
"__OrgUnitAdministration") {
459 $this->tpl->setTitle($this->
lng->txt(
"objs_orgu"));
460 $this->tpl->setDescription($this->
lng->txt(
"objs_orgu"));
464 if ($this->
ilias->getSetting(
'custom_icons')) {
466 $icon_file = (isset($icons_cache[$this->
object->getId()])) ? $icons_cache[$this->
object->getId()] :
'';
468 $this->tpl->setTitleIcon($icon_file, $this->
lng->txt(
"obj_" . $this->object->getType()));
477 foreach ((array)
$path as $key => $row) {
478 if ($row[
"title"] ===
"__OrgUnitAdministration") {
479 $row[
"title"] = $this->
lng->txt(
"objs_orgu");
481 $this->
ctrl->setParameterByClass(
"ilobjorgunitgui",
"ref_id", $row[
"child"]);
482 $this->ilLocator->addItem(
484 $this->
ctrl->getLinkTargetByClass(
"ilobjorgunitgui",
"view"),
488 $this->
ctrl->setParameterByClass(
"ilobjorgunitgui",
"ref_id", $this->ref_id);
495 if ($obj_type !==
"orgu") {
496 parent::redirectToRefId($ref_id, $cmd);
498 $this->
ctrl->setParameterByClass(
"ilObjOrgUnitGUI",
"ref_id", $ref_id);
499 $this->
ctrl->redirectByClass(
"ilObjOrgUnitGUI", $cmd);
505 $read_access_ref_id = $this->rbacsystem->checkAccess(
'visible', $this->
object->getRefId())
506 && $this->rbacsystem->checkAccess(
'read', $this->object->getRefId());
507 if ($read_access_ref_id) {
508 $this->tabs_gui->addTab(
509 self::TAB_VIEW_CONTENT,
510 $this->
lng->txt(
"content"),
511 $this->
ctrl->getLinkTarget($this,
"")
513 $this->tabs_gui->addTab(
516 $this->
ctrl->getLinkTargetByClass([self::class, ilInfoScreenGUI::class],
"showSummary")
523 $this->tabs_gui->addTab(
525 $this->
lng->txt(self::TAB_STAFF),
526 $this->
ctrl->getLinkTargetByClass(
527 [self::class, ilOrgUnitUserAssignmentGUI::class],
533 $this->tabs_gui->addTab(
535 $this->
lng->txt(self::TAB_SETTINGS),
536 $this->
ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS)
540 $this->tabs_gui->addTab(
541 "administrate_users",
542 $this->
lng->txt(
"administrate_users"),
543 $this->
ctrl->getLinkTargetByClass(
544 [self::class, ilLocalUserGUI::class],
553 $this->tabs_gui->addTab(
554 self::TAB_GLOBAL_SETTINGS,
555 $this->
lng->txt(
'settings'),
556 $this->
ctrl->getLinkTargetByClass(
557 [self::class, ilOrgUnitGlobalSettingsGUI::class]
561 $this->tabs_gui->addTab(
563 $this->
lng->txt(self::TAB_EXPORT),
564 $this->
ctrl->getLinkTargetByClass(
565 [self::class, ilOrgUnitExportGUI::class]
571 $this->tabs_gui->addTab(
572 self::TAB_ORGU_TYPES,
573 $this->
lng->txt(self::TAB_ORGU_TYPES),
574 $this->
ctrl->getLinkTargetByClass(
575 [self::class, ilOrgUnitTypeGUI::class]
578 $this->tabs_gui->addTab(
580 $this->
lng->txt(self::TAB_POSITIONS),
581 $this->
ctrl->getLinkTargetByClass(
582 [self::class, ilOrgUnitPositionGUI::class]
592 $next_class = $this->
ctrl->getNextClass($this);
593 $cmd = $this->
ctrl->getCmd();
594 $this->tabs_gui->addSubTab(
596 $this->
lng->txt(self::TAB_SETTINGS),
597 $this->
ctrl->getLinkTarget($this, self::CMD_EDIT_SETTINGS)
599 $this->tabs_gui->addSubTab(
601 $this->
lng->txt(
"obj_multilinguality"),
602 $this->
ctrl->getLinkTargetByClass(
"ilobjecttranslationgui",
"listTranslations")
605 $ilOrgUnitType = $this->
object->getOrgUnitType();
607 if (count($ilOrgUnitType->getAssignedAdvancedMDRecords(
true))) {
608 $this->tabs_gui->addSubTab(
609 'edit_advanced_settings',
610 $this->
lng->txt(
'orgu_adv_settings'),
611 $this->
ctrl->getLinkTarget($this,
'editAdvancedSettings')
616 $this->tabs_gui->setSubTabActive($active_tab_id);
617 switch ($next_class) {
618 case 'iltranslationgui':
619 $this->tabs_gui->setSubTabActive(
"edit_translations");
623 case self::CMD_EDIT_SETTINGS:
624 $this->tabs_gui->setSubTabActive(
'edit_settings');
626 case 'editAdvancedSettings':
627 case 'updateAdvancedSettings':
628 $this->tabs_gui->setSubTabActive(
'edit_advanced_settings');
639 $ref_id = $this->
object->getRefId();
640 $may_create_orgus = $this->
ilAccess->checkAccess(
"create_orgu",
"",
$ref_id,
'orgu');
645 $this->tabs_gui->addSubTab(
647 $this->
lng->txt(
"import"),
648 $this->
ctrl->getLinkTargetByClass([self::class, ilOrgUnitSimpleImportGUI::class],
"chooseImport")
671 if ($this->
ilAccess->checkAccess(
"write",
"", $this->ref_id) ===
false) {
672 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
673 $this->
ctrl->redirect($this);
681 $this->
object->getOrgUnitTypeId()
693 if (!$this->
ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
694 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
695 $this->
ctrl->redirect($this);
703 $this->
object->getOrgUnitTypeId()
708 $gui->writeEditForm();
709 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
710 $this->
ctrl->redirect($this,
'editAdvancedSettings');
718 if (!$this->
ilAccess->checkAccess(
'write',
"", $this->ref_id)) {
719 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
720 $this->
ctrl->redirect($this);
728 if (!$this->
ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
729 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
730 $this->
ctrl->redirect($this);
733 if (
$form->saveObject()) {
734 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'msg_obj_modified'),
true);
735 $this->
ctrl->redirect($this, self::CMD_EDIT_SETTINGS);
743 parent::showAdministrationPanel();
745 if (empty($this->
toolbar->items) ===
false) {
746 foreach ($this->
toolbar->items as $key => $item) {
747 if ($item[
"cmd"] ==
"link" || $item[
"cmd"] ==
"copy" 748 || $item[
"cmd"] ==
"download" 750 unset($this->
toolbar->items[$key]);
759 $ilCtrl = $DIC[
'ilCtrl'];
760 $ilCtrl->setTargetScript(
'ilias.php');
761 $ilCtrl->setParameterByClass(
"ilObjOrgUnitGUI",
"ref_id", $ref_id);
762 $ilCtrl->setParameterByClass(
"ilObjOrgUnitGUI",
"admin_mode", self::TAB_SETTINGS);
763 $ilCtrl->setParameterByClass(
"IlObjPluginDispatchGUI",
"admin_mode", self::TAB_SETTINGS);
764 $ilCtrl->redirectByClass(array(
"ilAdministrationGUI",
"ilObjOrgUnitGUI"),
"view");
770 $explorer->setAjax(
false);
771 $explorer->setSelectMode(
'nodes[]',
false);
786 if ($this->clipboard->getCmd() !=
'cut') {
787 $message = __METHOD__ .
": cmd was not 'cut' ; may be a hack attempt!";
788 $this->
ilias->raiseError($message, $this->
ilias->error_obj->WARNING);
790 if ($this->clipboard->hasEntries()) {
794 $this->
ctrl->returnToParent($this);
811 $ids = filter_input(INPUT_POST,
'id', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY);
812 if (count($ids) > 0) {
814 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"info_deleted"),
true);
816 $this->
ctrl->returnToParent($this);
831 $arr_ref_ids =
$_POST[
'id'];
832 } elseif (isset(
$_GET[
'item_ref_id']) && (
int)
$_GET[
'item_ref_id'] > 0) {
833 $arr_ref_ids = [(
int)
$_GET[
'item_ref_id']];
836 if (!$ru->showDeleteConfirmation($arr_ref_ids,
false)) {
837 $ilCtrl->returnToParent($this);
static getIconsCache()
Returns an array that maps from OrgUnit object IDs to its icon defined by the assigned OrgUnit type...
confirmedDeleteObject()
confirmed deletion of org units -> org units are deleted immediately, without putting them to the tra...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _checkAccessSettings(int $ref_id)
Class ilOrgUnitUserAssignmentGUI.
Class ilOrgUnitPositionGUI.
setSubTabsSettings(string $active_tab_id)
static _checkAccessExport(int $ref_id)
static _checkAccessAdministrateUsers(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilOrgUnitSimpleImportGUI.
getCreatableObjectTypes()
initAdvancedSettingsForm()
Initialize the form for editing advanced meta data.
Global orgunit settings GUI.
Class ilOrgUnitExportGUI.
afterSave(ilObject $new_object)
isActiveAdministrationPanel()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
pasteObject()
paste object from clipboard to current place Depending on the chosen command the object(s) are linked...
const MODE_ADMINISTRATION
addStandardContainerSubTabs(bool $a_include_view=true)
Add standard container subtabs for view, manage, oderdering and text/media editor link...
addAdminLocatorItems(bool $do_not_add_object=false)
updateAdvancedSettings()
Update Advanced Metadata.
ilAccessHandler $ilAccess
setTitleAndDescription()
called by prepare output
Repository GUI Utilities.
deleteObject(bool $error=false)
Display deletion confirmation screen for Org Units.
Class ilObjForumAdministration.
cancelMoveLinkObject()
Cancel move|link empty clipboard and return to parent.
doUserAutoCompleteObject()
editAdvancedSettings()
Edit Advanced Metadata.
const LP_CONTEXT_ORG_UNIT
static removeObjectsFromSystem(array $a_ref_ids, bool $a_from_recovery_folder=false)
remove objects from trash bin and all entries therefore every object needs a specific deleteObject() ...
static _checkAccessStaff(int $ref_id)
static _goto(string $ref_id)
static redirect(string $a_script)
performPaste()
Prepare $_POST for the generic method performPasteIntoMultipleObjectsObject
static _checkAccessToUserLearningProgress(int $ref_id, int $usr_id)
Render add new item selector.
performPasteIntoMultipleObjectsObject()
Explorer class that works on tree objects (Services/Tree)
__construct(Container $dic, ilPlugin $plugin)
getReturnLocation(string $cmd, string $default_location="")
Get return location for command (command is method name without "Object", e.g.
setInfoObject(ilInfoScreenGUI $info)
get info sections
ILIAS Container InternalGUIService $gui
ILIAS DI LoggingServices $ilLog
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
showAdministrationPanel()
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder...
redirectToRefId(int $ref_id, string $cmd="")
const TAB_GLOBAL_SETTINGS
static _lookupType(int $id, bool $reference=false)
buildGroup(string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
keepObjectsInClipboardObject()
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
GUI class for object translation handling.
getTreeSelectorGUI(string $cmd)