5 require_once
"./Services/Object/classes/class.ilObject2GUI.php";
34 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0)
40 $lng->loadLanguageModule(
"dcl");
48 $this->table_id = $this->
object->getMainTableId();
51 $ilCtrl->saveParameter($this,
"table_id");
78 $link = $ilCtrl->getLinkTarget($this,
"render");
80 if($this->
object != NULL)
82 $ilNavigationHistory->addItem($this->object->getRefId(), $link,
"dcl");
88 $ilCtrl->setCmdClass(
"ildatacollectionrecordviewgui");
90 $ilCtrl->setCmd(
"renderRecord");
94 $next_class = $ilCtrl->getNextClass($this);
95 $cmd = $ilCtrl->getCmd();
99 $tpl->getStandardTemplate();
100 $tpl->setContent(
"Permission Denied.");
107 case "ilinfoscreengui":
109 $ilTabs->activateTab(
"id_info");
113 case "ilcommonactiondispatchergui":
114 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
116 $this->ctrl->forwardCommand($gui);
119 case "ilpermissiongui":
121 $ilTabs->activateTab(
"id_permissions");
122 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
124 $this->ctrl->forwardCommand($perm_gui);
127 case "ilobjectcopygui":
128 include_once
"./Services/Object/classes/class.ilObjectCopyGUI.php";
131 $tpl->getStandardTemplate();
132 $this->ctrl->forwardCommand($cp);
135 case "ildatacollectionfieldlistgui":
138 $ilTabs->setTabActive(
"id_fields");
139 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionFieldListGUI.php");
141 $this->ctrl->forwardCommand($fieldlist_gui);
144 case "ildatacollectiontableeditgui":
146 $ilTabs->setTabActive(
"id_fields");
147 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionTableEditGUI.php");
149 $this->ctrl->forwardCommand($tableedit_gui);
152 case "ildatacollectionfieldeditgui":
154 $ilTabs->activateTab(
"id_fields");
155 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionFieldEditGUI.php");
157 $this->ctrl->forwardCommand($fieldedit_gui);
160 case "ildatacollectionrecordlistgui":
163 $ilTabs->activateTab(
"id_records");
164 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionRecordListGUI.php");
166 $this->ctrl->forwardCommand($recordlist_gui);
169 case "ildatacollectionrecordeditgui":
171 $ilTabs->activateTab(
"id_records");
172 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionRecordEditGUI.php");
174 $this->ctrl->forwardCommand($recordedit_gui);
177 case "ildatacollectionrecordviewviewdefinitiongui":
181 $ilTabs->clearTargets();
182 $ilTabs->setBackTarget($this->lng->txt(
"back"),
183 $ilCtrl->getLinkTargetByClass(
"ildatacollectionfieldlistgui",
"listFields"));
185 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php");
193 $recordedit_gui->setEnableEditing(
false);
196 $ret = $this->ctrl->forwardCommand($recordedit_gui);
199 $this->tpl->setContent(
$ret);
202 $ilTabs->removeTab(
'history');
203 $ilTabs->removeTab(
'clipboard');
204 $ilTabs->removeTab(
'pg');
207 case "ildatacollectionrecordlistviewdefinitiongui":
210 $ilTabs->setTabActive(
"id_fields");
211 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionRecordListViewdefinitionGUI.php");
213 $this->ctrl->forwardCommand($recordlist_gui);
218 $ilTabs->setTabActive(
"id_records");
219 include_once(
"./Modules/File/classes/class.ilObjFile.php");
221 $this->ctrl->forwardCommand($file_gui);
224 case "ildatacollectionrecordviewgui":
226 include_once(
"./Modules/DataCollection/classes/class.ilDataCollectionRecordViewGUI.php");
228 $this->ctrl->forwardCommand($recordview_gui);
229 $ilTabs->clearTargets();
230 $ilTabs->setBackTarget($this->lng->txt(
"back"), $ilCtrl->getLinkTargetByClass(
"ilObjDataCollectionGUI",
""));
235 $rgui->setObject(
$_GET[
'record_id'],
"dcl_record",
$_GET[
"field_id"],
"dcl_field");
236 $rgui->executeCommand();
237 $ilCtrl->redirectByClass(
"ilDataCollectionRecordListGUI",
"listRecords");
254 $this->ctrl->setCmd(
"showSummary");
255 $this->ctrl->setCmdClass(
"ilinfoscreengui");
266 $ilCtrl->redirectByClass(
"ildatacollectionrecordlistgui",
"listRecords");
276 $ilTabs->activateTab(
"id_info");
280 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
283 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
285 $info->enablePrivateNotes();
286 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
288 $this->ctrl->forwardCommand($info);
298 if (is_object($this->
object))
300 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$this->node_id);
312 $id = explode(
"_", $a_target);
314 $_GET[
"baseClass"] =
"ilRepositoryGUI";
315 $_GET[
"ref_id"] = $id[0];
316 $_GET[
"dcl_gtr"] = $id[1];
317 $_GET[
"cmd"] =
"listRecords";
318 include(
"ilias.php");
330 unset($forms[self::CFORM_IMPORT]);
341 $this->ctrl->redirectByClass(
"ilDataCollectionFieldListGUI",
"listFields");
352 global $ilAccess, $ilTabs,
$lng, $ilHelp;
354 $ilHelp->setScreenIdComponent(
"dcl");
357 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId()))
359 $ilTabs->addTab(
"id_records",
360 $lng->txt(
"content"),
361 $this->ctrl->getLinkTargetByClass(
"ildatacollectionrecordlistgui",
"listRecords"));
365 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId()))
367 $ilTabs->addTab(
"id_info",
368 $lng->txt(
"info_short"),
369 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
373 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId()))
375 $ilTabs->addTab(
"id_settings",
376 $lng->txt(
"settings"),
377 $this->ctrl->getLinkTarget($this,
"editObject"));
381 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId()))
383 $ilTabs->addTab(
"id_fields",
384 $lng->txt(
"dcl_list_fields"),
385 $this->ctrl->getLinkTargetByClass(
"ildatacollectionfieldlistgui",
"listFields"));
389 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
397 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId()))
399 $ilTabs->addTab(
"id_permissions",
400 $lng->txt(
"perm_settings"),
401 $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm"));
416 $ilTabs->addSubTab(
"list_fields",
417 $lng->txt(
"dcl_list_fields"),
418 $ilCtrl->getLinkTargetByClass(
"ildatacollectionfieldlistgui",
"listFields"));
420 $ilCtrl->setParameterByClass(
"ildatacollectionrecordviewviewdefinitiongui",
"table_id", $this->table_id);
421 $ilTabs->addSubTab(
"view_viewdefinition",
422 $lng->txt(
"dcl_record_view_viewdefinition"),
423 $ilCtrl->getLinkTargetByClass(
"ildatacollectionrecordviewviewdefinitiongui",
"edit"));
425 $ilTabs->activateSubTab($a_active);
436 $ilTabs->activateTab(
"id_settings");
457 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"dcl_activate_notification"),
"notification");
469 $ilCtrl->redirectByClass(
"ildatacollectionrecordlistgui",
"listRecords");
487 $a_values[
"is_online"] = $this->
object->getOnline();
488 $a_values[
"rating"] = $this->
object->getRating();
489 $a_values[
"public_notes"] = $this->
object->getPublicNotes();
490 $a_values[
"approval"] = $this->
object->getApproval();
491 $a_values[
"notification"] = $this->
object->getNotification();
503 $this->
object->setOnline($a_form->
getInput(
"is_online"));
504 $this->
object->setRating($a_form->
getInput(
"rating"));
505 $this->
object->setPublicNotes($a_form->
getInput(
"public_notes"));
506 $this->
object->setApproval($a_form->
getInput(
"approval"));
507 $this->
object->setNotification($a_form->
getInput(
"notification"));
515 $tables = $this->
object->getTables();
516 if(count($tables) == 1 && count($this->table->getRecordFields()) == 0 && count($this->table->getRecords()) == 0 && $this->object->getOnline()){
527 include_once
"./Services/Notification/classes/class.ilNotification.php";
537 $ilCtrl->redirectByClass(
"ildatacollectionrecordlistgui",
"listRecords");
547 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
549 $ilAccess,
"dcl", $this->ref_id,$this->obj_id);
551 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
552 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
553 $ilCtrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
554 $ilCtrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
556 $lg = $dispatcher->initHeaderAction();
561 if ($ilUser->getId() != ANONYMOUS_USER_ID && $this->
object->getNotification() == 1)
563 include_once
"./Services/Notification/classes/class.ilNotification.php";
567 $ilCtrl->setParameter($this,
"ntf", 1);
568 $lg->addCustomCommand($ilCtrl->getLinkTarget($this,
"toggleNotification"),
"dcl_notification_deactivate_dcl");
570 $lg->addHeaderIcon(
"not_icon",
572 $lng->txt(
"dcl_notification_activated"));
577 $ilCtrl->setParameter($this,
"ntf", 2);
578 $lg->addCustomCommand($ilCtrl->getLinkTarget($this,
"toggleNotification"),
"dcl_notification_activate_dcl");
580 $lg->addHeaderIcon(
"not_icon",
582 $lng->txt(
"dcl_notification_deactivated"));
584 $ilCtrl->setParameter($this,
"ntf",
"");
589 $tpl->setHeaderActionMenu($lg->getHeaderAction());
593 return $lg->getHeaderAction();
596 $tpl->setHeaderActionMenu($lg->getHeaderAction());