ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilWorkflowEngineDefinitionsGUI Class Reference

Class ilWorkflowEngineDefinitionsGUI. More...

+ Collaboration diagram for ilWorkflowEngineDefinitionsGUI:

Public Member Functions

 __construct (ilObjWorkflowEngineGUI $parent_gui, \ILIAS\DI\Container $dic=null)
 ilWorkflowEngineDefinitionsGUI constructor. More...
 
 handle ($command)
 Handle the command given. More...
 
 showDefinitionsTable ()
 
 applyFilter ()
 
 resetFilter ()
 
 showUploadForm ()
 
 initToolbar ()
 
 stopListening ()
 
 deleteDefinition ()
 
 confirmDeleteDefinition ()
 

Protected Member Functions

 processUploadFormCancellation ()
 

Protected Attributes

 $parent_gui
 
 $dic
 

Private Member Functions

 ensureProcessIdInRequest ()
 
 getProcessIdFromRequest ()
 

Detailed Description

Class ilWorkflowEngineDefinitionsGUI.

Author
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

/

Definition at line 13 of file class.ilWorkflowEngineDefinitionsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilWorkflowEngineDefinitionsGUI::__construct ( ilObjWorkflowEngineGUI  $parent_gui,
\ILIAS\DI\Container  $dic = null 
)

ilWorkflowEngineDefinitionsGUI constructor.

Parameters
ilObjWorkflowEngineGUI$parent_gui

ILIAS\DI\Container|$dic $dic

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

30 {
31 $this->parent_gui = $parent_gui;
32
33 if ($dic === null) {
34 $dic = $GLOBALS['DIC'];
35 }
36 $this->dic = $dic;
37 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64

References $dic, $GLOBALS, and $parent_gui.

Member Function Documentation

◆ applyFilter()

ilWorkflowEngineDefinitionsGUI::applyFilter ( )
Returns
string HTML

Definition at line 111 of file class.ilWorkflowEngineDefinitionsGUI.php.

112 {
113 require_once './Services/WorkflowEngine/classes/administration/class.ilWorkflowEngineDefinitionsTableGUI.php';
114 $table_gui = new ilWorkflowEngineDefinitionsTableGUI($this->parent_gui, 'definitions.view');
115 $table_gui->writeFilterToSession();
116 $table_gui->resetOffset();
117
118 return $this->showDefinitionsTable();
119 }

References showDefinitionsTable().

Referenced by handle().

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

◆ confirmDeleteDefinition()

ilWorkflowEngineDefinitionsGUI::confirmDeleteDefinition ( )
Returns
string

Definition at line 487 of file class.ilWorkflowEngineDefinitionsGUI.php.

488 {
490
491 $processId = $this->getProcessIdFromRequest();
492
493 require_once 'Services/WorkflowEngine/classes/administration/class.ilWorkflowDefinitionRepository.php';
494 $repository = new ilWorkflowDefinitionRepository(
495 $this->dic->database(),
496 $this->dic->filesystem(),
498 );
499 $processDefinition = $repository->getById($processId);
500
501 require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
502 $confirmation = new ilConfirmationGUI();
503 $confirmation->addItem('process_id[]', $processDefinition['id'], $processDefinition['title']);
504 $this->parent_gui->ilCtrl->setParameter($this->parent_gui, 'process_id', $processDefinition['id']);
505 $confirmation->setFormAction($this->parent_gui->ilCtrl->getFormAction($this->parent_gui, 'definitions.view'));
506 $confirmation->setHeaderText($this->parent_gui->lng->txt('wfe_sure_to_delete_process_def'));
507 $confirmation->setConfirm($this->parent_gui->lng->txt('confirm'), 'definitions.delete');
508 $confirmation->setCancel($this->parent_gui->lng->txt('cancel'), 'definitions.view');
509
510 return $confirmation->getHTML();
511 }
Confirmation screen class.
static getRepositoryDir($relative=false)
Class ilWorkflowDefinitionRepository.

References ensureProcessIdInRequest(), getProcessIdFromRequest(), and ilObjWorkflowEngine\getRepositoryDir().

Referenced by handle().

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

◆ deleteDefinition()

ilWorkflowEngineDefinitionsGUI::deleteDefinition ( )
Returns
void

Definition at line 460 of file class.ilWorkflowEngineDefinitionsGUI.php.

461 {
463
464 $processId = $this->getProcessIdFromRequest();
465
466 $pathToProcessPhpFile = ilObjWorkflowEngine::getRepositoryDir() . '/' . $processId . '.php';
467 $pathToProcessBpmn2File = ilObjWorkflowEngine::getRepositoryDir() . '/' . $processId . '.bpmn2';
468
469 if (file_exists($pathToProcessPhpFile)) {
470 unlink($pathToProcessPhpFile);
471 }
472 if (file_exists($pathToProcessBpmn2File)) {
473 unlink($pathToProcessBpmn2File);
474 }
475
476 ilUtil::sendSuccess($this->parent_gui->lng->txt('definition_deleted'), true);
478 html_entity_decode(
479 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui, 'definitions.view')
480 )
481 );
482 }
static redirect($a_script)

