ILIAS  release_7 Revision v7.30-3-g800a261c036
ilDclTableViewEditGUI Class Reference

Class ilDclTableViewEditGUI. More...

+ Collaboration diagram for ilDclTableViewEditGUI:

Public Member Functions

 __construct (ilDclTableViewGUI $parent_obj, ilDclTable $table, ilDclTableView $tableview)
 ilDclTableViewEditGUI constructor. More...
 
 executeCommand ()
 execute command More...
 
 update ()
 
 create ()
 
 confirmDelete ()
 
 permissionDenied ()
 
 copy ()
 

Data Fields

 $tableview
 
 $table
 

Protected Member Functions

 setTabs ($active)
 
 initTableGUI ()
 
 cancel ()
 return to overview More...
 
 delete ()
 
 checkAccess ($cmd)
 

Protected Attributes

 $parent_obj
 
 $ctrl
 
 $lng
 
 $tpl
 
 $form
 
 $table_gui
 
 $tabs_gui
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilDclTableViewEditGUI::__construct ( ilDclTableViewGUI  $parent_obj,
ilDclTable  $table,
ilDclTableView  $tableview 
)

ilDclTableViewEditGUI constructor.

Parameters
ilDclTableViewGUI$parent_obj
ilDclTable$table

Definition at line 60 of file class.ilDclTableViewEditGUI.php.

61 {
62 global $DIC;
63 $lng = $DIC['lng'];
64 $ilCtrl = $DIC['ilCtrl'];
65 $tpl = $DIC['tpl'];
66 $ilTabs = $DIC['ilTabs'];
67 $locator = $DIC['ilLocator'];
68 $this->table = $table;
69 $this->tpl = $tpl;
70 $this->lng = $lng;
71 $this->ctrl = $ilCtrl;
72 $this->parent_obj = $parent_obj;
73 $this->tableview = $tableview;
74 $this->tabs_gui = $ilTabs;
75
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'));
80 }
81 $this->tpl->setLocator();
82 }
global $DIC
Definition: goto.php:24

References $DIC, $lng, $parent_obj, $table, $tableview, and $tpl.

Member Function Documentation

◆ cancel()

ilDclTableViewEditGUI::cancel ( )
protected

return to overview

Definition at line 303 of file class.ilDclTableViewEditGUI.php.

304 {
305 $this->ctrl->setParameter($this->parent_obj, 'table_id', $this->table->getId());
306 $this->ctrl->redirect($this->parent_obj);
307 }

◆ checkAccess()

ilDclTableViewEditGUI::checkAccess (   $cmd)
protected
Parameters
$cmd
Returns
bool

Definition at line 355 of file class.ilDclTableViewEditGUI.php.

356 {
357 if (in_array($cmd, ['add', 'create'])) {
359 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
360 $this->table->getId()
361 );
362 } else {
363 return ilObjDataCollectionAccess::hasAccessTo(
364 $this->parent_obj->parent_obj->getDataCollectionObject()->getRefId(),
365 $this->table->getId(),
366 $this->tableview->getId()
367 );
368 }
369 }
static hasAccessToEditTable($ref_id, $table_id)

References ilObjDataCollectionAccess\hasAccessToEditTable().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ confirmDelete()

ilDclTableViewEditGUI::confirmDelete ( )

Definition at line 313 of file class.ilDclTableViewEditGUI.php.

314 {
315 //at least one view must exist
316 $this->parent_obj->checkViewsLeft(1);
317
318 $conf = new ilConfirmationGUI();
319 $conf->setFormAction($this->ctrl->getFormAction($this));
320 $conf->setHeaderText($this->lng->txt('dcl_tableview_confirm_delete'));
321
322 $conf->addItem('tableview_id', (int) $this->tableview->getId(), $this->tableview->getTitle());
323
324 $conf->setConfirm($this->lng->txt('delete'), 'delete');
325 $conf->setCancel($this->lng->txt('cancel'), 'cancel');
326
327 $this->tpl->setContent($conf->getHTML());
328 }
Confirmation screen class.

◆ copy()

ilDclTableViewEditGUI::copy ( )

Definition at line 372 of file class.ilDclTableViewEditGUI.php.

373 {
374 $new_tableview = new ilDclTableView();
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);
379 $this->cancel();
380 }
Class ilDclTableView.

