64 $ilCtrl = $DIC[
'ilCtrl'];
66 $ilTabs = $DIC[
'ilTabs'];
67 $locator = $DIC[
'ilLocator'];
71 $this->ctrl = $ilCtrl;
74 $this->tabs_gui = $ilTabs;
76 $this->ctrl->saveParameterByClass(
'ilDclTableEditGUI',
'table_id');
77 $this->ctrl->saveParameter($this,
'tableview_id');
78 if ($this->tableview->getTitle()) {
79 $locator->addItem($this->tableview->getTitle(), $this->ctrl->getLinkTarget($this,
'show'));
81 $this->tpl->setLocator();
90 $cmd = $this->ctrl->getCmd(
'show');
91 $next_class = $this->ctrl->getNextClass($this);
97 $this->tabs_gui->clearTargets();
98 $this->tabs_gui->clearSubTabs();
99 $this->tabs_gui->setBackTarget($this->lng->txt(
'dcl_tableviews'), $this->ctrl->getLinkTarget($this->parent_obj));
100 $this->tabs_gui->setBack2Target($this->lng->txt(
'dcl_tables'), $this->ctrl->getLinkTarget($this->parent_obj->parent_obj));
102 switch ($next_class) {
103 case 'ildcldetailedviewdefinitiongui':
104 $this->
setTabs(
'detailed_view');
106 $ret = $this->ctrl->forwardCommand($recordedit_gui);
108 $this->tpl->setContent($ret);
111 $ilTabs = $DIC[
'ilTabs'];
112 $ilTabs->removeTab(
'edit');
113 $ilTabs->removeTab(
'history');
114 $ilTabs->removeTab(
'clipboard');
115 $ilTabs->removeTab(
'pg');
117 case 'ildclcreateviewdefinitiongui':
120 $this->ctrl->forwardCommand($creation_gui);
122 $ilTabs = $DIC[
'ilTabs'];
123 $ilTabs->removeTab(
'edit');
124 $ilTabs->removeTab(
'history');
125 $ilTabs->removeTab(
'clipboard');
126 $ilTabs->removeTab(
'pg');
128 case 'ildcleditviewdefinitiongui':
131 $this->ctrl->forwardCommand($edit_gui);
133 $ilTabs = $DIC[
'ilTabs'];
134 $ilTabs->removeTab(
'edit');
135 $ilTabs->removeTab(
'history');
136 $ilTabs->removeTab(
'clipboard');
137 $ilTabs->removeTab(
'pg');
142 if ($this->tableview->getId()) {
143 $this->ctrl->redirect($this,
'editGeneralSettings');
145 $this->ctrl->redirect($this,
'add');
150 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
152 case 'editGeneralSettings':
153 $settings_tpl =
new ilTemplate(
"tpl.dcl_settings.html",
true,
true,
'Modules/DataCollection');
155 $this->
setTabs(
'general_settings');
159 $f = $DIC->ui()->factory()->listing()->workflow();
160 $renderer = $DIC->ui()->renderer();
164 if (!is_null($view)) {
166 $step =
$f->step(
'',
'');
168 $f->step($this->lng->txt(
'dcl_view_settings'))
169 ->withAvailability($step::AVAILABLE)->withStatus($view->getStepVs() ? 3 : 4),
170 $f->step($this->lng->txt(
'dcl_create_entry_rules'))
171 ->withAvailability($step::AVAILABLE)->withStatus($view->getStepC() ? 3 : 4),
172 $f->step($this->lng->txt(
'dcl_edit_entry_rules'))
173 ->withAvailability($step::AVAILABLE)->withStatus($view->getStepE() ? 3 : 4),
174 $f->step($this->lng->txt(
'dcl_list_visibility_and_filter'))
175 ->withAvailability($step::AVAILABLE)->withStatus($view->getStepO() ? 3 : 4),
176 $f->step($this->lng->txt(
'dcl_detailed_view'))
177 ->withAvailability($step::AVAILABLE)->withStatus($view->getStepS() ? 3 : 1),
181 $wf =
$f->linear($this->lng->txt(
'dcl_view_configuration'),
$steps);
182 $settings_tpl->setVariable(
"WORKFLOW", $renderer->render($wf));
187 $settings_tpl->setVariable(
"SETTINGS", $ilDclTableViewEditFormGUI->getHTML());
189 $this->tpl->setContent($settings_tpl->get());
191 case 'editFieldSettings':
192 $this->
setTabs(
'field_settings');
194 $this->tpl->setContent($this->table_gui->getHTML());
207 $this->tabs_gui->addTab(
'general_settings', $this->lng->txt(
'dcl_view_settings'), $this->ctrl->getLinkTarget($this,
'editGeneralSettings'));
208 $this->tabs_gui->addTab(
'create_view', $this->lng->txt(
'dcl_create_entry_rules'), $this->ctrl->getLinkTargetByClass(
'ilDclCreateViewDefinitionGUI',
'presentation'));
209 $this->tabs_gui->addTab(
'edit_view', $this->lng->txt(
'dcl_edit_entry_rules'), $this->ctrl->getLinkTargetByClass(
'ilDclEditViewDefinitionGUI',
'presentation'));
210 $this->tabs_gui->addTab(
'field_settings', $this->lng->txt(
'dcl_list_visibility_and_filter'), $this->ctrl->getLinkTarget($this,
'editFieldSettings'));
211 $this->tabs_gui->addTab(
'detailed_view', $this->lng->txt(
'dcl_detailed_view'), $this->ctrl->getLinkTargetByClass(
'ilDclDetailedViewDefinitionGUI',
'edit'));
212 $this->tabs_gui->setTabActive($active);
222 $ilDclTableViewEditFormGUI->setValuesByPost();
223 if ($ilDclTableViewEditFormGUI->checkInput()) {
224 $ilDclTableViewEditFormGUI->updateTableView();
225 $this->ctrl->redirect($this,
'editGeneralSettings');
227 $this->
setTabs(
'general_settings');
228 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
239 $ilDclTableViewEditFormGUI->setValuesByPost();
240 if ($ilDclTableViewEditFormGUI->checkInput()) {
241 $ilDclTableViewEditFormGUI->createTableView();
242 $this->ctrl->redirect($this,
'editGeneralSettings');
244 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
252 public function saveTable()
257 foreach ($this->tableview->getFieldSettings() as $setting) {
259 foreach (array(
"Visible",
"InFilter",
"FilterChangeable") as $attribute) {
260 $key = $attribute .
'_' . $setting->getField();
261 $setting->{
'set' . $attribute}(
$_POST[$key] ==
'on');
265 $key =
'filter_' . $setting->getField();
266 if (
$_POST[$key] != null) {
267 $setting->setFilterValue(
$_POST[$key]);
268 } elseif (
$_POST[$key .
'_from'] != null &&
$_POST[$key .
'_to'] != null) {
269 $setting->setFilterValue(array(
"from" =>
$_POST[$key .
'_from'],
"to" =>
$_POST[$key .
'_to']));
271 $setting->setFilterValue(null);
279 if (!is_null($view)) {
280 $view->setStepO(
true);
284 ilUtil::sendSuccess($this->lng->txt(
'dcl_msg_tableview_updated'),
true);
285 $this->ctrl->saveParameter($this->parent_obj,
'tableview_id');
286 $this->ctrl->redirect($this,
'editFieldSettings');
296 $this->table_gui =
$table;
305 $this->ctrl->setParameter($this->parent_obj,
'table_id', $this->table->getId());
306 $this->ctrl->redirect($this->parent_obj);
316 $this->parent_obj->checkViewsLeft(1);
319 $conf->setFormAction($this->ctrl->getFormAction($this));
320 $conf->setHeaderText($this->lng->txt(
'dcl_tableview_confirm_delete'));
322 $conf->addItem(
'tableview_id', (
int) $this->tableview->getId(), $this->tableview->getTitle());
324 $conf->setConfirm($this->lng->txt(
'delete'),
'delete');
325 $conf->setCancel($this->lng->txt(
'cancel'),
'cancel');
327 $this->tpl->setContent($conf->getHTML());
331 protected function delete()
333 $this->tableview->delete();
334 $this->table->sortTableViews();
335 ilUtil::sendSuccess($this->lng->txt(
'dcl_msg_tableview_deleted'),
true);
357 if (in_array($cmd, [
'add',
'create'])) {
359 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
360 $this->table->getId()
363 return ilObjDataCollectionAccess::hasAccessTo(
364 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
365 $this->table->getId(),
366 $this->tableview->getId()
375 $new_tableview->setTableId($this->table->getId());
376 $new_tableview->cloneStructure($this->tableview, array());
377 $this->table->sortTableViews();
378 ilUtil::sendSuccess($this->lng->txt(
"dcl_tableview_copy"),
true);
Class ilDclTableViewEditGUI.
__construct(ilDclTableViewGUI $parent_obj, ilDclTable $table, ilDclTableView $tableview)
ilDclTableViewEditGUI constructor.
Class ilDclCreateViewDefinitionGUI.
Class ilDclEditViewDefinitionGUI.
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.