5 require_once(
'./Services/Object/classes/class.ilObject2GUI.php');
6 require_once(
'./Services/Export/classes/class.ilExportGUI.php');
7 require_once(
'./Services/YUI/classes/class.ilYuiUtil.php');
8 require_once(
'./Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php');
41 public function __construct($a_id = 0, $a_id_type = self::REPOSITORY_NODE_ID, $a_parent_node_id = 0) {
46 $lng->loadLanguageModule(
"dcl");
50 } elseif ($a_id > 0) {
51 $this->table_id = $this->
object->getMainTableId();
56 if (!$ilCtrl->isAsynch()) {
59 $tpl->addJavaScript(
'Modules/DataCollection/js/ilDataCollection.js');
60 $tpl->addJavaScript(
"Modules/DataCollection/js/datacollection.js");
61 $this->tpl->addOnLoadCode(
"ilDataCollection.setEditUrl('" . $ilCtrl->getLinkTargetByClass(array(
63 'ilobjdatacollectiongui',
64 'ildatacollectionrecordeditgui'
65 ),
'edit',
'',
true) .
"');");
66 $this->tpl->addOnLoadCode(
"ilDataCollection.setCreateUrl('" . $ilCtrl->getLinkTargetByClass(array(
68 'ilobjdatacollectiongui',
69 'ildatacollectionrecordeditgui'
70 ),
'create',
'',
true) .
"');");
71 $this->tpl->addOnLoadCode(
"ilDataCollection.setSaveUrl('" . $ilCtrl->getLinkTargetByClass(array(
73 'ilobjdatacollectiongui',
74 'ildatacollectionrecordeditgui'
75 ),
'save',
'',
true) .
"');");
76 $this->tpl->addOnLoadCode(
"ilDataCollection.setDataUrl('" . $ilCtrl->getLinkTargetByClass(array(
78 'ilobjdatacollectiongui',
79 'ildatacollectionrecordeditgui'
80 ),
'getRecordData',
'',
true) .
"');");
82 $ilCtrl->saveParameter($this,
"table_id");
112 $link = $ilCtrl->getLinkTarget($this,
"render");
114 if ($this->
object != NULL) {
115 $ilNavigationHistory->addItem($this->object->getRefId(), $link,
"dcl");
119 if (
$_GET[self::GET_DCL_GTR]) {
120 $ilCtrl->setParameterByClass(
'ildatacollectionrecordviewgui',
'record_id',
$_GET[self::GET_DCL_GTR]);
121 $ilCtrl->redirectByClass(
'ildatacollectionrecordviewgui',
'renderRecord');
124 $next_class = $ilCtrl->getNextClass($this);
127 $tpl->getStandardTemplate();
128 $tpl->setContent(
"Permission Denied.");
133 switch ($next_class) {
134 case "ilinfoscreengui":
136 $ilTabs->activateTab(
"id_info");
140 case "ilcommonactiondispatchergui":
141 require_once(
'./Services/Object/classes/class.ilCommonActionDispatcherGUI.php');
143 $gui->enableCommentsSettings(
false);
144 $this->ctrl->forwardCommand($gui);
147 case "ilpermissiongui":
149 $ilTabs->activateTab(
"id_permissions");
150 require_once(
'./Services/AccessControl/classes/class.ilPermissionGUI.php');
152 $this->ctrl->forwardCommand($perm_gui);
155 case "ilobjectcopygui":
156 require_once(
'./Services/Object/classes/class.ilObjectCopyGUI.php');
159 $tpl->getStandardTemplate();
160 $this->ctrl->forwardCommand($cp);
163 case "ildatacollectionfieldlistgui":
166 $ilTabs->setTabActive(
"id_fields");
167 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionFieldListGUI.php');
169 $this->ctrl->forwardCommand($fieldlist_gui);
172 case "ildatacollectiontableeditgui":
174 $ilTabs->setTabActive(
"id_fields");
175 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionTableEditGUI.php');
177 $this->ctrl->forwardCommand($tableedit_gui);
180 case "ildatacollectionfieldeditgui":
182 $ilTabs->activateTab(
"id_fields");
183 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionFieldEditGUI.php');
185 $this->ctrl->forwardCommand($fieldedit_gui);
188 case "ildatacollectionrecordlistgui":
191 $ilTabs->activateTab(
"id_records");
192 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionRecordListGUI.php');
194 $this->ctrl->forwardCommand($recordlist_gui);
197 case "ildatacollectionrecordeditgui":
199 $ilTabs->activateTab(
"id_records");
200 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionRecordEditGUI.php');
202 $this->ctrl->forwardCommand($recordedit_gui);
205 case "ildatacollectionrecordviewviewdefinitiongui":
209 $ilTabs->clearTargets();
210 $ilTabs->setBackTarget($this->lng->txt(
"back"), $ilCtrl->getLinkTargetByClass(
"ildatacollectionfieldlistgui",
"listFields"));
212 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionRecordViewViewdefinitionGUI.php');
219 $recordedit_gui->setEnableEditing(
false);
222 $ret = $this->ctrl->forwardCommand($recordedit_gui);
224 $this->tpl->setContent(
$ret);
227 $ilTabs->removeTab(
'history');
228 $ilTabs->removeTab(
'clipboard');
229 $ilTabs->removeTab(
'pg');
232 case "ildatacollectionrecordlistviewdefinitiongui":
235 $ilTabs->setTabActive(
"id_fields");
236 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionRecordListViewdefinitionGUI.php');
238 $this->ctrl->forwardCommand($recordlist_gui);
243 $ilTabs->setTabActive(
"id_records");
244 require_once(
'./Modules/File/classes/class.ilObjFile.php');
246 $this->ctrl->forwardCommand($file_gui);
249 case "ildatacollectionrecordviewgui":
251 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionRecordViewGUI.php');
253 $this->ctrl->forwardCommand($recordview_gui);
254 $ilTabs->clearTargets();
255 $ilTabs->setBackTarget($this->lng->txt(
"back"), $ilCtrl->getLinkTargetByClass(
"ilObjDataCollectionGUI",
""));
260 $rgui->setObject(
$_GET[
'record_id'],
"dcl_record",
$_GET[
"field_id"],
"dcl_field");
261 $rgui->executeCommand();
262 $ilCtrl->redirectByClass(
"ilDataCollectionRecordListGUI",
"listRecords");
267 require_once(
'./Modules/DataCollection/classes/class.ilDataCollectionRecordViewGUI.php');
270 $this->ctrl->forwardCommand($recordviewGui);
271 $ilTabs->clearTargets();
272 $ilTabs->setBackTarget($this->lng->txt(
"back"), $ilCtrl->getLinkTargetByClass(
"ilObjDataCollectionGUI",
""));
276 $ilTabs->setTabActive(
"export");
279 $exp_gui->addFormat(
"xml");
280 $this->ctrl->forwardCommand($exp_gui);
296 $this->ctrl->setCmd(
"showSummary");
297 $this->ctrl->setCmdClass(
"ilinfoscreengui");
308 $ilCtrl->redirectByClass(
"ildatacollectionrecordlistgui",
"listRecords");
318 $ilTabs->activateTab(
"id_info");
321 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_read"));
324 require_once(
'./Services/InfoScreen/classes/class.ilInfoScreenGUI.php');
326 $info->enablePrivateNotes();
327 $info->addMetaDataSections($this->object->getId(), 0, $this->
object->getType());
329 $this->ctrl->forwardCommand($info);
336 if (is_object($this->
object)) {
337 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$this->node_id);
345 public static function _goto($a_target) {
346 $id = explode(
"_", $a_target);
348 $_GET[
"baseClass"] =
"ilRepositoryGUI";
351 $_GET[
"cmd"] =
"listRecords";
352 require_once(
'./ilias.php');
374 $this->ctrl->redirectByClass(
"ilDataCollectionFieldListGUI",
"listFields");
385 global $ilAccess, $ilTabs,
$lng, $ilHelp;
387 $ilHelp->setScreenIdComponent(
"dcl");
390 if ($ilAccess->checkAccess(
'read',
"", $this->object->getRefId())) {
391 $ilTabs->addTab(
"id_records", $lng->txt(
"content"), $this->ctrl->getLinkTargetByClass(
"ildatacollectionrecordlistgui",
"listRecords"));
395 if ($ilAccess->checkAccess(
'visible',
"", $this->object->getRefId())) {
396 $ilTabs->addTab(
"id_info", $lng->txt(
"info_short"), $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"));
400 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
401 $ilTabs->addTab(
"id_settings", $lng->txt(
"settings"), $this->ctrl->getLinkTarget($this,
"editObject"));
405 if ($ilAccess->checkAccess(
'write',
"", $this->object->getRefId())) {
406 $ilTabs->addTab(
"id_fields", $lng->txt(
"dcl_list_fields"), $this->ctrl->getLinkTargetByClass(
"ildatacollectionfieldlistgui",
"listFields"));
410 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())) {
411 $ilTabs->addTab(
"export", $lng->txt(
"export"), $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
415 if ($ilAccess->checkAccess(
'edit_permission',
"", $this->object->getRefId())) {
416 $ilTabs->addTab(
"id_permissions", $lng->txt(
"perm_settings"), $this->ctrl->getLinkTargetByClass(
"ilpermissiongui",
"perm"));
427 $ilTabs->addSubTab(
"list_fields", $lng->txt(
"dcl_list_fields"), $ilCtrl->getLinkTargetByClass(
"ildatacollectionfieldlistgui",
"listFields"));
429 $ilCtrl->setParameterByClass(
"ildatacollectionrecordviewviewdefinitiongui",
"table_id", $this->table_id);
430 $ilTabs->addSubTab(
"view_viewdefinition", $lng->txt(
"dcl_record_view_viewdefinition"), $ilCtrl->getLinkTargetByClass(
"ildatacollectionrecordviewviewdefinitiongui",
"edit"));
432 $ilTabs->activateSubTab($a_active);
442 $ilTabs->activateTab(
"id_settings");
446 $cb->
setInfo($this->lng->txt(
"dcl_online_info"));
450 $cb =
new ilCheckboxInputGUI($this->lng->txt(
"dcl_activate_notification"),
"notification");
451 $cb->
setInfo($this->lng->txt(
"dcl_notification_info"));
462 $ilCtrl->redirectByClass(
"ildatacollectionrecordlistgui",
"listRecords");
482 $a_values[
"is_online"] = $this->
object->getOnline();
483 $a_values[
"rating"] = $this->
object->getRating();
484 $a_values[
"public_notes"] = $this->
object->getPublicNotes();
485 $a_values[
"approval"] = $this->
object->getApproval();
486 $a_values[
"notification"] = $this->
object->getNotification();
498 $this->
object->setOnline($a_form->
getInput(
"is_online"));
499 $this->
object->setRating($a_form->
getInput(
"rating"));
500 $this->
object->setPublicNotes($a_form->
getInput(
"public_notes"));
501 $this->
object->setApproval($a_form->
getInput(
"approval"));
502 $this->
object->setNotification($a_form->
getInput(
"notification"));
510 $tables = $this->
object->getTables();
511 if (count($tables) == 1 AND count($this->table->getRecordFields()) == 0 AND count($this->table->getRecords()) == 0
512 AND $this->object->getOnline()
523 require_once(
'./Services/Notification/classes/class.ilNotification.php');
524 switch (
$_GET[
"ntf"]) {
532 $ilCtrl->redirectByClass(
"ildatacollectionrecordlistgui",
"listRecords");
544 require_once(
'./Services/Object/classes/class.ilCommonActionDispatcherGUI.php');
547 require_once(
'./Services/Object/classes/class.ilObjectListGUI.php');
548 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true), $ilCtrl->getLinkTargetByClass(array(
549 "ilcommonactiondispatchergui",
551 ),
"",
"",
true,
false), $ilCtrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui" ),
"",
"",
true,
false));
553 $lg = $dispatcher->initHeaderAction();
558 if ($ilUser->getId() != ANONYMOUS_USER_ID AND $this->
object->getNotification() == 1) {
559 require_once(
'./Services/Notification/classes/class.ilNotification.php');
562 $ilCtrl->setParameter($this,
"ntf", 1);
563 $lg->addCustomCommand($ilCtrl->getLinkTarget($this,
"toggleNotification"),
"dcl_notification_deactivate_dcl");
565 $lg->addHeaderIcon(
"not_icon",
ilUtil::getImagePath(
"notification_on.svg"), $lng->txt(
"dcl_notification_activated"));
568 $ilCtrl->setParameter($this,
"ntf", 2);
569 $lg->addCustomCommand($ilCtrl->getLinkTarget($this,
"toggleNotification"),
"dcl_notification_activate_dcl");
571 $lg->addHeaderIcon(
"not_icon",
ilUtil::getImagePath(
"notification_off.svg"), $lng->txt(
"dcl_notification_deactivated"));
573 $ilCtrl->setParameter($this,
"ntf",
"");
577 $tpl->setHeaderActionMenu($lg->getHeaderAction());
579 return $lg->getHeaderAction();
582 $tpl->setHeaderActionMenu($lg->getHeaderAction());