2 require_once(
'Modules/DataCollection/classes/TableView/class.ilDclTableViewTableGUI.php');
3 require_once(
'Modules/DataCollection/classes/TableView/class.ilDclTableViewEditGUI.php');
4 require_once(
'Services/Utilities/classes/class.ilConfirmationGUI.php');
57 $ilToolbar = $DIC[
'ilToolbar'];
59 $ilTabs = $DIC[
'ilTabs'];
60 $locator = $DIC[
'ilLocator'];
63 $table_id =
$_GET[
'table_id'];
66 $this->parent_obj = $a_parent_obj;
70 $this->tabs = $ilTabs;
71 $this->toolbar = $ilToolbar;
74 $this->ctrl->saveParameterByClass(
'ilDclTableEditGUI',
'table_id');
75 $locator->addItem($this->table->getTitle(), $this->ctrl->getLinkTargetByClass(
'ilDclTableEditGUI',
'edit'));
76 $this->tpl->setLocator();
80 $this->ctrl->redirectByClass(
'ildclrecordlistgui',
'listRecords');
90 $this->ctrl->saveParameter($this,
'table_id');
91 $cmd = $this->ctrl->getCmd(
"show");
92 $next_class = $this->ctrl->getNextClass($this);
96 case 'ildcltablevieweditgui':
97 require_once(
'./Modules/DataCollection/classes/TableView/class.ilDclTableViewEditGUI.php');
99 $this->ctrl->saveParameter($edit_gui,
'tableview_id');
100 $this->ctrl->forwardCommand($edit_gui);
128 $add_new->setPrimary(
true);
129 $add_new->setCaption(
"dcl_add_new_view");
130 $add_new->setUrl($this->ctrl->getLinkTargetByClass(
'ilDclTableViewEditGUI',
'add'));
131 $this->toolbar->addStickyItem($add_new);
133 $this->toolbar->addSeparator();
136 require_once(
"./Modules/DataCollection/classes/Table/class.ilDclTable.php");
137 $tables = $this->parent_obj->getDataCollectionObject()->getTables();
139 foreach($tables as
$table)
141 $options[$table->getId()] = $table->getTitle();
143 include_once
'./Services/Form/classes/class.ilSelectInputGUI.php';
145 $table_selection->setOptions(
$options);
146 $table_selection->setValue($this->table->getId());
148 $this->toolbar->setFormAction($this->ctrl->getFormActionByClass(
"ilDclTableViewGUI",
"doTableSwitch"));
149 $this->toolbar->addText($this->lng->txt(
"dcl_select"));
150 $this->toolbar->addInputItem($table_selection);
152 $button->setCommand(
"doTableSwitch");
153 $button->setCaption(
'change');
154 $this->toolbar->addButtonInstance($button);
157 $this->tpl->setContent($table_gui->getHTML());
165 $this->ctrl->setParameterByClass(
"ilDclTableViewGUI",
"table_id",
$_POST[
'table_id']);
166 $this->ctrl->redirectByClass(
"ilDclTableViewGUI",
"show");
176 $tableviews = isset(
$_POST[
'dcl_tableview_ids']) ?
$_POST[
'dcl_tableview_ids'] :
array();
179 $this->tabs->clearSubTabs();
181 $conf->setFormAction($this->ctrl->getFormAction($this));
182 $conf->setHeaderText($this->lng->txt(
'dcl_tableviews_confirm_delete'));
184 foreach ($tableviews as $tableview_id) {
185 $conf->addItem(
'dcl_tableview_ids[]', $tableview_id, ilDclTableView::find($tableview_id)->getTitle());
187 $conf->setConfirm($this->lng->txt(
'delete'),
'deleteTableviews');
188 $conf->setCancel($this->lng->txt(
'cancel'),
'show');
189 $this->tpl->setContent($conf->getHTML());
197 $tableviews = isset(
$_POST[
'dcl_tableview_ids']) ?
$_POST[
'dcl_tableview_ids'] :
array();
198 foreach ($tableviews as $tableview_id) {
199 ilDclTableView::find($tableview_id)->delete();
201 $this->table->sortTableViews();
203 $this->ctrl->redirect($this,
'show');
213 if ($delete_count >= count($this->table->getTableViews()))
216 $this->ctrl->redirect($this,
'show');
225 $orders =
$_POST[
'order'];
227 $tableviews =
array();
228 foreach(array_keys($orders) as $tableview_id)
230 $tableviews[] = ilDclTableView::find($tableview_id);
232 $this->table->sortTableViews($tableviews);
234 $this->ctrl->redirect($this);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilDclTableViewEditGUI.
saveTableViewOrder()
invoked by ilDclTableViewTableGUI
static hasAccessToEditTable($ref_id, $table_id)
confirmDeleteTableviews()
Confirm deletion of multiple fields.
static getTableCache($table_id=0)
__construct(ilDclTableListGUI $a_parent_obj, $table_id=0)
Constructor.
Class ilDclTableViewTableGUI.
if(!is_array($argv)) $options
checkViewsLeft($delete_count)
redirects if there are no tableviews left after deletion of {$delete_count} tableviews ...
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static findOrGetInstance($primary_key, array $add_constructor_args=array())
Confirmation screen class.