◆ create()

ilDclTableViewEditGUI::create ( )

Definition at line 236 of file class.ilDclTableViewEditGUI.php.

237 {
238 $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview, $this->table);
239 $ilDclTableViewEditFormGUI->setValuesByPost();
240 if ($ilDclTableViewEditFormGUI->checkInput()) {
241 $ilDclTableViewEditFormGUI->createTableView();
242 $this->ctrl->redirect($this, 'editGeneralSettings');
243 } else {
244 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
245 }
246 }
Class ilDclTableViewEditFormGUI.

◆ delete()

ilDclTableViewEditGUI::delete ( )
protected

Definition at line 331 of file class.ilDclTableViewEditGUI.php.

332 {
333 $this->tableview->delete();
334 $this->table->sortTableViews();
335 ilUtil::sendSuccess($this->lng->txt('dcl_msg_tableview_deleted'), true);
336 $this->cancel();
337 }

◆ executeCommand()

ilDclTableViewEditGUI::executeCommand ( )

execute command

Definition at line 88 of file class.ilDclTableViewEditGUI.php.

89 {
90 $cmd = $this->ctrl->getCmd('show');
91 $next_class = $this->ctrl->getNextClass($this);
92
93 if (!$this->checkAccess($cmd)) {
94 $this->permissionDenied();
95 }
96
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));
101
102 switch ($next_class) {
103 case 'ildcldetailedviewdefinitiongui':
104 $this->setTabs('detailed_view');
105 $recordedit_gui = new ilDclDetailedViewDefinitionGUI($this->tableview->getId());
106 $ret = $this->ctrl->forwardCommand($recordedit_gui);
107 if ($ret != "") {
108 $this->tpl->setContent($ret);
109 }
110 global $DIC;
111 $ilTabs = $DIC['ilTabs'];
112 $ilTabs->removeTab('edit');
113 $ilTabs->removeTab('history');
114 $ilTabs->removeTab('clipboard'); // Fixme
115 $ilTabs->removeTab('pg');
116 break;
117 case 'ildclcreateviewdefinitiongui':
118 $this->setTabs('create_view');
119 $creation_gui = new ilDclCreateViewDefinitionGUI($this->tableview->getId());
120 $this->ctrl->forwardCommand($creation_gui);
121 global $DIC;
122 $ilTabs = $DIC['ilTabs'];
123 $ilTabs->removeTab('edit');
124 $ilTabs->removeTab('history');
125 $ilTabs->removeTab('clipboard'); // Fixme
126 $ilTabs->removeTab('pg');
127 break;
128 case 'ildcleditviewdefinitiongui':
129 $this->setTabs('edit_view');
130 $edit_gui = new ilDclEditViewDefinitionGUI($this->tableview->getId());
131 $this->ctrl->forwardCommand($edit_gui);
132 global $DIC;
133 $ilTabs = $DIC['ilTabs'];
134 $ilTabs->removeTab('edit');
135 $ilTabs->removeTab('history');
136 $ilTabs->removeTab('clipboard'); // Fixme
137 $ilTabs->removeTab('pg');
138 break;
139 default:
140 switch ($cmd) {
141 case 'show':
142 if ($this->tableview->getId()) {
143 $this->ctrl->redirect($this, 'editGeneralSettings');
144 } else {
145 $this->ctrl->redirect($this, 'add');
146 }
147 break;
148 case 'add':
149 $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
150 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
151 break;
152 case 'editGeneralSettings':
153 $settings_tpl = new ilTemplate("tpl.dcl_settings.html", true, true, 'Modules/DataCollection');
154
155 $this->setTabs('general_settings');
156 $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
157
158 global $DIC;
159 $f = $DIC->ui()->factory()->listing()->workflow();
160 $renderer = $DIC->ui()->renderer();
161
162 // Set Workflow flag to true
163 $view = ilDclTableView::getCollection()->where(array("id" => filter_input(INPUT_GET, "tableview_id")))->first();
164 if (!is_null($view)) {
165 //setup steps
166 $step = $f->step('', '');
167 $steps = [
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),
178 ];
179
180 //setup linear workflow
181 $wf = $f->linear($this->lng->txt('dcl_view_configuration'), $steps);
182 $settings_tpl->setVariable("WORKFLOW", $renderer->render($wf));
183 }
184
185
186
187 $settings_tpl->setVariable("SETTINGS", $ilDclTableViewEditFormGUI->getHTML());
188
189 $this->tpl->setContent($settings_tpl->get());
190 break;
191 case 'editFieldSettings':
192 $this->setTabs('field_settings');
193 $this->initTableGUI();
194 $this->tpl->setContent($this->table_gui->getHTML());
195 break;
196 default:
197 $this->$cmd();
198 break;
199 }
200 break;
201 }
202 }
Class ilDclCreateViewDefinitionGUI.
Class ilDclDetailedViewDefinitionGUI.
Class ilDclEditViewDefinitionGUI.
special template class to simplify handling of ITX/PEAR
$steps
Definition: latex.php:3
$ret
Definition: parser.php:6

