Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataCollection: add screenIDs for TRUNK #8587

Merged
merged 1 commit into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ public function getRecord(): void
*/
public function create(): void
{
global $DIC;
$DIC->help()->setSubScreenId('create');
$this->initForm();
$this->tpl->setContent($this->form->getHTML());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ilDclFieldEditGUI
protected ilDclBaseFieldModel $field_obj;
private ilGlobalTemplateInterface $main_tpl;
private ilLanguage $lng;
protected ilHelpGUI $help;
protected ILIAS\HTTP\Services $http;
protected ILIAS\Refinery\Factory $refinery;
protected int $field_id;
Expand All @@ -44,6 +45,7 @@ public function __construct(ilDclTableListGUI $a_parent_obj)

$this->obj_id = $a_parent_obj->getObjId();
$this->parent_obj = $a_parent_obj;
$this->help = $DIC->help();
$this->http = $DIC->http();
$this->refinery = $DIC->refinery();
$this->lng = $DIC->language();
Expand Down Expand Up @@ -118,26 +120,22 @@ public function executeCommand(): void
*/
public function create(): void
{
global $DIC;
$tpl = $DIC['tpl'];
$this->help->setSubScreenId('create');

$this->initForm();
$tpl->setContent($this->form->getHTML());
$this->main_tpl->setContent($this->form->getHTML());
}

/**
* create field edit form
*/
public function edit(): void
{
global $DIC;
$tpl = $DIC['tpl'];
$this->help->setSubScreenId('edit');

$this->initForm("edit");

$this->field_obj->fillPropertiesForm($this->form);

$tpl->setContent($this->form->getHTML());
$this->main_tpl->setContent($this->form->getHTML());
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ public function __construct(ilDclTableListGUI $a_parent_obj)
$this->ui_factory = $DIC->ui()->factory();
$this->renderer = $DIC->ui()->renderer();

$DIC->help()->setScreenId('dcl_fields');

$this->ctrl->saveParameterByClass(ilDclTableEditGUI::class, 'table_id');
$locator->addItem(
ilDclCache::getTableCache($this->table_id)->getTitle(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class ilDclTableEditGUI
protected ilGlobalTemplateInterface $tpl;
protected ilToolbarGUI $toolbar;
protected Form $form;
protected ilHelpGUI $help;
protected ILIAS\HTTP\Services $http;
protected ILIAS\Refinery\Factory $refinery;
protected ilDclTableListGUI $parent_object;
Expand All @@ -48,6 +49,7 @@ public function __construct(ilDclTableListGUI $a_parent_obj)
$this->toolbar = $DIC->toolbar();
$this->parent_object = $a_parent_obj;
$this->obj_id = $a_parent_obj->getObjId();
$this->help = $DIC->help();
$this->http = $DIC->http();
$this->refinery = $DIC->refinery();
$this->ui_factory = $DIC->ui()->factory();
Expand Down Expand Up @@ -85,11 +87,13 @@ public function executeCommand(): void

public function create(): void
{
$this->help->setSubScreenId('create');
$this->tpl->setContent($this->lng->txt('dcl_new_table') . $this->ui_renderer->render($this->initForm()));
}

public function edit(): void
{
$this->help->setSubScreenId('edit');
$this->tpl->setContent(sprintf($this->lng->txt('dcl_edit_table'), $this->table->getTitle()) . $this->ui_renderer->render($this->initForm('edit')));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ public function __construct(ilObjDataCollectionGUI $a_parent_obj)
$this->ui_factory = $DIC->ui()->factory();
$this->renderer = $DIC->ui()->renderer();

$this->tabs->setSetupMode(true);
$DIC->help()->setScreenId('dcl_tables');

$this->parent_obj = $a_parent_obj;

if (!$this->checkAccess()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class ilDclTableViewEditGUI
protected ilDclTableViewEditFieldsTableGUI $table_gui;
protected ilTabsGUI $tabs_gui;
public ilDclTable $table;
protected ilHelpGUI $help;
protected ILIAS\HTTP\Services $http;
protected ILIAS\Refinery\Factory $refinery;

Expand All @@ -52,6 +53,7 @@ public function __construct(ilDclTableViewGUI $parent_obj, ilDclTable $table, il
$this->parent_obj = $parent_obj;
$this->tableview = $tableview;
$this->tabs_gui = $ilTabs;
$this->help = $DIC->help();
$this->http = $DIC->http();
$this->refinery = $DIC->refinery();

Expand Down Expand Up @@ -85,40 +87,25 @@ public function executeCommand(): void

switch ($next_class) {
case 'ildcldetailedviewdefinitiongui':
$this->help->setSubScreenId('detailed_view');
$this->setTabs('detailed_view');
$recordedit_gui = new ilDclDetailedViewDefinitionGUI($this->tableview->getId());
$ret = $this->ctrl->forwardCommand($recordedit_gui);
if ($ret != "") {
$this->tpl->setContent($ret);
}
global $DIC;
$ilTabs = $DIC['ilTabs'];
$ilTabs->removeTab('edit');
$ilTabs->removeTab('history');
$ilTabs->removeTab('clipboard'); // Fixme
$ilTabs->removeTab('pg');
break;
case 'ildclcreateviewdefinitiongui':
$this->help->setSubScreenId('record_create');
$this->setTabs('create_view');
$creation_gui = new ilDclCreateViewDefinitionGUI($this->tableview->getId());
$this->ctrl->forwardCommand($creation_gui);
global $DIC;
$ilTabs = $DIC['ilTabs'];
$ilTabs->removeTab('edit');
$ilTabs->removeTab('history');
$ilTabs->removeTab('clipboard'); // Fixme
$ilTabs->removeTab('pg');
break;
case 'ildcleditviewdefinitiongui':
$this->help->setSubScreenId('record_edit');
$this->setTabs('edit_view');
$edit_gui = new ilDclEditViewDefinitionGUI($this->tableview->getId());
$this->ctrl->forwardCommand($edit_gui);
global $DIC;
$ilTabs = $DIC['ilTabs'];
$ilTabs->removeTab('edit');
$ilTabs->removeTab('history');
$ilTabs->removeTab('clipboard'); // Fixme
$ilTabs->removeTab('pg');
break;
default:
switch ($cmd) {
Expand All @@ -130,15 +117,18 @@ public function executeCommand(): void
}
break;
case 'add':
$this->help->setSubScreenId('create');
$ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
$this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
break;
case 'editGeneralSettings':
$this->help->setSubScreenId('edit');
$this->setTabs('general_settings');
$ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
$this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
break;
case 'editFieldSettings':
$this->help->setSubScreenId('overview');
$this->setTabs('field_settings');
$this->initTableGUI();
$this->tpl->setContent($this->table_gui->getHTML());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ public function __construct(ilDclTableListGUI $a_parent_obj, int $table_id = 0)
$this->ui_factory = $DIC->ui()->factory();
$this->renderer = $DIC->ui()->renderer();

$DIC->help()->setScreenId('dcl_views');

if ($table_id == 0) {
$table_id = $this->http->wrapper()->query()->retrieve('table_id', $this->refinery->kindlyTo()->int());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,7 @@ public function executeCommand(): void
global $DIC;

$ilNavigationHistory = $DIC['ilNavigationHistory'];
$ilHelp = $DIC['ilHelp'];
$ilHelp->setScreenIdComponent('bibl');
$DIC->help()->setScreenIdComponent('dcl');

// Navigation History
$link = $this->ctrl->getLinkTarget($this, "render");
Expand Down