ILIAS  release_8 Revision v8.25-1-g13de6a5eca6
ilDclTableViewEditGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilDclTableViewEditGUI:

Public Member Functions

 __construct (ilDclTableViewGUI $parent_obj, ilDclTable $table, ilDclTableView $tableview)
 
 executeCommand ()
 
 update ()
 
 create ()
 
 confirmDelete ()
 
 permissionDenied ()
 
 copy ()
 

Data Fields

ilDclTableView $tableview
 
ilDclTable $table
 

Protected Member Functions

 setTabs (string $active)
 
 initTableGUI ()
 
 cancel ()
 
 delete ()
 
 checkAccess (string $cmd)
 

Protected Attributes

ilDclTableViewGUI $parent_obj
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilGlobalPageTemplate $tpl
 
ilPropertyFormGUI $form
 
ilDclTableViewEditFieldsTableGUI $table_gui
 
ilTabsGUI $tabs_gui
 
ILIAS HTTP Services $http
 
ILIAS Refinery Factory $refinery
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning @ilCtrl_Calls ilDclTableViewEditGUI: ilDclDetailedViewDefinitionGUI @ilCtrl_Calls ilDclTableViewEditGUI: ilDclCreateViewDefinitionGUI @ilCtrl_Calls ilDclTableViewEditGUI: ilDclEditViewDefinitionGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

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

39 {
40 global $DIC;
41 $lng = $DIC['lng'];
42 $ilCtrl = $DIC['ilCtrl'];
43 $tpl = $DIC['tpl'];
44 $ilTabs = $DIC['ilTabs'];
45 $locator = $DIC['ilLocator'];
46 $this->table = $table;
47 $this->tpl = $tpl;
48 $this->lng = $lng;
49 $this->ctrl = $ilCtrl;
50 $this->parent_obj = $parent_obj;
51 $this->tableview = $tableview;
52 $this->tabs_gui = $ilTabs;
53 $this->http = $DIC->http();
54 $this->refinery = $DIC->refinery();
55
56 $this->ctrl->saveParameterByClass('ilDclTableEditGUI', 'table_id');
57 $this->ctrl->saveParameter($this, 'tableview_id');
58 if ($this->tableview->getTitle()) {
59 $locator->addItem($this->tableview->getTitle(), $this->ctrl->getLinkTarget($this, 'show'));
60 }
61 $this->tpl->setLocator();
62 }
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.

References $DIC, $lng, $parent_obj, $table, $tableview, $tpl, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ cancel()

ilDclTableViewEditGUI::cancel ( )
protected

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ checkAccess()

ilDclTableViewEditGUI::checkAccess ( string  $cmd)
protected

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

345 : bool
346 {
347 if (in_array($cmd, ['add', 'create'])) {
349 $this->parent_obj->getParentObj()->getDataCollectionObject()->getRefId(),
350 $this->table->getId()
351 );
352 } else {
353 return ilObjDataCollectionAccess::hasAccessTo(
354 $this->parent_obj->getParentObj()->getDataCollectionObject()->getRefId(),
355 $this->table->getId(),
356 $this->tableview->getId()
357 );
358 }
359 }
static hasAccessToEditTable(int $ref_id, int $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 311 of file class.ilDclTableViewEditGUI.php.

311 : void
312 {
313 //at least one view must exist
314 $this->parent_obj->checkViewsLeft(1);
315
316 $conf = new ilConfirmationGUI();
317 $conf->setFormAction($this->ctrl->getFormAction($this));
318 $conf->setHeaderText($this->lng->txt('dcl_tableview_confirm_delete'));
319
320 $conf->addItem('tableview_id', (int) $this->tableview->getId(), $this->tableview->getTitle());
321
322 $conf->setConfirm($this->lng->txt('delete'), 'delete');
323 $conf->setCancel($this->lng->txt('cancel'), 'cancel');
324
325 $this->tpl->setContent($conf->getHTML());
326 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ copy()

ilDclTableViewEditGUI::copy ( )

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

361 : void
362 {
363 $new_tableview = new ilDclTableView();
364 $new_tableview->setTableId($this->table->getId());
365 $new_tableview->cloneStructure($this->tableview, array());
366 $this->table->sortTableViews();
367 $this->tpl->setOnScreenMessage('success', $this->lng->txt("dcl_tableview_copy"), true);
368 $this->cancel();
369 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ create()

ilDclTableViewEditGUI::create ( )

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

231 : void
232 {
233 $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview, $this->table);
234 $ilDclTableViewEditFormGUI->setValuesByPost();
235 if ($ilDclTableViewEditFormGUI->checkInput()) {
236 $ilDclTableViewEditFormGUI->createTableView();
237 $this->ctrl->redirect($this, 'editGeneralSettings');
238 } else {
239 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
240 }
241 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ delete()

ilDclTableViewEditGUI::delete ( )
protected

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

328 : void
329 {
330 $this->tableview->delete();
331 $this->table->sortTableViews();
332 $this->tpl->setOnScreenMessage('success', $this->lng->txt('dcl_msg_tableview_deleted'), true);
333 $this->cancel();
334 }

References ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ executeCommand()

ilDclTableViewEditGUI::executeCommand ( )

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

64 : void
65 {
66 $cmd = $this->ctrl->getCmd('show');
67 $next_class = $this->ctrl->getNextClass($this);
68
69 if (!$this->checkAccess($cmd)) {
70 $this->permissionDenied();
71 }
72
73 $this->tabs_gui->clearTargets();
74 $this->tabs_gui->clearSubTabs();
75 $this->tabs_gui->setBackTarget(
76 $this->lng->txt('dcl_tableviews'),
77 $this->ctrl->getLinkTarget($this->parent_obj)
78 );
79 $this->tabs_gui->setBack2Target(
80 $this->lng->txt('dcl_tables'),
81 $this->ctrl->getLinkTarget($this->parent_obj->getParentObj())
82 );
83
84 switch ($next_class) {
85 case 'ildcldetailedviewdefinitiongui':
86 $this->setTabs('detailed_view');
87 $recordedit_gui = new ilDclDetailedViewDefinitionGUI($this->tableview->getId());
88 $ret = $this->ctrl->forwardCommand($recordedit_gui);
89 if ($ret != "") {
90 $this->tpl->setContent($ret);
91 }
92 global $DIC;
93 $ilTabs = $DIC['ilTabs'];
94 $ilTabs->removeTab('edit');
95 $ilTabs->removeTab('history');
96 $ilTabs->removeTab('clipboard'); // Fixme
97 $ilTabs->removeTab('pg');
98 break;
99 case 'ildclcreateviewdefinitiongui':
100 $this->setTabs('create_view');
101 $creation_gui = new ilDclCreateViewDefinitionGUI($this->tableview->getId());
102 $this->ctrl->forwardCommand($creation_gui);
103 global $DIC;
104 $ilTabs = $DIC['ilTabs'];
105 $ilTabs->removeTab('edit');
106 $ilTabs->removeTab('history');
107 $ilTabs->removeTab('clipboard'); // Fixme
108 $ilTabs->removeTab('pg');
109 break;
110 case 'ildcleditviewdefinitiongui':
111 $this->setTabs('edit_view');
112 $edit_gui = new ilDclEditViewDefinitionGUI($this->tableview->getId());
113 $this->ctrl->forwardCommand($edit_gui);
114 global $DIC;
115 $ilTabs = $DIC['ilTabs'];
116 $ilTabs->removeTab('edit');
117 $ilTabs->removeTab('history');
118 $ilTabs->removeTab('clipboard'); // Fixme
119 $ilTabs->removeTab('pg');
120 break;
121 default:
122 switch ($cmd) {
123 case 'show':
124 if ($this->tableview->getId()) {
125 $this->ctrl->redirect($this, 'editGeneralSettings');
126 } else {
127 $this->ctrl->redirect($this, 'add');
128 }
129 break;
130 case 'add':
131 $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
132 $this->tpl->setContent($ilDclTableViewEditFormGUI->getHTML());
133 break;
134 case 'editGeneralSettings':
135 $settings_tpl = new ilTemplate("tpl.dcl_settings.html", true, true, 'Modules/DataCollection');
136
137 $this->setTabs('general_settings');
138 $ilDclTableViewEditFormGUI = new ilDclTableViewEditFormGUI($this, $this->tableview);
139
140 global $DIC;
141 $f = $DIC->ui()->factory()->listing()->workflow();
142 $renderer = $DIC->ui()->renderer();
143
144 // Set Workflow flag to true
145 $view = ilDclTableView::getCollection()->where(array("id" => filter_input(
146 INPUT_GET,
147 "tableview_id"
148 )
149 ))->first();
150 if (!is_null($view)) {
151 //setup steps
152 $step = $f->step('', '');
153 $steps = [
154 $f->step($this->lng->txt('dcl_view_settings'))
155 ->withAvailability($step::AVAILABLE)->withStatus(4), //$view->getStepVs() ? 3 : 4
156 $f->step($this->lng->txt('dcl_create_entry_rules'))
157 ->withAvailability($step::AVAILABLE)->withStatus(4), //$view->getStepC() ? 3 : 4
158 $f->step($this->lng->txt('dcl_edit_entry_rules'))
159 ->withAvailability($step::AVAILABLE)->withStatus(4), //$view->getStepE() ? 3 : 4
160 $f->step($this->lng->txt('dcl_list_visibility_and_filter'))
161 ->withAvailability($step::AVAILABLE)->withStatus(4), //$view->getStepO() ? 3 : 4
162 $f->step($this->lng->txt('dcl_detailed_view'))
163 ->withAvailability($step::AVAILABLE)->withStatus(1), //$view->getStepS() ? 3 : 1
164 ];
165
166 //setup linear workflow
167 $wf = $f->linear($this->lng->txt('dcl_view_configuration'), $steps);
168 $settings_tpl->setVariable("WORKFLOW", $renderer->render($wf));
169 }
170
171 $settings_tpl->setVariable("SETTINGS", $ilDclTableViewEditFormGUI->getHTML());
172
173 $this->tpl->setContent($settings_tpl->get());
174 break;
175 case 'editFieldSettings':
176 $this->setTabs('field_settings');
177 $this->initTableGUI();
178 $this->tpl->setContent($this->table_gui->getHTML());
179 break;
180 default:
181 $this->$cmd();
182 break;
183 }
184 break;
185 }
186 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
$steps
Definition: latex.php:3

References $DIC, Vendor\Package\$f, $steps, checkAccess(), ILIAS\Repository\ctrl(), ActiveRecord\getCollection(), initTableGUI(), ILIAS\Repository\lng(), permissionDenied(), and setTabs().

+ Here is the call graph for this function:

◆ initTableGUI()

ilDclTableViewEditGUI::initTableGUI ( )
protected

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

299 : void
300 {
302 $this->table_gui = $table;
303 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ permissionDenied()

ilDclTableViewEditGUI::permissionDenied ( )

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

336 : void
337 {
338 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('permission_denied'), true);
339 $this->ctrl->redirectByClass(
340 [ilObjDataCollectionGUI::class, ilDclRecordListGUI::class],
342 );
343 }

References ilDclRecordListGUI\CMD_LIST_RECORDS, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by executeCommand().

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

◆ setTabs()

ilDclTableViewEditGUI::setTabs ( string  $active)
protected

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

188 : void
189 {
190 $this->tabs_gui->addTab(
191 'general_settings',
192 $this->lng->txt('dcl_view_settings'),
193 $this->ctrl->getLinkTarget($this, 'editGeneralSettings')
194 );
195 $this->tabs_gui->addTab(
196 'create_view',
197 $this->lng->txt('dcl_create_entry_rules'),
198 $this->ctrl->getLinkTargetByClass('ilDclCreateViewDefinitionGUI', 'presentation')
199 );
200 $this->tabs_gui->addTab(
201 'edit_view',
202 $this->lng->txt('dcl_edit_entry_rules'),
203 $this->ctrl->getLinkTargetByClass('ilDclEditViewDefinitionGUI', 'presentation')
204 );
205 $this->tabs_gui->addTab(
206 'field_settings',
207 $this->lng->txt('dcl_list_visibility_and_filter'),
208 $this->ctrl->getLinkTarget($this, 'editFieldSettings')
209 );
210 $this->tabs_gui->addTab(
211 'detailed_view',
212 $this->lng->txt('dcl_detailed_view'),
213 $this->ctrl->getLinkTargetByClass('ilDclDetailedViewDefinitionGUI', 'edit')
214 );
215 $this->tabs_gui->setTabActive($active);
216 }

References ILIAS\Repository\lng().

Referenced by executeCommand(), and update().

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

◆ update()

ilDclTableViewEditGUI::update ( )

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

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

References ILIAS\Repository\ctrl(), and setTabs().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilDclTableViewEditGUI::$ctrl
protected

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

◆ $form

ilPropertyFormGUI ilDclTableViewEditGUI::$form
protected

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

◆ $http

ILIAS HTTP Services ilDclTableViewEditGUI::$http
protected

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

◆ $lng

ilLanguage ilDclTableViewEditGUI::$lng
protected

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

Referenced by __construct().

◆ $parent_obj

ilDclTableViewGUI ilDclTableViewEditGUI::$parent_obj
protected

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

Referenced by __construct().

◆ $refinery

ILIAS Refinery Factory ilDclTableViewEditGUI::$refinery
protected

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

◆ $table

ilDclTable ilDclTableViewEditGUI::$table

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

Referenced by __construct().

◆ $table_gui

ilDclTableViewEditFieldsTableGUI ilDclTableViewEditGUI::$table_gui
protected

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

◆ $tableview

ilDclTableView ilDclTableViewEditGUI::$tableview

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

Referenced by __construct().

◆ $tabs_gui

ilTabsGUI ilDclTableViewEditGUI::$tabs_gui
protected

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

◆ $tpl

ilGlobalPageTemplate ilDclTableViewEditGUI::$tpl
protected

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

Referenced by __construct().


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