References ensureProcessIdInRequest(), getProcessIdFromRequest(), ilObjWorkflowEngine\getRepositoryDir(), and ilUtil\redirect().

Referenced by handle().

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

◆ ensureProcessIdInRequest()

ilWorkflowEngineDefinitionsGUI::ensureProcessIdInRequest ( )
private

Definition at line 439 of file class.ilWorkflowEngineDefinitionsGUI.php.

440 {
441 if (!isset($this->dic->http()->request()->getQueryParams()['process_id'])) {
442 ilUtil::sendInfo($this->parent_gui->lng->txt('wfe_request_missing_process_id'));
443 $this->parent_gui->ilCtrl->redirect($this->parent_gui, 'definitions.view');
444 }
445 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References ilUtil\sendInfo().

Referenced by confirmDeleteDefinition(), and deleteDefinition().

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

◆ getProcessIdFromRequest()

ilWorkflowEngineDefinitionsGUI::getProcessIdFromRequest ( )
private
Returns
string

Definition at line 450 of file class.ilWorkflowEngineDefinitionsGUI.php.

451 {
452 $processId = str_replace(['\\', '/'], '', stripslashes($this->dic->http()->request()->getQueryParams()['process_id']));
453
454 return basename($processId);
455 }

Referenced by confirmDeleteDefinition(), and deleteDefinition().

+ Here is the caller graph for this function:

◆ handle()

ilWorkflowEngineDefinitionsGUI::handle (   $command)

Handle the command given.

Parameters
string$command
Returns
string HTML

Definition at line 46 of file class.ilWorkflowEngineDefinitionsGUI.php.

47 {
48 switch (strtolower($command)) {
49 case 'uploadform':
50 return $this->showUploadForm();
51 break;
52
53 case 'upload':
54 return $this->handleUploadSubmit();
55 break;
56
57 case 'applyfilter':
58 return $this->applyFilter();
59 break;
60
61 case 'resetfilter':
62 return $this->resetFilter();
63 break;
64
65 case 'start':
66 return $this->startProcess();
67 break;
68
69 case 'delete':
70 return $this->deleteDefinition();
71 break;
72
73 case 'confirmdelete':
74 return $this->confirmDeleteDefinition();
75 break;
76
77 case 'startlistening':
78 return $this->startListening();
79 break;
80
81 case'stoplistening':
82 return $this->stopListening();
83 break;
84
85 case 'view':
86 default:
87 return $this->showDefinitionsTable();
88 }
89 }

References applyFilter(), confirmDeleteDefinition(), deleteDefinition(), resetFilter(), showDefinitionsTable(), showUploadForm(), and stopListening().

+ Here is the call graph for this function:

◆ initToolbar()

ilWorkflowEngineDefinitionsGUI::initToolbar ( )
Returns
void

Definition at line 257 of file class.ilWorkflowEngineDefinitionsGUI.php.

258 {
259 require_once './Services/UIComponent/Button/classes/class.ilLinkButton.php';
260 $upload_wizard_button = ilLinkButton::getInstance();
261 $upload_wizard_button->setCaption($this->parent_gui->lng->txt('upload_process'), false);
262 $upload_wizard_button->setUrl(
263 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui, 'definitions.uploadform')
264 );
265 $this->parent_gui->ilToolbar->addButtonInstance($upload_wizard_button);
266 }
static getInstance()
Factory.