References $DIC, Vendor\Package\$f, $ret, $steps, checkAccess(), ActiveRecord\getCollection(), initTableGUI(), permissionDenied(), and setTabs().

+ Here is the call graph for this function:

◆ initTableGUI()

ilDclTableViewEditGUI::initTableGUI ( )
protected
Returns
ilDclTableViewEditFieldsTableGUI

Definition at line 293 of file class.ilDclTableViewEditGUI.php.

294 {
296 $this->table_gui = $table;
297 }
Class ilDclTableViewEditFieldsTableGUI.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ permissionDenied()

ilDclTableViewEditGUI::permissionDenied ( )

Definition at line 343 of file class.ilDclTableViewEditGUI.php.

344 {
345 ilUtil::sendFailure($this->lng->txt('permission_denied'), true);
346 $this->ctrl->redirectByClass([ilObjDataCollectionGUI::class, ilDclRecordListGUI::class], ilDclRecordListGUI::CMD_LIST_RECORDS);
347 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References ilDclRecordListGUI\CMD_LIST_RECORDS, and ilUtil\sendFailure().

Referenced by executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilDclTableViewEditGUI::setTabs (   $active)
protected

Definition at line 205 of file class.ilDclTableViewEditGUI.php.

206 {
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);
213 }

Referenced by executeCommand(), and update().

+ Here is the caller graph for this function:

◆ update()

ilDclTableViewEditGUI::update ( )

Definition at line 219 of file class.ilDclTableViewEditGUI.php.

220 {
221 $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
222 $ilDclTableViewEditFormGUI->setValuesByPost();
223 if ($ilDclTableViewEditFormGUI->checkInput()) {
224 $ilDclTableViewEditFormGUI->updateTableView();
225 $this->ctrl->redirect($this, 'editGeneralSettings');
226 } else {
227 $this->setTabs('general_settings');
228 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
229 }
230 }

References setTabs().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilDclTableViewEditGUI::$ctrl
protected

Definition at line 23 of file class.ilDclTableViewEditGUI.php.

◆ $form

ilDclTableViewEditGUI::$form
protected

Definition at line 39 of file class.ilDclTableViewEditGUI.php.

◆ $lng

ilDclTableViewEditGUI::$lng
protected

Definition at line 27 of file class.ilDclTableViewEditGUI.php.

Referenced by __construct().

◆ $parent_obj

ilDclTableViewEditGUI::$parent_obj
protected

Definition at line 19 of file class.ilDclTableViewEditGUI.php.

Referenced by __construct().

◆ $table

ilDclTableViewEditGUI::$table

Definition at line 51 of file class.ilDclTableViewEditGUI.php.

Referenced by __construct().

◆ $table_gui

ilDclTableViewEditGUI::$table_gui
protected

Definition at line 43 of file class.ilDclTableViewEditGUI.php.

◆ $tableview

ilDclTableViewEditGUI::$tableview

Definition at line 35 of file class.ilDclTableViewEditGUI.php.

Referenced by __construct().

◆ $tabs_gui

ilDclTableViewEditGUI::$tabs_gui
protected

Definition at line 47 of file class.ilDclTableViewEditGUI.php.

◆ $tpl

ilDclTableViewEditGUI::$tpl
protected

Definition at line 31 of file class.ilDclTableViewEditGUI.php.

Referenced by __construct().


The documentation for this class was generated from the following file: