ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilObjWorkflowEngineGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2016 ILIAS open source, Extended GPL, see docs/LICENSE */
3
5require_once './Services/Object/classes/class.ilObject2GUI.php';
7require_once './Services/WorkflowEngine/classes/class.ilWorkflowEngine.php';
8
22{
24 public $ilCtrl;
25
27 public $ilTabs;
28
30 public $lng;
31
33 public $tpl;
34
36 public $tree;
37
39 public $ilLocator;
40
42 public $ilToolbar;
43
47 protected $dic;
48
52 public function __construct()
53 {
54 global $DIC;
55
56 $this->ilTabs = $DIC['ilTabs'];
57 $this->lng = $DIC['lng'];
58 $this->lng->loadLanguageModule('wfe');
59 $this->ilCtrl = $DIC['ilCtrl'];
60 $this->tpl = $DIC['tpl'];
61 $this->tree = $DIC['tree'];
62 $this->ilLocator = $DIC['ilLocator'];
63 $this->ilToolbar = $DIC['ilToolbar'];
64 $this->dic = $DIC;
65
66 parent::__construct((int) $_GET['ref_id']);
67 $this->assignObject();
68 }
69
73 public function getType()
74 {
75 return null;
76 }
77
91 public static function _goto($params)
92 {
93 global $DIC;
95 $lng = $DIC['lng'];
96
97 $workflow = substr($params, 2, strpos($params, 'EVT') - 2);
98 $event = substr($params, strpos($params, 'EVT') + 3);
99
100 $type = 'endpoint_event';
101 $content = 'was_requested';
102 $subject_type = 'workflow';
103 $subject_id = $workflow;
104 $context_type = 'event';
105 $context_id = $event;
106
108 $engine->processEvent(
109 $type,
110 $content,
111 $subject_type,
112 $subject_id,
113 $context_type,
114 $context_id
115 );
116
117 ilUtil::sendSuccess($lng->txt('ok'), true);
118 ilUtil::redirect('ilias.php?baseClass=ilDashboardGUI');
119 }
120
121 public function executeCommand()
122 {
123 $next_class = $this->ilCtrl->getNextClass();
124
125 if ($next_class == '') {
126 $this->prepareAdminOutput();
127 $this->tpl->setContent($this->dispatchCommand($this->ilCtrl->getCmd('dashboard.view')));
128 return;
129 }
130
131 switch ($next_class) {
132 case 'ilpermissiongui':
133 $this->prepareAdminOutput();
134 $this->initTabs('permissions');
135 $this->ilTabs->setTabActive('perm_settings');
136 require_once 'Services/AccessControl/classes/class.ilPermissionGUI.php';
137 $perm_gui = new ilPermissionGUI($this);
138 $this->ctrl->forwardCommand($perm_gui);
139 break;
140 default:
141 $this->prepareAdminOutput();
142 $ilObjBibliographicAdminLibrariesGUI = new ilObjBibliographicAdminLibrariesGUI($this);
143 $this->ctrl->forwardCommand($ilObjBibliographicAdminLibrariesGUI);
144 break;
145 }
146 }
147
153 public function dispatchCommand($cmd)
154 {
155 $cmd_parts = explode('.', $cmd);
156
157 switch ($cmd_parts[0]) {
158 case 'definitions':
159 return $this->dispatchToDefinitions($cmd_parts[1]);
160
161 case 'instances':
162 return $this->dispatchToInstances($cmd_parts[1]);
163
164 case 'settings':
165 return $this->dispatchToSettings($cmd_parts[1]);
166
167 case 'dashboard':
168 return $this->dispatchToDashboard($cmd_parts[1]);
169
170 default:
171 return $this->dispatchToDefinitions($cmd_parts[0]);
172 }
173 }
174
178 public function prepareAdminOutput()
179 {
180 $this->tpl->loadStandardTemplate();
181
182 $this->tpl->setTitleIcon(ilUtil::getImagePath('icon_wfe.svg'));
183 $this->tpl->setTitle($this->object->getPresentationTitle());
184 $this->tpl->setDescription($this->object->getLongDescription());
185
186 $this->initLocator();
187 }
188
192 public function initTabs($section)
193 {
194 global $DIC;
196 $rbacsystem = $DIC['rbacsystem'];
197
198 /*
199 $this->ilTabs->addTab(
200 'dashboard',
201 $this->lng->txt('dashboard'),
202 $this->ilCtrl->getLinkTarget($this, 'dashboard.view')
203 );
204 */
205 if ($rbacsystem->checkAccess('visible,read', $this->object->getRefId())) {
206 $this->ilTabs->addTab(
207 'definitions',
208 $this->lng->txt('definitions'),
209 $this->ilCtrl->getLinkTarget($this, 'definitions.view')
210 );
211 $this->ilTabs->addTab(
212 'settings',
213 $this->lng->txt('settings'),
214 $this->ilCtrl->getLinkTarget($this, 'settings.view')
215 );
216 }
217 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
218 $this->ilTabs->addTab(
219 'perm_settings',
220 $this->lng->txt('perm_settings'),
221 $this->ilCtrl->getLinkTargetByClass(array('ilobjworkflowenginegui','ilpermissiongui'), 'perm')
222 );
223 }
224 /*
225 $this->ilTabs->addTab(
226 'instances',
227 $this->lng->txt('instances'),
228 $this->ilCtrl->getLinkTarget($this, 'instances.view')
229 );
230 */
231
232 $this->ilTabs->setTabActive($section);
233 }
234
238 public function initLocator()
239 {
240 $path = $this->tree->getPathFull((int) $_GET["ref_id"]);
241 array_shift($path);
242 foreach ((array) $path as $key => $row) {
243 if ($row["title"] == "Workflow Engine") {
244 $row["title"] = $this->lng->txt("obj_wfe");
245 }
246
247 $this->ilCtrl->setParameter($this, "ref_id", $row["child"]);
248 $this->ilLocator->addItem(
249 $row["title"],
250 $this->ilCtrl->getLinkTarget($this, "dashboard.view"),
251 ilFrameTargetInfo::_getFrame("MainContent"),
252 $row["child"]
253 );
254
255 $this->ilCtrl->setParameter($this, "ref_id", $_GET["ref_id"]);
256 }
257
258 $this->tpl->setLocator();
259 }
260
266 public function dispatchToDashboard($command)
267 {
268 $this->initTabs('dashboard');
270 require_once './Services/WorkflowEngine/classes/administration/class.ilWorkflowEngineDashboardGUI.php';
271 $target_handler = new ilWorkflowEngineDashboardGUI($this);
272 return $target_handler->handle($command);
273 }
274
280 public function dispatchToDefinitions($command)
281 {
282 $this->initTabs('definitions');
284 require_once './Services/WorkflowEngine/classes/administration/class.ilWorkflowEngineDefinitionsGUI.php';
285 $target_handler = new ilWorkflowEngineDefinitionsGUI($this, $this->dic);
286 return $target_handler->handle($command);
287 }
288
294 public function dispatchToInstances($command)
295 {
296 $this->initTabs('instances');
298 require_once './Services/WorkflowEngine/classes/administration/class.ilWorkflowEngineInstancesGUI.php';
299 $target_handler = new ilWorkflowEngineInstancesGUI($this);
300 return $target_handler->handle($command);
301 }
302
308 public function dispatchToSettings($command)
309 {
310 $this->initTabs('settings');
312 require_once './Services/WorkflowEngine/classes/administration/class.ilWorkflowEngineSettingsGUI.php';
313 $target_handler = new ilWorkflowEngineSettingsGUI($this);
314 return $target_handler->handle($command);
315 }
316}
$section
Definition: Utf8Test.php:83
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
This class provides processing control methods.
getCmd($a_default_cmd="", $a_safe_commands="")
Determines current get/post command.
getNextClass($a_gui_class=null)
Get next class in the control path from the current class to the target command class.
getLinkTarget( $a_gui_obj, $a_cmd="", $a_anchor="", $a_asynch=false, $xml_style=false)
Get link target for command using gui object.
setParameter($a_obj, $a_parameter, $a_value)
Set parameters that should be passed a form and link of a gui class.
static _getFrame($a_class, $a_type='')
Get content frame name.
@noinspection PhpIncludeInspection
__construct()
ilObjWorkflowEngineGUI constructor.
New implementation of ilObjectGUI.
assignObject()
create object instance as internal property (repository/workspace switch)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static redirect($a_script)
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilWorkflowEngineDashboardGUI.
Class ilWorkflowEngineDefinitionsGUI.
Class ilWorkflowEngineInstancesGUI.
Class ilWorkflowEngineSettingsGUI.
ilWorkflowEngine is part of the petri net based workflow engine.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$type
$engine
Definition: workflow.php:89
$DIC
Definition: xapitoken.php:46