References ilLinkButton\getInstance().

Referenced by showDefinitionsTable().

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

◆ processUploadFormCancellation()

ilWorkflowEngineDefinitionsGUI::processUploadFormCancellation ( )
protected
Returns
void

Definition at line 271 of file class.ilWorkflowEngineDefinitionsGUI.php.

272 {
273 if (isset($_POST['cmd']['cancel'])) {
274 ilUtil::sendInfo($this->parent_gui->lng->txt('action_aborted'), true);
276 html_entity_decode(
277 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui, 'definitions.view')
278 )
279 );
280 }
281 }
$_POST["username"]

References $_POST, ilUtil\redirect(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ resetFilter()

ilWorkflowEngineDefinitionsGUI::resetFilter ( )
Returns
string HTML

Definition at line 124 of file class.ilWorkflowEngineDefinitionsGUI.php.

125 {
126 require_once './Services/WorkflowEngine/classes/administration/class.ilWorkflowEngineDefinitionsTableGUI.php';
127 $table_gui = new ilWorkflowEngineDefinitionsTableGUI($this->parent_gui, 'definitions.view');
128 $table_gui->resetOffset();
129 $table_gui->resetFilter();
130
131 return $this->showDefinitionsTable();
132 }

References showDefinitionsTable().

Referenced by handle().

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

◆ showDefinitionsTable()

ilWorkflowEngineDefinitionsGUI::showDefinitionsTable ( )
Returns
string HTML

Definition at line 94 of file class.ilWorkflowEngineDefinitionsGUI.php.

95 {
96 if ($this->dic->rbac()->system()->checkAccess('write', $_GET['ref_id'])) {
97 $this->initToolbar();
98 }
99 require_once './Services/WorkflowEngine/classes/administration/class.ilWorkflowEngineDefinitionsTableGUI.php';
100 $table_gui = new ilWorkflowEngineDefinitionsTableGUI($this->parent_gui, 'definitions.view');
101 $table_gui->setFilterCommand("definitions.applyfilter");
102 $table_gui->setResetCommand("definitions.resetFilter");
103 $table_gui->setDisableFilterHiding(false);
104
105 return $table_gui->getHTML();
106 }
$_GET["client_id"]

References $_GET, and initToolbar().

Referenced by applyFilter(), handle(), and resetFilter().

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

◆ showUploadForm()

ilWorkflowEngineDefinitionsGUI::showUploadForm ( )
Returns
string

Definition at line 137 of file class.ilWorkflowEngineDefinitionsGUI.php.

138 {
139 require_once './Services/WorkflowEngine/classes/administration/class.ilUploadDefinitionForm.php';
140 $form_definition = new ilUploadDefinitionForm();
141 $form = $form_definition->getForm(
142 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui, 'definitions.upload')
143 );
144
145 return $form->getHTML();
146 }
@noinspection PhpIncludeInspection

Referenced by handle().

+ Here is the caller graph for this function:

◆ stopListening()

ilWorkflowEngineDefinitionsGUI::stopListening ( )

Definition at line 348 of file class.ilWorkflowEngineDefinitionsGUI.php.

349 {
350 $process_id = ilUtil::stripSlashes($_GET['process_id']);
351
352 require_once './Services/WorkflowEngine/classes/utils/class.ilWorkflowDbHelper.php';
353 ilWorkflowDbHelper::deleteStartEventData($process_id);
354
355 ilUtil::sendSuccess($this->parent_gui->lng->txt('wfe_stopped_listening'), true);
357 html_entity_decode(
358 $this->parent_gui->ilCtrl->getLinkTarget($this->parent_gui, 'definitions.view')
359 )
360 );
361 }
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_GET, ilUtil\redirect(), and ilUtil\stripSlashes().

Referenced by handle().

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

Field Documentation

◆ $dic

ilWorkflowEngineDefinitionsGUI::$dic
protected

Definition at line 21 of file class.ilWorkflowEngineDefinitionsGUI.php.

Referenced by __construct().

◆ $parent_gui

ilObjWorkflowEngineGUI ilWorkflowEngineDefinitionsGUI::$parent_gui
protected

Definition at line 16 of file class.ilWorkflowEngineDefinitionsGUI.php.

Referenced by __construct().


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