64 $ilTabs = $DIC[
'ilTabs'];
65 $locator = $DIC[
'ilLocator'];
72 $this->tabs_gui = $ilTabs;
74 $this->ctrl->saveParameterByClass(
'ilDclTableEditGUI',
'table_id');
75 $this->ctrl->saveParameter($this,
'tableview_id');
76 if ($this->tableview->getTitle()) {
77 $locator->addItem($this->tableview->getTitle(), $this->ctrl->getLinkTarget($this,
'show'));
79 $this->tpl->setLocator();
88 $cmd = $this->ctrl->getCmd(
'show');
89 $next_class = $this->ctrl->getNextClass($this);
95 $this->tabs_gui->clearTargets();
96 $this->tabs_gui->clearSubTabs();
97 $this->tabs_gui->setBackTarget($this->lng->txt(
'dcl_tableviews'), $this->ctrl->getLinkTarget($this->parent_obj));
98 $this->tabs_gui->setBack2Target($this->lng->txt(
'dcl_tables'), $this->ctrl->getLinkTarget($this->parent_obj->parent_obj));
100 switch ($next_class) {
101 case 'ildcldetailedviewdefinitiongui':
102 $this->
setTabs(
'detailed_view');
104 $ret = $this->ctrl->forwardCommand($recordedit_gui);
106 $this->tpl->setContent($ret);
109 $ilTabs = $DIC[
'ilTabs'];
110 $ilTabs->removeTab(
'edit');
111 $ilTabs->removeTab(
'history');
112 $ilTabs->removeTab(
'clipboard');
113 $ilTabs->removeTab(
'pg');
118 if ($this->tableview->getId()) {
119 $this->ctrl->redirect($this,
'editGeneralSettings');
121 $this->ctrl->redirect($this,
'add');
126 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
128 case 'editGeneralSettings':
129 $this->
setTabs(
'general_settings');
131 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
133 case 'editFieldSettings':
134 $this->
setTabs(
'field_settings');
136 $this->tpl->setContent($this->table_gui->getHTML());
149 $this->tabs_gui->addTab(
'general_settings', $this->lng->txt(
'settings'), $this->ctrl->getLinkTarget($this,
'editGeneralSettings'));
150 $this->tabs_gui->addTab(
'field_settings', $this->lng->txt(
'dcl_list_visibility_and_filter'), $this->ctrl->getLinkTarget($this,
'editFieldSettings'));
151 $this->tabs_gui->addTab(
'detailed_view', $this->lng->txt(
'dcl_detailed_view'), $this->ctrl->getLinkTargetByClass(
'ilDclDetailedViewDefinitionGUI',
'edit'));
152 $this->tabs_gui->setTabActive($active);
162 $ilDclTableViewEditFormGUI->setValuesByPost();
163 if ($ilDclTableViewEditFormGUI->checkInput()) {
164 $ilDclTableViewEditFormGUI->updateTableView();
165 $this->ctrl->redirect($this,
'editGeneralSettings');
167 $this->
setTabs(
'general_settings');
168 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
179 $ilDclTableViewEditFormGUI->setValuesByPost();
180 if ($ilDclTableViewEditFormGUI->checkInput()) {
181 $ilDclTableViewEditFormGUI->createTableView();
182 $this->ctrl->redirect($this,
'editGeneralSettings');
184 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
192 public function saveTable()
197 foreach ($this->tableview->getFieldSettings() as $setting) {
199 foreach (array(
"Visible",
"InFilter",
"FilterChangeable") as $attribute) {
200 $key = $attribute .
'_' . $setting->getField();
201 $setting->{
'set' . $attribute}(
$_POST[$key] ==
'on');
205 $key =
'filter_' . $setting->getField();
206 if (
$_POST[$key] != null) {
207 $setting->setFilterValue(
$_POST[$key]);
208 } elseif (
$_POST[$key .
'_from'] != null &&
$_POST[$key .
'_to'] != null) {
209 $setting->setFilterValue(array(
"from" =>
$_POST[$key .
'_from'],
"to" =>
$_POST[$key .
'_to']));
211 $setting->setFilterValue(null);
216 ilUtil::sendSuccess($this->lng->txt(
'dcl_msg_tableview_updated'),
true);
217 $this->ctrl->saveParameter($this->parent_obj,
'tableview_id');
218 $this->ctrl->redirect($this,
'editFieldSettings');
228 $this->table_gui =
$table;
237 $this->ctrl->setParameter($this->parent_obj,
'table_id', $this->table->getId());
238 $this->ctrl->redirect($this->parent_obj);
248 $this->parent_obj->checkViewsLeft(1);
251 $conf->setFormAction($this->ctrl->getFormAction($this));
252 $conf->setHeaderText($this->lng->txt(
'dcl_tableview_confirm_delete'));
254 $conf->addItem(
'tableview_id', (
int) $this->tableview->getId(), $this->tableview->getTitle());
256 $conf->setConfirm($this->lng->txt(
'delete'),
'delete');
257 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
259 $this->tpl->setContent($conf->getHTML());
263 protected function delete()
265 $this->tableview->delete();
266 $this->table->sortTableViews();
267 ilUtil::sendSuccess($this->lng->txt(
'dcl_msg_tableview_deleted'),
true);
289 if (in_array($cmd, [
'add',
'create'])) {
291 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
292 $this->table->getId()
295 return ilObjDataCollectionAccess::hasAccessTo(
296 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
297 $this->table->getId(),
298 $this->tableview->getId()
Class ilDclTableViewEditGUI.
__construct(ilDclTableViewGUI $parent_obj, ilDclTable $table, ilDclTableView $tableview)
ilDclTableViewEditGUI constructor.
Class ilDclDetailedViewDefinitionGUI.
static hasAccessToEditTable($ref_id, $table_id)
Class ilDclTableViewEditFieldsTableGUI.
Class ilDclBaseFieldModel.
cancel()
return to overview
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
executeCommand()
execute command
Confirmation screen class.