55 public function __construct(
int $a_id = 0,
int $a_id_type = self::REPOSITORY_NODE_ID,
int $a_parent_node_id = 0)
60 $this->
http = $DIC->http();
61 $this->
tabs = $DIC->tabs();
63 $this->
lng->loadLanguageModule(
"dcl");
64 $this->
lng->loadLanguageModule(
'content');
65 $this->
lng->loadLanguageModule(
'obj');
66 $this->
lng->loadLanguageModule(
'cntr');
74 if ($this->
ctrl->isAsynch() ===
false) {
78 $this->dclEndPoint->saveParameterTableId($this);
81 private function setTableId(
int $objectOrRefId = 0): void
83 if ($this->
http->wrapper()->query()->has(
'table_id')) {
84 $this->table_id = $this->
http->wrapper()->query()->retrieve(
'table_id', $this->
refinery->kindlyTo()->int());
85 } elseif ($this->
http->wrapper()->query()->has(
'tableview_id')) {
86 $this->table_id = ilDclTableView::find(
87 $this->
http->wrapper()->query()->retrieve(
'tableview_id', $this->
refinery->kindlyTo()->int())
89 } elseif ($objectOrRefId > 0) {
90 $this->table_id = $this->
object->getFirstVisibleTableId();
101 $this->dclUi->addJavaScriptFile(
"Modules/DataCollection/js/datacollection.js");
121 $ilNavigationHistory = $DIC[
'ilNavigationHistory'];
122 $ilHelp = $DIC[
'ilHelp'];
123 $ilHelp->setScreenIdComponent(
'bibl');
126 $link = $this->
ctrl->getLinkTarget($this,
"render");
129 $ilNavigationHistory->addItem($this->
object->getRefId(), $link,
"dcl");
132 $hasDclGtr = $this->
http->wrapper()->query()->has(self::GET_DCL_GTR);
136 $record_id = $this->
http->wrapper()->query()->retrieve(
141 $this->
ctrl->setParameterByClass(ilDclDetailedViewGUI::class,
'tableview_id', $table_view_id);
142 $this->
ctrl->setParameterByClass(ilDclDetailedViewGUI::class,
'record_id', $record_id);
143 $this->
ctrl->redirectByClass(ilDclDetailedViewGUI::class,
'renderRecord');
146 $next_class = $this->
ctrl->getNextClass($this);
147 $cmd = $this->
ctrl->getCmd();
150 $DIC->ui()->mainTemplate()->loadStandardTemplate();
151 $DIC->ui()->mainTemplate()->setContent(
"Permission Denied.");
156 switch ($next_class) {
157 case "ilinfoscreengui":
159 $this->
tabs->activateTab(self::TAB_INFO);
163 case "ilcommonactiondispatchergui":
166 $gui->enableCommentsSettings(
false);
167 $this->
ctrl->forwardCommand($gui);
170 case "ilpermissiongui":
172 $this->
tabs->activateTab(self::TAB_LIST_PERMISSIONS);
174 $this->
ctrl->forwardCommand($perm_gui);
177 case "ilobjectcopygui":
180 $DIC->ui()->mainTemplate()->loadStandardTemplate();
181 $this->
ctrl->forwardCommand($cp);
184 case "ildcltablelistgui":
186 $this->
tabs->activateTab(self::TAB_LIST_TABLES);
188 $this->
ctrl->forwardCommand($tablelist_gui);
191 case "ildclrecordlistgui":
194 $this->
tabs->activateTab(self::TAB_CONTENT);
196 $this->
ctrl->forwardCommand($recordlist_gui);
199 case "ildclrecordeditgui":
201 $this->
tabs->activateTab(self::TAB_CONTENT);
203 $this->
ctrl->forwardCommand($recordedit_gui);
208 $this->
tabs->activateTab(self::TAB_CONTENT);
210 $this->
ctrl->forwardCommand($file_gui);
216 $record_id = $this->
http->wrapper()->query()->retrieve(
'record_id', $this->
refinery->kindlyTo()->int());
217 $field_id = $this->
http->wrapper()->query()->retrieve(
'field_id', $this->
refinery->kindlyTo()->int());
219 $rgui->setObject($record_id,
"dcl_record", $field_id,
"dcl_field");
220 $rgui->executeCommand();
224 case "ildcldetailedviewgui":
227 $this->
ctrl->forwardCommand($recordview_gui);
228 $this->
tabs->clearTargets();
229 $this->
tabs->setBackTarget(
230 $this->
lng->txt(
"back"),
231 $this->
ctrl->getLinkTargetByClass(
232 ilDclRecordListGUI::class,
241 $this->
ctrl->forwardCommand($recordviewGui);
242 $this->
tabs->clearTargets();
243 $this->
tabs->setBackTarget($this->
lng->txt(
"back"), $this->
ctrl->getLinkTarget($this,
""));
245 case "ildclexportgui":
249 case strtolower(ilDclPropertyFormGUI::class):
251 $recordedit_gui->getRecord();
252 $recordedit_gui->initForm();
253 $form = $recordedit_gui->getForm();
254 $this->
ctrl->forwardCommand($form);
267 parent::executeCommand();
275 $this->
tabs->setTabActive(self::TAB_EXPORT);
278 $exp_gui->addFormat(
"xlsx", $this->
lng->txt(
'dlc_xls_async_export'), $exporter,
'exportAsync');
279 $exp_gui->addFormat(
"xml");
281 $exp_gui->listExportFiles();
283 $this->
ctrl->forwardCommand($exp_gui);
289 $tableview_id = null;
290 if ($this->
http->wrapper()->query()->has(
'tableview_id')) {
291 $tableview_id = $this->
http->wrapper()->query()->retrieve(
296 if ($this->
http->wrapper()->post()->has(
'tableview_id')) {
297 $tableview_id = $this->
http->wrapper()->post()->retrieve(
302 if (!$tableview_id) {
304 $tableview_id = $table_obj->getFirstTableViewId($this->
getRefId());
306 return $tableview_id;
316 $this->
ctrl->setCmd(
"showSummary");
317 $this->
ctrl->setCmdClass(
"ilinfoscreengui");
326 if ($this->
http->wrapper()->query()->has(
'tableview_id')) {
327 $tableview_id = $this->
http->wrapper()->query()->retrieve(
331 $this->
ctrl->setParameterByClass(
'ilDclRecordListGUI',
'tableview_id', $tableview_id);
333 $this->
ctrl->redirectByClass(
"ildclrecordlistgui",
"show");
341 $this->
tabs->activateTab(self::TAB_INFO);
348 $info->enablePrivateNotes();
349 $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
351 $this->
ctrl->forwardCommand($info);
359 if (is_object($this->
object) ===
true) {
360 $this->dclUi->addLocatorItem(
361 $this->
object->getTitle(),
362 $this->
ctrl->getLinkTarget($this,
""),
363 $this->
object->getRefId()
368 public static function _goto(
string $a_target): void
371 $lng = $DIC->language();
374 $dclUi = $dclConfig->getDataCollectionUi();
376 $ilCtrl = $DIC->ctrl();
377 $dclAccess = $dclConfig->getDataCollectionAccess();
379 $targetParts = explode(
"_", $a_target);
380 if (count($targetParts) === 1) {
382 } elseif (count($targetParts) === 2) {
383 [
$refId, $viewId] = $targetParts;
385 [
$refId, $viewId, $recordId] = $targetParts;
392 $lng->
txt(
"msg_no_perm_read_item"),
401 $ilCtrl->setParameterByClass(
"ilRepositoryGUI", self::GET_REF_ID,
$refId);
402 if (isset($viewId)) {
403 $ilCtrl->setParameterByClass(
"ilRepositoryGUI", self::GET_VIEW_ID, $viewId);
405 if (isset($recordId)) {
406 $ilCtrl->setParameterByClass(
"ilRepositoryGUI", self::GET_DCL_GTR, $recordId);
408 $ilCtrl->redirectByClass(
"ilRepositoryGUI",
"listRecords");
419 $this->dclUi->displaySuccessMessage($this->
lng->txt(
"object_added"));
421 $listTablesLink = $this->dclEndPoint->getListTablesLink();
422 $this->dclEndPoint->redirect($listTablesLink);
432 $refId = $this->
object->getRefId();
435 if ($this->dclAccess->hasReadPermission(
$refId) ===
true) {
437 $this->
addTab(self::TAB_CONTENT, $this->dclEndPoint->getListRecordsLink());
441 if ($this->dclAccess->hasVisibleOrReadPermission(
$refId) ===
true) {
443 $this->
addTab(self::TAB_INFO, $this->dclEndPoint->getInfoScreenLink());
447 if ($this->dclAccess->hasWritePermission(
$refId) ===
true) {
449 $this->
addTab(self::TAB_EDIT_DCL, $this->dclEndPoint->getEditDclLink($this));
451 $this->
addTab(self::TAB_LIST_TABLES, $this->dclEndPoint->getListTablesLink());
453 $this->
addTab(self::TAB_EXPORT, $this->dclEndPoint->getDataCollectionExportLink());
457 if ($this->dclAccess->hasEditPermissionPermission(
$refId) ===
true) {
459 $this->
addTab(self::TAB_LIST_PERMISSIONS, $this->dclEndPoint->getListPermissionsLink());
463 private function addTab(
string $langKey,
string $link): void
465 $this->
tabs->addTab($langKey, $this->
lng->txt($langKey), $link);
476 $refId = $this->
object->getRefId();
477 if ($this->dclAccess->hasWritePermission(
$refId) ===
false) {
478 $this->dclUi->displayErrorMessage(
479 $this->
lng->txt(
"msg_no_perm_write")
483 $this->
tabs->activateTab(self::TAB_EDIT_DCL);
488 $form->setValuesByArray($values,
true);
493 $dataCollectionTemplate->setContent($form->getHTML());
498 $this->
tabs->activateTab(self::TAB_EDIT_DCL);
501 $form->setFormAction($this->
ctrl->getFormAction($this,
"update"));
502 $form->setTitle($this->
lng->txt($this->object->getType() .
"_edit"));
508 $ti->setRequired(
true);
519 $cb->
setInfo($this->
lng->txt(
"dcl_online_info"));
524 $cb->
setInfo($this->
lng->txt(
"dcl_notification_info"));
529 $section_appearance->setTitle($this->
lng->txt(
'cont_presentation'));
530 $form->addItem($section_appearance);
531 $form = $this->object_service->commonSettings()->legacyForm($form, $this->
object)->addTileImage();
533 $form->addCommandButton(
"update", $this->
lng->txt(
"save"));
540 $listRecordsLink = $this->dclEndPoint->getListRecordsLink($this->
getTableViewId());
541 $this->dclEndPoint->redirect($listRecordsLink);
551 $a_values[
"is_online"] = $this->
object->getOnline();
552 $a_values[
"rating"] = $this->
object->getRating();
553 $a_values[
"public_notes"] = $this->
object->getPublicNotes();
554 $a_values[
"approval"] = $this->
object->getApproval();
555 $a_values[
"notification"] = $this->
object->getNotification();
560 $this->
object->setOnline($form->
getInput(
"is_online"));
561 $this->
object->setRating($form->
getInput(
"rating"));
562 $this->
object->setPublicNotes($form->
getInput(
"public_notes"));
563 $this->
object->setApproval($form->
getInput(
"approval"));
564 $this->
object->setNotification($form->
getInput(
"notification"));
566 $this->object_service->commonSettings()->legacyForm($form, $this->
object)->saveTileImage();
576 $tables = $this->
object->getTables();
577 if (count($tables) === 1 && count($table->getRecordFields()) === 0 && count($table->getRecords()) === 0
578 && $this->
object->getOnline()
580 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"dcl_no_content_warning"),
true);
586 $ntf = $this->
http->wrapper()->query()->retrieve(
'ntf', $this->
refinery->kindlyTo()->int());
591 $this->
user->getId(),
599 $this->
user->getId(),
604 $this->
ctrl->redirectByClass(
"ildclrecordlistgui",
"show");
609 ilObjectListGUI::prepareJSLinks(
610 $this->
ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
612 $this->
ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true)
617 $lg = $dispatcher->initHeaderAction();
623 $this->
ctrl->setParameter($this,
"ntf", 1);
624 $lg->addCustomCommand($this->
ctrl->getLinkTarget($this,
"toggleNotification"),
"dcl_notification_deactivate_dcl");
626 $lg->addHeaderIcon(
"not_icon",
ilUtil::getImagePath(
"notification_on.svg"), $this->
lng->txt(
"dcl_notification_activated"));
629 $this->
ctrl->setParameter($this,
"ntf", 2);
630 $lg->addCustomCommand($this->
ctrl->getLinkTarget($this,
"toggleNotification"),
"dcl_notification_activate_dcl");
632 $lg->addHeaderIcon(
"not_icon",
ilUtil::getImagePath(
"notification_off.svg"), $this->
lng->txt(
"dcl_notification_deactivated"));
634 $this->
ctrl->setParameter($this,
"ntf",
"");
637 $this->tpl->setHeaderActionMenu($lg->getHeaderAction());
ILIAS HTTP Services $http
checkPermission(string $perm, string $cmd="", string $type="", int $ref_id=null)
handleExport(bool $do_default=false)
__construct(int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
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...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
New implementation of ilObjectGUI.
GUI class for the workflow of copying objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _gotoRepositoryNode(int $ref_id, string $cmd="")
hasReadPermission(int $refId)
prepareOutput(bool $show_sub_objects=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilDataCollectionUiPort $dclUi
displayFailureMessage(string $message)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
editObject()
edit object public
addExternalEditFormCustom(ilPropertyFormGUI $form)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
const TYPE_DATA_COLLECTION
hasVisibleOrReadPermission(int $refId)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilDataCollectionEndpointPort $dclEndPoint
static http()
Fetches the global http state from ILIAS.
setTabs()
setTabs create tabs (repository/workspace switch) this had to be moved here because of the context-sp...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
static _lookupTitle(int $obj_id)
static getTableCache(int $table_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static setNotification(int $type, int $user_id, int $id, bool $status=true)
Set notification status for object and user.
updateCustom(ilPropertyFormGUI $form)
ilGlobalTemplateInterface $tpl
afterSave(ilObject $new_object)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
render()
show Content; redirect to ilDclRecordListGUI::listRecords
static _goto(string $a_target)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilDataCollectionAccessPort $dclAccess
setTableId(int $objectOrRefId=0)
const TAB_LIST_PERMISSIONS
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
static hasNotification(int $type, int $user_id, int $id)
Check notification status for object and user.
getDataCollectionObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
addTab(string $langKey, string $link)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getEditFormCustomValues(array &$a_values)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
hasVisiblePermission(int $refId)
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
infoScreen()
this one is called from the info button in the repository not very nice to set cmdClass/Cmd manually...
infoScreenForward()
show information screen
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...