70 $ilTabs = $DIC[
'ilTabs'];
71 $locator = $DIC[
'ilLocator'];
78 $this->tabs_gui = $ilTabs;
80 $this->ctrl->saveParameterByClass(
'ilDclTableEditGUI',
'table_id');
81 $this->ctrl->saveParameter($this,
'tableview_id');
82 $locator->addItem($this->tableview->getTitle(), $this->ctrl->getLinkTarget($this,
'show'));
83 $this->tpl->setLocator();
92 $cmd = $this->ctrl->getCmd(
'show');
93 $next_class = $this->ctrl->getNextClass($this);
99 $this->tabs_gui->clearTargets();
100 $this->tabs_gui->clearSubTabs();
101 $this->tabs_gui->setBackTarget($this->lng->txt(
'dcl_tableviews'), $this->ctrl->getLinkTarget($this->parent_obj));
102 $this->tabs_gui->setBack2Target($this->lng->txt(
'dcl_tables'), $this->ctrl->getLinkTarget($this->parent_obj->parent_obj));
106 switch ($next_class) {
107 case 'ildcldetailedviewdefinitiongui':
108 $this->
setTabs(
'detailed_view');
110 $ret = $this->ctrl->forwardCommand($recordedit_gui);
112 $this->tpl->setContent($ret);
115 $ilTabs = $DIC[
'ilTabs'];
116 $ilTabs->removeTab(
'edit');
117 $ilTabs->removeTab(
'history');
118 $ilTabs->removeTab(
'clipboard');
119 $ilTabs->removeTab(
'pg');
124 if ($this->tableview->getId()) {
125 $this->ctrl->redirect($this,
'editGeneralSettings');
127 $this->ctrl->redirect($this,
'add');
132 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
134 case 'editGeneralSettings':
135 $this->
setTabs(
'general_settings');
137 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
139 case 'editFieldSettings':
140 $this->
setTabs(
'field_settings');
142 $this->tpl->setContent($this->table_gui->getHTML());
154 $this->tabs_gui->addTab(
'general_settings', $this->lng->txt(
'settings'), $this->ctrl->getLinkTarget($this,
'editGeneralSettings'));
155 $this->tabs_gui->addTab(
'field_settings', $this->lng->txt(
'dcl_list_visibility_and_filter'), $this->ctrl->getLinkTarget($this,
'editFieldSettings'));
156 $this->tabs_gui->addTab(
'detailed_view', $this->lng->txt(
'dcl_detailed_view'), $this->ctrl->getLinkTargetByClass(
'ilDclDetailedViewDefinitionGUI',
'edit'));
157 $this->tabs_gui->setTabActive($active);
166 $ilDclTableViewEditFormGUI->setValuesByPost();
167 if ($ilDclTableViewEditFormGUI->checkInput()) {
168 $ilDclTableViewEditFormGUI->updateTableView();
169 $this->ctrl->redirect($this,
'editGeneralSettings');
171 $this->
setTabs(
'general_settings');
172 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
182 $ilDclTableViewEditFormGUI->setValuesByPost();
183 if ($ilDclTableViewEditFormGUI->checkInput()) {
184 $ilDclTableViewEditFormGUI->createTableView();
185 $this->ctrl->redirect($this,
'editGeneralSettings');
187 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
194 public function saveTable()
199 foreach ($this->tableview->getFieldSettings() as $setting) {
201 foreach (array(
"Visible",
"InFilter",
"FilterChangeable") as $attribute) {
202 $key = $attribute .
'_' . $setting->getField();
203 $setting->{
'set' . $attribute}(
$_POST[
$key] ==
'on');
207 $key =
'filter_' . $setting->getField();
208 if (
$_POST[$key] != null) {
209 $setting->setFilterValue(
$_POST[$key]);
210 } elseif (
$_POST[$key .
'_from'] != null &&
$_POST[$key .
'_to'] != null) {
211 $setting->setFilterValue(array(
"from" =>
$_POST[$key .
'_from'],
"to" =>
$_POST[$key .
'_to'] ));
213 $setting->setFilterValue(null);
218 ilUtil::sendSuccess($this->lng->txt(
'dcl_msg_tableview_updated'),
true);
219 $this->ctrl->saveParameter($this->parent_obj,
'tableview_id');
220 $this->ctrl->redirect($this,
'editFieldSettings');
229 $this->table_gui =
$table;
237 $this->ctrl->setParameter($this->parent_obj,
'table_id', $this->table->getId());
238 $this->ctrl->redirect($this->parent_obj);
247 $this->parent_obj->checkViewsLeft(1);
249 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
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());
262 protected function delete()
264 $this->tableview->delete();
265 $this->table->sortTableViews();
266 ilUtil::sendSuccess($this->lng->txt(
'dcl_msg_tableview_deleted'),
true);
288 if (in_array($cmd, [
'add',
'create'])) {
290 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
291 $this->table->getId()
294 return ilObjDataCollectionAccess::hasAccessTo(
295 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
296 $this->table->getId(),
297 $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.