2 require_once(
"./Modules/DataCollection/classes/TableView/class.ilDclTableViewFieldsTableGUI.php");
3 require_once(
"./Modules/DataCollection/classes/TableView/class.ilDclTableViewEditFormGUI.php");
4 require_once(
"./Services/AccessControl/classes/class.ilObjRole.php");
72 $ilTabs = $DIC[
'ilTabs'];
73 $locator = $DIC[
'ilLocator'];
80 $this->tabs_gui = $ilTabs;
82 $this->ctrl->saveParameterByClass(
'ilDclTableEditGUI',
'table_id');
83 $this->ctrl->saveParameter($this,
'tableview_id');
84 $locator->addItem($this->tableview->getTitle(), $this->ctrl->getLinkTarget($this,
'show'));
85 $this->tpl->setLocator();
94 $cmd = $this->ctrl->getCmd(
'show');
95 $next_class = $this->ctrl->getNextClass($this);
101 $this->tabs_gui->clearTargets();
102 $this->tabs_gui->clearSubTabs();
103 $this->tabs_gui->setBackTarget($this->lng->txt(
'dcl_tableviews'), $this->ctrl->getLinkTarget($this->parent_obj));
104 $this->tabs_gui->setBack2Target($this->lng->txt(
'dcl_tables'), $this->ctrl->getLinkTarget($this->parent_obj->parent_obj));
110 case 'ildcldetailedviewdefinitiongui':
111 $this->
setTabs(
'detailed_view');
112 require_once(
'./Modules/DataCollection/classes/DetailedView/class.ilDclDetailedViewDefinitionGUI.php');
114 $ret = $this->ctrl->forwardCommand($recordedit_gui);
116 $this->tpl->setContent($ret);
119 $ilTabs = $DIC[
'ilTabs'];
120 $ilTabs->removeTab(
'edit');
121 $ilTabs->removeTab(
'history');
122 $ilTabs->removeTab(
'clipboard');
123 $ilTabs->removeTab(
'pg');
128 if ($this->tableview->getId()) {
129 $this->ctrl->redirect($this,
'editGeneralSettings');
131 $this->ctrl->redirect($this,
'add');
136 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
138 case 'editGeneralSettings':
139 $this->
setTabs(
'general_settings');
141 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
143 case 'editFieldSettings':
144 $this->
setTabs(
'field_settings');
146 $this->tpl->setContent($this->table_gui->getHTML());
159 $this->tabs_gui->addTab(
'general_settings', $this->lng->txt(
'settings'), $this->ctrl->getLinkTarget($this,
'editGeneralSettings'));
160 $this->tabs_gui->addTab(
'field_settings', $this->lng->txt(
'dcl_list_visibility_and_filter'), $this->ctrl->getLinkTarget($this,
'editFieldSettings'));
161 $this->tabs_gui->addTab(
'detailed_view', $this->lng->txt(
'dcl_detailed_view'), $this->ctrl->getLinkTargetByClass(
'ilDclDetailedViewDefinitionGUI',
'edit'));
162 $this->tabs_gui->setTabActive($active);
171 $ilDclTableViewEditFormGUI->setValuesByPost();
172 if ($ilDclTableViewEditFormGUI->checkInput()) {
173 $ilDclTableViewEditFormGUI->updateTableView();
174 $this->ctrl->redirect($this,
'editGeneralSettings');
176 $this->
setTabs(
'general_settings');
177 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
187 $ilDclTableViewEditFormGUI->setValuesByPost();
188 if ($ilDclTableViewEditFormGUI->checkInput()) {
189 $ilDclTableViewEditFormGUI->createTableView();
190 $this->ctrl->redirect($this,
'editGeneralSettings');
192 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
199 public function saveTable()
204 foreach ($this->tableview->getFieldSettings() as $setting)
207 foreach (
array(
"Visible",
"InFilter",
"FilterChangeable") as $attribute)
209 $key = $attribute .
'_' . $setting->getField();
210 $setting->{
'set'.$attribute}(
$_POST[$key] ==
'on');
215 $key =
'filter_' . $setting->getField();
218 $setting->setFilterValue(
$_POST[$key]);
220 elseif (
$_POST[$key .
'_from'] != null &&
$_POST[$key .
'_to'] != null)
222 $setting->setFilterValue(
array(
"from" =>
$_POST[$key .
'_from'],
"to" =>
$_POST[$key .
'_to'] ) );
226 $setting->setFilterValue(null);
232 $this->ctrl->saveParameter($this->parent_obj,
'tableview_id');
233 $this->ctrl->redirect($this,
'editFieldSettings');
242 $this->table_gui =
$table;
250 $this->ctrl->setParameter($this->parent_obj,
'table_id', $this->table->getId());
251 $this->ctrl->redirect($this->parent_obj);
260 $this->parent_obj->checkViewsLeft(1);
262 include_once
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
264 $conf->setFormAction($this->ctrl->getFormAction($this));
265 $conf->setHeaderText($this->lng->txt(
'dcl_tableview_confirm_delete'));
267 $conf->addItem(
'tableview_id', (
int)$this->tableview->getId(), $this->tableview->getTitle());
269 $conf->setConfirm($this->lng->txt(
'delete'),
'delete');
270 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
272 $this->tpl->setContent($conf->getHTML());
275 protected function delete() {
276 $this->tableview->delete();
277 $this->table->sortTableViews();
299 if (in_array(
$cmd, [
'add',
'create'])) {
301 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
302 $this->table->getId()
305 return ilObjDataCollectionAccess::hasAccessTo(
306 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
307 $this->table->getId(),
308 $this->tableview->getId()
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
executeCommand()
execute command
Confirmation screen class.