3 require_once(
"./Services/Container/classes/class.ilContainerGUI.php");
4 require_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
5 require_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
6 require_once(
"./Services/AccessControl/classes/class.ilPermissionGUI.php");
7 require_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
8 require_once(
"./Services/User/classes/class.ilUserAccountSettings.php");
9 require_once(
"./Services/Tracking/classes/class.ilLearningProgressGUI.php");
10 require_once(
"./Services/User/classes/class.ilObjUserFolderGUI.php");
11 require_once(
"./Services/Tree/classes/class.ilTree.php");
12 require_once(
"./Modules/OrgUnit/classes/Staff/class.ilOrgUnitStaffGUI.php");
13 require_once(
"./Modules/OrgUnit/classes/LocalUser/class.ilLocalUserGUI.php");
14 require_once(
"./Modules/OrgUnit/classes/Translation/class.ilTranslationGUI.php");
15 require_once(
"./Modules/OrgUnit/classes/ExtId/class.ilExtIdGUI.php");
16 require_once(
"./Modules/OrgUnit/classes/SimpleImport/class.ilOrgUnitSimpleImportGUI.php");
17 require_once(
"./Modules/OrgUnit/classes/SimpleUserImport/class.ilOrgUnitSimpleUserImportGUI.php");
18 require_once(
"./Modules/OrgUnit/classes/class.ilOrgUnitImporter.php");
19 require_once(
"./Services/Object/classes/class.ilObjectAddNewItemGUI.php");
20 require_once(
"class.ilOrgUnitExplorerGUI.php");
21 require_once(
"class.ilOrgUnitExportGUI.php");
22 require_once(
"class.ilObjOrgUnitAccess.php");
23 require_once(
"class.ilObjOrgUnitTree.php");
24 require_once(dirname(__FILE__) .
'/Types/class.ilOrgUnitTypeGUI.php');
25 require_once(dirname(__FILE__) .
'/Settings/class.ilObjOrgUnitSettingsFormGUI.php');
26 require_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDRecordGUI.php');
27 require_once(
'./Services/Container/classes/class.ilContainerByTypeContentGUI.php');
99 $this->toolbar = $ilToolbar;
103 $lng->loadLanguageModule(
"orgu");
104 $this->tpl->addCss(
'./Modules/OrgUnit/templates/default/orgu.css');
109 $cmd = $this->ctrl->getCmd();
110 $next_class = $this->ctrl->getNextClass($this);
118 switch ($next_class) {
119 case "illocalusergui":
122 $this->ctrl->redirect($this);
124 $this->tabs_gui->setTabActive(
'administrate_users');
126 $this->ctrl->forwardCommand($ilLocalUserGUI);
128 case "ilorgunitsimpleimportgui":
129 $this->tabs_gui->setTabActive(
"view_content");
131 $this->ctrl->forwardCommand($ilOrgUnitSimpleImportGUI);
132 $this->tabs_gui->clearTargets();
133 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this));
135 case "ilorgunitsimpleuserimportgui":
136 $this->tabs_gui->setTabActive(
"view_content");
138 $this->ctrl->forwardCommand($ilOrgUnitSimpleUserImportGUI);
139 $this->tabs_gui->clearTargets();
140 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this));
142 case "ilorgunitstaffgui":
143 case "ilrepositorysearchgui":
144 $this->tabs_gui->setTabActive(
'orgu_staff');
146 $this->ctrl->forwardCommand($ilOrgUnitStaffGUI);
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'));
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'));
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'));
172 $this->ctrl->redirectByClass(
"illocalusergui",
"index");
176 case "ilobjuserfoldergui":
179 $this->ctrl->redirectByClass(
"illocalusergui",
"index");
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'));
191 case "ilinfoscreengui":
192 $this->tabs_gui->setTabActive(
"info_short");
193 if (!$this->ilAccess->checkAccess(
"read",
"", $this->ref_id) AND !$this->ilAccess->checkAccess(
"visible",
"", $this->ref_id)) {
194 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
198 $this->ctrl->forwardCommand($info);
209 case 'ilpermissiongui':
210 $this->tabs_gui->setTabActive(
'perm_settings');
212 $this->ctrl->forwardCommand($ilPermissionGUI);
214 case "ilcommonactiondispatchergui":
215 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
217 $this->ctrl->forwardCommand($gui);
219 case 'illearningprogressgui':
220 case 'illplistofprogressgui':
221 $this->tabs_gui->clearTargets();
222 $this->tabs_gui->setBackTarget($this->lng->txt(
'backto_staff'), $this->ctrl->getLinkTargetByClass(
"ilOrgUnitStaffGUI",
'showStaff'));
225 $this->ctrl->redirectByClass(
"ilOrgUnitStaffGUI",
"showStaff");
227 $this->ctrl->saveParameterByClass(
"illearningprogressgui",
"obj_id");
228 $this->ctrl->saveParameterByClass(
"illearningprogressgui",
"recursive");
229 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
231 $this->ctrl->forwardCommand($new_gui);
233 case 'ilorgunitexportgui':
234 $this->tabs_gui->setTabActive(
'export');;
236 $ilOrgUnitExportGUI->addFormat(
'xml');
237 $this->ctrl->forwardCommand($ilOrgUnitExportGUI);
239 case 'iltranslationgui':
240 $this->tabs_gui->setTabActive(
"settings");
244 $this->ctrl->forwardCommand($ilTranslationGui);
246 case 'ilorgunittypegui':
247 $this->tabs_gui->setTabActive(
'orgu_types');
249 $this->ctrl->forwardCommand($types_gui);
266 case 'performPasteIntoMultipleObjects':
276 $this->tabs_gui->clearTargets();
277 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this));
280 case 'confirmedDelete':
284 $this->tabs_gui->clearTargets();
285 $this->tabs_gui->setBackTarget($this->lng->txt(
"back"), $this->ctrl->getLinkTarget($this));
291 case 'enableAdministrationPanel':
294 case 'disableAdministrationPanel':
297 case 'getAsynchItemList':
301 $this->tabs_gui->setTabActive(
"settings");
305 case 'updateSettings':
306 $this->tabs_gui->setTabActive(
"settings");
310 case 'editAdvancedSettings':
311 $this->tabs_gui->setTabActive(
"settings");
315 case 'updateAdvancedSettings':
316 $this->tabs_gui->setTabActive(
"settings");
327 if (!$this->ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) {
328 if ($this->ilAccess->checkAccess(
"visible",
"",
$_GET[
"ref_id"])) {
330 $this->ctrl->redirectByClass(
'ilinfoscreengui',
'');
333 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"), $this->ilias->error_obj->WARNING);
337 $this->tabs_gui->setTabActive(
"view_content");
338 $this->tabs_gui->removeSubTab(
"page_editor");
339 $this->tabs_gui->removeSubTab(
"ordering");
341 $this->toolbar->addButton($this->lng->txt(
"simple_import"), $this->ctrl->getLinkTargetByClass(
"ilOrgUnitSimpleImportGUI",
"importScreen"));
342 $this->toolbar->addButton($this->lng->txt(
"simple_user_import"), $this->ctrl->getLinkTargetByClass(
"ilOrgUnitSimpleUserImportGUI",
"userImportScreen"));
370 $gui->setCreationUrl(
"ilias.php?ref_id=" .
$_GET[
"ref_id"] .
"&admin_mode=settings&cmd=create&baseClass=ilAdministrationGUI");
377 $tree->setTypeWhiteList(array(
"orgu" ));
378 if (!
$tree->handleCommand()) {
379 $this->tpl->setLeftNavContent(
$tree->getHTML());
381 $this->ctrl->setParameterByClass(
"ilObjOrgUnitGUI",
"ref_id",
$_GET[
"ref_id"]);
389 # all possible create permissions
392 if ($this->object->getTitle() ==
"__OrgUnitAdministration") {
393 $this->tpl->setTitle($this->lng->txt(
"objs_orgu"));
394 $this->tpl->setDescription($this->lng->txt(
"objs_orgu"));
398 if ($this->ilias->getSetting(
'custom_icons')) {
399 $icons_cache = ilObjOrgUnit::getIconsCache();
400 $icon_file = (isset($icons_cache[$this->object->getId()])) ? $icons_cache[$this->
object->getId()] :
'';
402 $this->tpl->setTitleIcon($icon_file, $this->lng->txt(
"obj_" . $this->object->getType()));
412 if (
$row[
"title"] ==
"__OrgUnitAdministration") {
413 $row[
"title"] = $this->lng->txt(
"objs_orgu");
415 $this->ctrl->setParameterByClass(
"ilobjorgunitgui",
"ref_id",
$row[
"child"]);
417 $this->ctrl->setParameterByClass(
"ilobjorgunitgui",
"ref_id",
$_GET[
"ref_id"]);
428 if ($obj_type !=
"orgu") {
431 $this->ctrl->setParameterByClass(
"ilObjOrgUnitGUI",
"ref_id", $a_ref_id);
432 $this->ctrl->redirectByClass(
"ilObjOrgUnitGUI", $a_cmd);
441 if ($this->ilAccess->checkAccess(
'read',
'', $this->object->getRefId())) {
442 $this->tabs_gui->addTab(
"view_content", $this->lng->txt(
"content"), $this->ctrl->getLinkTarget($this,
""));
443 $this->tabs_gui->addTab(
"info_short",
"Info", $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
449 $this->tabs_gui->addTab(
"orgu_staff", $this->lng->txt(
"orgu_staff"), $this->ctrl->getLinkTargetByClass(
"ilOrgUnitStaffGUI",
"showStaff"));
451 if ($this->ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
452 $this->tabs_gui->addTab(
"settings", $this->lng->txt(
"settings"), $this->ctrl->getLinkTarget($this,
'editSettings'));
455 $this->tabs_gui->addTab(
"administrate_users", $this->lng->txt(
"administrate_users"), $this->ctrl->getLinkTargetByClass(
"ilLocalUserGUI",
"index"));
459 if ($this->ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
460 $this->tabs_gui->addTarget(
'export', $this->ctrl->getLinkTargetByClass(
'ilorgunitexportgui',
''),
'export',
'ilorgunitexportgui');
464 $this->tabs_gui->addTab(
'orgu_types', $this->lng->txt(
'orgu_types'), $this->ctrl->getLinkTargetByClass(
'ilOrgUnitTypeGUI'));
475 $next_class = $this->ctrl->getNextClass($this);
476 $cmd = $this->ctrl->getCmd();
477 $this->tabs_gui->addSubTab(
'edit_settings', $this->lng->txt(
'settings'), $this->ctrl->getLinkTarget($this,
'editSettings'));
478 $this->tabs_gui->addSubTab(
"edit_translations", $this->lng->txt(
"obj_multilinguality"), $this->ctrl->getLinkTargetByClass(
"iltranslationgui",
"editTranslations"));
480 $ilOrgUnitType = $this->
object->getOrgUnitType();
482 if (count($ilOrgUnitType->getAssignedAdvancedMDRecords(
true))) {
483 $this->tabs_gui->addSubTab(
'edit_advanced_settings', $this->lng->txt(
'orgu_adv_settings'), $this->ctrl->getLinkTarget($this,
'editAdvancedSettings'));
487 $this->tabs_gui->setSubTabActive($active_tab_id);
488 switch ($next_class) {
489 case 'iltranslationgui':
490 $this->tabs_gui->setSubTabActive(
"edit_translations");
495 $this->tabs_gui->setSubTabActive(
'edit_settings');
497 case 'editAdvancedSettings':
498 case 'updateAdvancedSettings':
499 $this->tabs_gui->setSubTabActive(
'edit_advanced_settings');
516 $form->setFormAction($this->ctrl->getFormAction($this));
517 $form->addCommandButton(
'updateAdvancedSettings', $this->lng->txt(
'save'));
518 $form->addCommandButton(
'editSettings', $this->lng->txt(
'cancel'));
528 if (!$this->ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
530 $this->ctrl->redirect($this);
535 $gui->setSelectedOnly(
true);
537 $this->tpl->setContent($form->getHTML());
545 if (!$this->ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
547 $this->ctrl->redirect($this);
552 $gui->setSelectedOnly(
true);
555 if ($gui->importEditFormPostValues()) {
556 $gui->writeEditForm();
558 $this->ctrl->redirect($this,
'editAdvancedSettings');
560 $this->tpl->setContent($form->getHTML());
571 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
572 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
573 include_once(
'Services/ADT/classes/class.ilADTFactory.php');
575 $type = $this->
object->getOrgUnitType();
579 $assigned_record_ids = $type->getAssignedAdvancedMDRecordIds();
583 if (!in_array($record_id, $assigned_record_ids)) {
588 $a_values =
new ilAdvancedMDValues($record_id, $this->object->getId(),
'orgu_type', $this->
object->getOrgUnitTypeId());
595 $defs = $a_values->getDefinitions();
596 foreach ($a_values->getADTGroup()->getElements() as $element_id => $element) {
597 if (!$element->isNull()) {
607 if (!$this->ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
609 $this->ctrl->redirect($this);
612 $this->tpl->setContent($form->getHTML());
617 if (!$this->ilAccess->checkAccess(
"write",
"", $this->ref_id)) {
619 $this->ctrl->redirect($this);
622 if ($form->saveObject()) {
624 $this->ctrl->redirect($this,
'editSettings');
626 $this->tpl->setContent($form->getHTML());
639 foreach (
$toolbar->items as $key => $item) {
640 if ($item[
"cmd"] ==
"link" || $item[
"cmd"] ==
"copy") {
650 $ilCtrl->initBaseClass(
"ilAdministrationGUI");
651 $ilCtrl->setTargetScript(
"ilias.php");
652 $ilCtrl->setParameterByClass(
"ilObjOrgUnitGUI",
"ref_id",
$ref_id);
653 $ilCtrl->setParameterByClass(
"ilObjOrgUnitGUI",
"admin_mode",
"settings");
654 $ilCtrl->redirectByClass(array(
"ilAdministrationGUI",
"ilObjOrgUnitGUI" ),
"view");
661 $explorer->setAjax(
false);
662 $explorer->setSelectMode(
'nodes[]',
false);
681 if (!in_array(
$_SESSION[
'clipboard'][
'cmd'], array(
'cut' ))) {
682 $message = __METHOD__ .
": cmd was not 'cut' ; may be a hack attempt!";
683 $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING);
685 if (
$_SESSION[
'clipboard'][
'cmd'] ==
'cut') {
686 if (isset(
$_GET[
'ref_id']) && (
int)
$_GET[
'ref_id']) {
687 $_POST[
'nodes'] = array( $_GET[
'ref_id'] );
691 $this->ctrl->returnToParent($this);