43 $locator = $DIC[
'ilLocator'];
44 $this->parent_obj = $a_parent_obj;
45 $this->
ctrl = $DIC->ctrl();
46 $this->
lng = $DIC->language();
47 $this->tpl = $DIC->ui()->mainTemplate();
48 $this->
tabs = $DIC->tabs();
49 $this->
toolbar = $DIC->toolbar();
50 $this->
http = $DIC->http();
54 $table_id = $this->
http->wrapper()->query()->retrieve(
'table_id', $this->
refinery->kindlyTo()->int());
59 $this->
ctrl->saveParameterByClass(
'ilDclTableEditGUI',
'table_id');
60 $locator->addItem($this->table->getTitle(), $this->
ctrl->getLinkTargetByClass(
'ilDclTableEditGUI',
'edit'));
61 $this->tpl->setLocator();
64 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
65 $this->
ctrl->redirectByClass(
'ildclrecordlistgui',
'listRecords');
71 $this->
ctrl->saveParameter($this,
'table_id');
72 $cmd = $this->
ctrl->getCmd(
"show");
73 $next_class = $this->
ctrl->getNextClass($this);
75 switch ($next_class) {
76 case 'ildcltablevieweditgui':
77 if ($this->
http->wrapper()->query()->has(
'tableview_id')) {
78 $tableview_id = $this->
http->wrapper()->query()->retrieve(
91 $this->
ctrl->saveParameter($edit_gui,
'tableview_id');
92 $this->
ctrl->forwardCommand($edit_gui);
108 $this->parent_obj->getDataCollectionObject()->getRefId(),
109 $this->table->getId()
116 $add_new->setPrimary(
true);
117 $add_new->setCaption(
"dcl_add_new_view");
118 $add_new->setUrl($this->
ctrl->getLinkTargetByClass(
'ilDclTableViewEditGUI',
'add'));
119 $this->
toolbar->addStickyItem($add_new);
121 $this->
toolbar->addSeparator();
124 $tables = $this->parent_obj->getDataCollectionObject()->getTables();
126 foreach ($tables as $table) {
127 $options[$table->getId()] = $table->getTitle();
130 $table_selection->setOptions($options);
131 $table_selection->setValue($this->table->getId());
133 $this->
toolbar->setFormAction($this->
ctrl->getFormActionByClass(
"ilDclTableViewGUI",
"doTableSwitch"));
134 $this->
toolbar->addText($this->
lng->txt(
"dcl_select"));
135 $this->
toolbar->addInputItem($table_selection);
137 $button->setCommand(
"doTableSwitch");
138 $button->setCaption(
'change');
139 $this->
toolbar->addButtonInstance($button);
142 $this->tpl->setContent($table_gui->getHTML());
147 $this->
ctrl->setParameterByClass(
150 $this->
http->wrapper()->post()->retrieve(
'table_id', $this->
refinery->kindlyTo()->int())
152 $this->
ctrl->redirectByClass(
"ilDclTableViewGUI",
"show");
162 $has_dcl_tableview_ids = $this->
http->wrapper()->post()->has(
'dcl_tableview_ids');
163 if (!$has_dcl_tableview_ids) {
164 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'dcl_delete_views_no_selection'),
true);
165 $this->
ctrl->redirect($this,
'show');
168 $tableviews = $this->
http->wrapper()->post()->retrieve(
174 $this->
tabs->clearSubTabs();
176 $conf->setFormAction($this->
ctrl->getFormAction($this));
177 $conf->setHeaderText($this->
lng->txt(
'dcl_tableviews_confirm_delete'));
179 foreach ($tableviews as $tableview_id) {
180 $conf->addItem(
'dcl_tableview_ids[]', $tableview_id, ilDclTableView::find($tableview_id)->getTitle());
182 $conf->setConfirm($this->
lng->txt(
'delete'),
'deleteTableviews');
183 $conf->setCancel($this->
lng->txt(
'cancel'),
'show');
184 $this->tpl->setContent($conf->getHTML());
190 $has_dcl_tableview_ids = $this->
http->wrapper()->post()->has(
'dcl_tableview_ids');
191 if ($has_dcl_tableview_ids) {
192 $tableviews = $this->
http->wrapper()->post()->retrieve(
196 foreach ($tableviews as $tableview_id) {
197 ilDclTableView::find($tableview_id)->delete();
201 $this->table->sortTableViews();
202 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'dcl_msg_tableviews_deleted'),
true);
203 $this->
ctrl->redirect($this,
'show');
212 if ($delete_count >= count($this->table->getTableViews())) {
213 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'dcl_msg_tableviews_delete_all'),
true);
214 $this->
ctrl->redirect($this,
'show');
223 $orders = $this->
http->wrapper()->post()->retrieve(
228 $tableviews = array();
229 foreach (array_keys($orders) as $tableview_id) {
230 $tableviews[] = ilDclTableView::find($tableview_id);
232 $this->table->sortTableViews($tableviews);
233 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'dcl_msg_tableviews_order_updated'));
234 $this->
ctrl->redirect($this);
ilDclTableListGUI $parent_obj
ilGlobalTemplateInterface $tpl
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...
saveTableViewOrder()
invoked by ilDclTableViewTableGUI
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(ilDclTableListGUI $a_parent_obj, int $table_id=0)
Constructor.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
confirmDeleteTableviews()
Confirm deletion of multiple fields.
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
checkViewsLeft(int $delete_count)
redirects if there are no tableviews left after deletion of {$delete_count} tableviews ...
static findOrGetInstance($primary_key, array $add_constructor_args=array())
static http()
Fetches the global http state from ILIAS.
static getTableCache(int $table_id=null)
ILIAS Refinery Factory $refinery
static hasAccessToEditTable(int $ref_id, int $table_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS HTTP Services $http