76
.github/ISSUE_TEMPLATE/bug_report.md
vendored
76
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,38 +1,38 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
|
||||
40
.github/ISSUE_TEMPLATE/feature_request.md
vendored
40
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,20 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
<?php
|
||||
if (strpos($_SERVER['PHP_SELF'], "asynchronousdatas.php")) {
|
||||
$AJAX_INCLUDE = 1;
|
||||
define('GLPI_ROOT', '../../..');
|
||||
include (GLPI_ROOT."/inc/includes.php");
|
||||
Html::header_nocache();
|
||||
}
|
||||
|
||||
if (!defined('GLPI_ROOT')) {
|
||||
die("Can not access directly to this file");
|
||||
}
|
||||
|
||||
include_once dirname(__FILE__)."/../inc/crontaskaction.class.php";
|
||||
if (isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD']=='OPTIONS') {
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Access-Control-Allow-Methods: POST");
|
||||
header("Access-Control-Allow-Headers: Content-Type");
|
||||
} else {
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Content-Type: application/json; charset=UTF-8");
|
||||
|
||||
if (isset($_SERVER['REQUEST_METHOD'])) {
|
||||
switch ($_SERVER['REQUEST_METHOD']) {
|
||||
case 'POST' :
|
||||
$request_body = file_get_contents('php://input');
|
||||
$datas = json_decode($request_body, true);
|
||||
|
||||
$asyncdata = new PluginProcessmakerCrontaskaction;
|
||||
if (isset($datas['id']) && $asyncdata->getFromDB( $datas['id'] ) && $asyncdata->fields['state'] == PluginProcessmakerCrontaskaction::WAITING_DATA) {
|
||||
$initialdatas = json_decode($asyncdata->fields['postdata'], true);
|
||||
$initialdatas['form'] = array_merge( $initialdatas['form'], $datas['form'] );
|
||||
$postdata = json_encode($initialdatas, JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE);
|
||||
$asyncdata->update( [ 'id' => $datas['id'], 'state' => PluginProcessmakerCrontaskaction::DATA_READY, 'postdata' => $postdata ] );
|
||||
$ret = [ 'code' => '0', 'message' => 'Done' ];
|
||||
} else {
|
||||
$ret = [ 'code' => '2', 'message' => 'Case is not existing, or state is not WAITING_DATA' ];
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
$ret = [ 'code' => '1', 'message' => 'Method '.$_SERVER['REQUEST_METHOD'].' not supported' ];
|
||||
}
|
||||
|
||||
echo json_encode( $ret, JSON_HEX_APOS | JSON_HEX_QUOT );
|
||||
|
||||
}
|
||||
}
|
||||
<?php
|
||||
if (strpos($_SERVER['PHP_SELF'], "asynchronousdatas.php")) {
|
||||
$AJAX_INCLUDE = 1;
|
||||
define('GLPI_ROOT', '../../..');
|
||||
include (GLPI_ROOT."/inc/includes.php");
|
||||
Html::header_nocache();
|
||||
}
|
||||
|
||||
if (!defined('GLPI_ROOT')) {
|
||||
die("Can not access directly to this file");
|
||||
}
|
||||
|
||||
include_once dirname(__FILE__)."/../inc/crontaskaction.class.php";
|
||||
if (isset( $_SERVER['REQUEST_METHOD'] ) && $_SERVER['REQUEST_METHOD']=='OPTIONS') {
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Access-Control-Allow-Methods: POST");
|
||||
header("Access-Control-Allow-Headers: Content-Type");
|
||||
} else {
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Content-Type: application/json; charset=UTF-8");
|
||||
|
||||
if (isset($_SERVER['REQUEST_METHOD'])) {
|
||||
switch ($_SERVER['REQUEST_METHOD']) {
|
||||
case 'POST' :
|
||||
$request_body = file_get_contents('php://input');
|
||||
$datas = json_decode($request_body, true);
|
||||
|
||||
$asyncdata = new PluginProcessmakerCrontaskaction;
|
||||
if (isset($datas['id']) && $asyncdata->getFromDB( $datas['id'] ) && $asyncdata->fields['state'] == PluginProcessmakerCrontaskaction::WAITING_DATA) {
|
||||
$initialdatas = json_decode($asyncdata->fields['postdata'], true);
|
||||
$initialdatas['form'] = array_merge( $initialdatas['form'], $datas['form'] );
|
||||
$postdata = json_encode($initialdatas, JSON_HEX_APOS | JSON_HEX_QUOT | JSON_UNESCAPED_UNICODE);
|
||||
$asyncdata->update( [ 'id' => $datas['id'], 'state' => PluginProcessmakerCrontaskaction::DATA_READY, 'postdata' => $postdata ] );
|
||||
$ret = [ 'code' => '0', 'message' => 'Done' ];
|
||||
} else {
|
||||
$ret = [ 'code' => '2', 'message' => 'Case is not existing, or state is not WAITING_DATA' ];
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
$ret = [ 'code' => '1', 'message' => 'Method '.$_SERVER['REQUEST_METHOD'].' not supported' ];
|
||||
}
|
||||
|
||||
echo json_encode( $ret, JSON_HEX_APOS | JSON_HEX_QUOT );
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,89 +1,89 @@
|
||||
<?php
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Original Author of file: Olivier Moron
|
||||
// Purpose of file: to return list of processes which can be started by end-user
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
// Direct access to file
|
||||
if (strpos($_SERVER['PHP_SELF'], "dropdownProcesses.php")) {
|
||||
include ("../../../inc/includes.php");
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
Html::header_nocache();
|
||||
}
|
||||
|
||||
if (!defined('GLPI_ROOT')) {
|
||||
die("Can not access directly to this file");
|
||||
}
|
||||
|
||||
|
||||
Session::checkLoginUser();
|
||||
|
||||
if (isset($_REQUEST["entity_restrict"])
|
||||
&& !is_array($_REQUEST["entity_restrict"])
|
||||
&& (substr($_REQUEST["entity_restrict"], 0, 1) === '[')
|
||||
&& (substr($_REQUEST["entity_restrict"], -1) === ']')) {
|
||||
$_REQUEST["entity_restrict"] = json_decode($_REQUEST["entity_restrict"]);
|
||||
$_REQUEST["entity_restrict"] = $_REQUEST["entity_restrict"][0];
|
||||
}
|
||||
|
||||
// Security
|
||||
if (!($item = getItemForItemtype($_REQUEST['itemtype']))) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$one_item = -1;
|
||||
if (isset($_POST['_one_id'])) {
|
||||
$one_item = $_POST['_one_id'];
|
||||
}
|
||||
// Count real items returned
|
||||
$count = 0;
|
||||
|
||||
if (!isset($_REQUEST['emptylabel']) || ($_REQUEST['emptylabel'] == '')) {
|
||||
$_REQUEST['emptylabel'] = Dropdown::EMPTY_VALUE;
|
||||
}
|
||||
|
||||
$search="";
|
||||
if (!empty($_REQUEST['searchText'])) {
|
||||
$search = ['LIKE', Search::makeTextSearchValue($_REQUEST['searchText'])];
|
||||
}
|
||||
|
||||
$processes = [];
|
||||
|
||||
// Empty search text : display first
|
||||
if (empty($_REQUEST['searchText'])) {
|
||||
if ($_REQUEST['display_emptychoice']) {
|
||||
if (($one_item < 0) || ($one_item == 0)) {
|
||||
array_push($processes, ['id' => 0,
|
||||
'text' => $_REQUEST['emptylabel']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$processall = (isset($_REQUEST['specific_tags']['process_restrict']) && !$_REQUEST['specific_tags']['process_restrict']);
|
||||
$count_cases_per_item = isset($_REQUEST['specific_tags']['count_cases_per_item']) ? $_REQUEST['specific_tags']['count_cases_per_item'] : [];
|
||||
|
||||
$result = PluginProcessmakerProcess::getSqlSearchResult(false, $search);
|
||||
|
||||
//if ($DB->numrows($result)) {
|
||||
// while ($data = $DB->fetch_array($result)) {
|
||||
//if ($result->numrows()) {
|
||||
foreach ($result as $data) {
|
||||
$process_entities = PluginProcessmakerProcess::getEntitiesForProfileByProcess($data["id"], $_SESSION['glpiactiveprofile']['id'], true);
|
||||
$can_add = $data['max_cases_per_item'] == 0 || !isset($count_cases_per_item[$data["id"]]) || $count_cases_per_item[$data["id"]] < $data['max_cases_per_item'];
|
||||
if ($processall
|
||||
|| ($data['maintenance'] != 1
|
||||
&& in_array( $_REQUEST["entity_restrict"], $process_entities)
|
||||
&& $can_add) ) {
|
||||
|
||||
array_push( $processes, ['id' => $data["id"],
|
||||
'text' => $data["name"]
|
||||
]);
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
$ret['results'] = $processes;
|
||||
$ret['count'] = $count;
|
||||
echo json_encode($ret);
|
||||
<?php
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Original Author of file: Olivier Moron
|
||||
// Purpose of file: to return list of processes which can be started by end-user
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
// Direct access to file
|
||||
if (strpos($_SERVER['PHP_SELF'], "dropdownProcesses.php")) {
|
||||
include ("../../../inc/includes.php");
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
Html::header_nocache();
|
||||
}
|
||||
|
||||
if (!defined('GLPI_ROOT')) {
|
||||
die("Can not access directly to this file");
|
||||
}
|
||||
|
||||
|
||||
Session::checkLoginUser();
|
||||
|
||||
if (isset($_REQUEST["entity_restrict"])
|
||||
&& !is_array($_REQUEST["entity_restrict"])
|
||||
&& (substr($_REQUEST["entity_restrict"], 0, 1) === '[')
|
||||
&& (substr($_REQUEST["entity_restrict"], -1) === ']')) {
|
||||
$_REQUEST["entity_restrict"] = json_decode($_REQUEST["entity_restrict"]);
|
||||
$_REQUEST["entity_restrict"] = $_REQUEST["entity_restrict"][0];
|
||||
}
|
||||
|
||||
// Security
|
||||
if (!($item = getItemForItemtype($_REQUEST['itemtype']))) {
|
||||
exit();
|
||||
}
|
||||
|
||||
$one_item = -1;
|
||||
if (isset($_POST['_one_id'])) {
|
||||
$one_item = $_POST['_one_id'];
|
||||
}
|
||||
// Count real items returned
|
||||
$count = 0;
|
||||
|
||||
if (!isset($_REQUEST['emptylabel']) || ($_REQUEST['emptylabel'] == '')) {
|
||||
$_REQUEST['emptylabel'] = Dropdown::EMPTY_VALUE;
|
||||
}
|
||||
|
||||
$search="";
|
||||
if (!empty($_REQUEST['searchText'])) {
|
||||
$search = ['LIKE', Search::makeTextSearchValue($_REQUEST['searchText'])];
|
||||
}
|
||||
|
||||
$processes = [];
|
||||
|
||||
// Empty search text : display first
|
||||
if (empty($_REQUEST['searchText'])) {
|
||||
if ($_REQUEST['display_emptychoice']) {
|
||||
if (($one_item < 0) || ($one_item == 0)) {
|
||||
array_push($processes, ['id' => 0,
|
||||
'text' => $_REQUEST['emptylabel']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$processall = (isset($_REQUEST['specific_tags']['process_restrict']) && !$_REQUEST['specific_tags']['process_restrict']);
|
||||
$count_cases_per_item = isset($_REQUEST['specific_tags']['count_cases_per_item']) ? $_REQUEST['specific_tags']['count_cases_per_item'] : [];
|
||||
|
||||
$result = PluginProcessmakerProcess::getSqlSearchResult(false, $search);
|
||||
|
||||
//if ($DB->numrows($result)) {
|
||||
// while ($data = $DB->fetch_array($result)) {
|
||||
//if ($result->numrows()) {
|
||||
foreach ($result as $data) {
|
||||
$process_entities = PluginProcessmakerProcess::getEntitiesForProfileByProcess($data["id"], $_SESSION['glpiactiveprofile']['id'], true);
|
||||
$can_add = $data['max_cases_per_item'] == 0 || !isset($count_cases_per_item[$data["id"]]) || $count_cases_per_item[$data["id"]] < $data['max_cases_per_item'];
|
||||
if ($processall
|
||||
|| ($data['maintenance'] != 1
|
||||
&& in_array( $_REQUEST["entity_restrict"], $process_entities)
|
||||
&& $can_add) ) {
|
||||
|
||||
array_push( $processes, ['id' => $data["id"],
|
||||
'text' => $data["name"]
|
||||
]);
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
//}
|
||||
|
||||
$ret['results'] = $processes;
|
||||
$ret['count'] = $count;
|
||||
echo json_encode($ret);
|
||||
|
||||
@@ -1,68 +1,68 @@
|
||||
<?php
|
||||
|
||||
//// ----------------------------------------------------------------------
|
||||
//// Original Author of file: Olivier Moron
|
||||
//// Purpose of file: to return list of processes which can be started by end-user
|
||||
//// ----------------------------------------------------------------------
|
||||
|
||||
//// Direct access to file
|
||||
//if (strpos($_SERVER['PHP_SELF'], "dropdownTaskcategories.php")) {
|
||||
// include ("../../../inc/includes.php");
|
||||
// header("Content-Type: text/html; charset=UTF-8");
|
||||
// Html::header_nocache();
|
||||
//}
|
||||
|
||||
//if (!defined('GLPI_ROOT')) {
|
||||
// die("Can not access directly to this file");
|
||||
//}
|
||||
|
||||
|
||||
//Session::checkLoginUser();
|
||||
|
||||
|
||||
//// Security
|
||||
//if (!($item = getItemForItemtype($_REQUEST['itemtype']))) {
|
||||
// exit();
|
||||
//}
|
||||
|
||||
//$one_item = -1;
|
||||
//if (isset($_POST['_one_id'])) {
|
||||
// $one_item = $_POST['_one_id'];
|
||||
//}
|
||||
//// Count real items returned
|
||||
//$count = 0;
|
||||
|
||||
//if (!isset($_REQUEST['emptylabel']) || ($_REQUEST['emptylabel'] == '')) {
|
||||
// $_REQUEST['emptylabel'] = Dropdown::EMPTY_VALUE;
|
||||
//}
|
||||
|
||||
//$search="";
|
||||
//if (!empty($_REQUEST['searchText'])) {
|
||||
// $search = Search::makeTextSearch($_REQUEST['searchText']);
|
||||
//}
|
||||
|
||||
//$taskcategories = array();
|
||||
|
||||
//// Empty search text : display first
|
||||
//if (empty($_REQUEST['searchText'])) {
|
||||
// if ($_REQUEST['display_emptychoice']) {
|
||||
// if (($one_item < 0) || ($one_item == 0)) {
|
||||
// array_push($taskcategories, array('id' => 0,
|
||||
// 'text' => $_REQUEST['emptylabel']));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//$result = PluginProcessmakerTaskCategory::getSqlSearchResult(false, $search);
|
||||
|
||||
//if ($DB->numrows($result)) {
|
||||
// while ($data=$DB->fetch_array($result)) {
|
||||
// array_push( $taskcategories, array( 'id' => $data["id"],
|
||||
// 'text' => $data["name"] ));
|
||||
// $count++;
|
||||
// }
|
||||
//}
|
||||
|
||||
//$ret['results'] = $taskcategories;
|
||||
//$ret['count'] = $count;
|
||||
//echo json_encode($ret);
|
||||
<?php
|
||||
|
||||
//// ----------------------------------------------------------------------
|
||||
//// Original Author of file: Olivier Moron
|
||||
//// Purpose of file: to return list of processes which can be started by end-user
|
||||
//// ----------------------------------------------------------------------
|
||||
|
||||
//// Direct access to file
|
||||
//if (strpos($_SERVER['PHP_SELF'], "dropdownTaskcategories.php")) {
|
||||
// include ("../../../inc/includes.php");
|
||||
// header("Content-Type: text/html; charset=UTF-8");
|
||||
// Html::header_nocache();
|
||||
//}
|
||||
|
||||
//if (!defined('GLPI_ROOT')) {
|
||||
// die("Can not access directly to this file");
|
||||
//}
|
||||
|
||||
|
||||
//Session::checkLoginUser();
|
||||
|
||||
|
||||
//// Security
|
||||
//if (!($item = getItemForItemtype($_REQUEST['itemtype']))) {
|
||||
// exit();
|
||||
//}
|
||||
|
||||
//$one_item = -1;
|
||||
//if (isset($_POST['_one_id'])) {
|
||||
// $one_item = $_POST['_one_id'];
|
||||
//}
|
||||
//// Count real items returned
|
||||
//$count = 0;
|
||||
|
||||
//if (!isset($_REQUEST['emptylabel']) || ($_REQUEST['emptylabel'] == '')) {
|
||||
// $_REQUEST['emptylabel'] = Dropdown::EMPTY_VALUE;
|
||||
//}
|
||||
|
||||
//$search="";
|
||||
//if (!empty($_REQUEST['searchText'])) {
|
||||
// $search = Search::makeTextSearch($_REQUEST['searchText']);
|
||||
//}
|
||||
|
||||
//$taskcategories = array();
|
||||
|
||||
//// Empty search text : display first
|
||||
//if (empty($_REQUEST['searchText'])) {
|
||||
// if ($_REQUEST['display_emptychoice']) {
|
||||
// if (($one_item < 0) || ($one_item == 0)) {
|
||||
// array_push($taskcategories, array('id' => 0,
|
||||
// 'text' => $_REQUEST['emptylabel']));
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
//$result = PluginProcessmakerTaskCategory::getSqlSearchResult(false, $search);
|
||||
|
||||
//if ($DB->numrows($result)) {
|
||||
// while ($data=$DB->fetch_array($result)) {
|
||||
// array_push( $taskcategories, array( 'id' => $data["id"],
|
||||
// 'text' => $data["name"] ));
|
||||
// $count++;
|
||||
// }
|
||||
//}
|
||||
|
||||
//$ret['results'] = $taskcategories;
|
||||
//$ret['count'] = $count;
|
||||
//echo json_encode($ret);
|
||||
|
||||
@@ -1,40 +1,40 @@
|
||||
<?php
|
||||
/**
|
||||
*/
|
||||
|
||||
if (strpos($_SERVER['PHP_SELF'], "dropdownTicketCategories.php")) {
|
||||
include ("../../../inc/includes.php");
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
Html::header_nocache();
|
||||
} else if (!defined('GLPI_ROOT')) {
|
||||
die("Sorry. You can't access this file directly");
|
||||
}
|
||||
|
||||
$opt['entity'] = $_POST["entity_restrict"] ?? -1;
|
||||
|
||||
if (isset($_POST["condition"])) {
|
||||
$opt['condition'] = $_POST["condition"];
|
||||
}
|
||||
|
||||
$currentcateg = new ITILCategory();
|
||||
$currentcateg->getFromDB($_POST['value']);
|
||||
|
||||
if ($_POST["type"]) {
|
||||
switch ($_POST['type']) {
|
||||
case Ticket::INCIDENT_TYPE :
|
||||
$opt['condition']['is_incident'] = '1';
|
||||
if ($currentcateg->getField('is_incident') == 1) {
|
||||
$opt['value'] = $_POST['value'];
|
||||
}
|
||||
break;
|
||||
|
||||
case Ticket::DEMAND_TYPE:
|
||||
$opt['condition']['is_request'] = '1';
|
||||
if ($currentcateg->getField('is_request') == 1) {
|
||||
$opt['value'] = $_POST['value'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ITILCategory::dropdown($opt);
|
||||
<?php
|
||||
/**
|
||||
*/
|
||||
|
||||
if (strpos($_SERVER['PHP_SELF'], "dropdownTicketCategories.php")) {
|
||||
include ("../../../inc/includes.php");
|
||||
header("Content-Type: text/html; charset=UTF-8");
|
||||
Html::header_nocache();
|
||||
} else if (!defined('GLPI_ROOT')) {
|
||||
die("Sorry. You can't access this file directly");
|
||||
}
|
||||
|
||||
$opt['entity'] = $_POST["entity_restrict"] ?? -1;
|
||||
|
||||
if (isset($_POST["condition"])) {
|
||||
$opt['condition'] = $_POST["condition"];
|
||||
}
|
||||
|
||||
$currentcateg = new ITILCategory();
|
||||
$currentcateg->getFromDB($_POST['value']);
|
||||
|
||||
if ($_POST["type"]) {
|
||||
switch ($_POST['type']) {
|
||||
case Ticket::INCIDENT_TYPE :
|
||||
$opt['condition']['is_incident'] = '1';
|
||||
if ($currentcateg->getField('is_incident') == 1) {
|
||||
$opt['value'] = $_POST['value'];
|
||||
}
|
||||
break;
|
||||
|
||||
case Ticket::DEMAND_TYPE:
|
||||
$opt['condition']['is_request'] = '1';
|
||||
if ($currentcateg->getField('is_request') == 1) {
|
||||
$opt['value'] = $_POST['value'];
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ITILCategory::dropdown($opt);
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
<?php
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
@@ -1,87 +1,87 @@
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Session::checkLoginUser();
|
||||
|
||||
$locCase = new PluginProcessmakerCase();
|
||||
|
||||
function glpi_processmaker_case_reload_page() {
|
||||
global $PM_SOAP;
|
||||
// now redirect to item form page
|
||||
$config = $PM_SOAP->config;
|
||||
echo "<html><body><script>";
|
||||
if (isset($config->fields['domain']) && $config->fields['domain'] != '') {
|
||||
echo "document.domain='{$config->fields['domain']}';";
|
||||
}
|
||||
echo "</script><input id='GLPI_FORCE_RELOAD' type='hidden' value='GLPI_FORCE_RELOAD'/></body></html>";
|
||||
}
|
||||
|
||||
|
||||
// check if it is from PM pages
|
||||
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'route' && isset( $_REQUEST['UID'] ) && isset( $_REQUEST['APP_UID'] ) && isset( $_REQUEST['__DynaformName__'] )) {
|
||||
// then get item id from DB
|
||||
if ($locCase->getFromGUID($_REQUEST['APP_UID'])) {
|
||||
$PM_SOAP->derivateCase($locCase, $_REQUEST);
|
||||
}
|
||||
glpi_processmaker_case_reload_page();
|
||||
|
||||
} else if (isset($_REQUEST['purge'])) {
|
||||
// delete case from case table, this will also delete the tasks
|
||||
if ($locCase->getFromDB($_REQUEST['id']) && $locCase->deleteCase()) {
|
||||
Session::addMessageAfterRedirect(__('Case has been deleted!', 'processmaker'), true, INFO);
|
||||
} else {
|
||||
Session::addMessageAfterRedirect(__('Unable to delete case!', 'processmaker'), true, ERROR);
|
||||
}
|
||||
// will redirect to item or to list if no item
|
||||
$locCase->redirectToList();
|
||||
|
||||
} else if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'cancel') {
|
||||
// cancel case from PM
|
||||
$locCase = new PluginProcessmakerCase;
|
||||
$locCase->getFromDB($_POST['cases_id']);
|
||||
$resultPM = $PM_SOAP->cancelCase($locCase->fields['case_guid']);
|
||||
if ($resultPM->status_code === 0) {
|
||||
if ($locCase->cancelCase()) {
|
||||
Session::addMessageAfterRedirect(__('Case has been cancelled!', 'processmaker'), true, INFO);
|
||||
} else {
|
||||
Session::addMessageAfterRedirect(__('Unable to cancel case!', 'processmaker'), true, ERROR);
|
||||
}
|
||||
} else {
|
||||
Session::addMessageAfterRedirect(__('Unable to cancel case!', 'processmaker'), true, ERROR);
|
||||
}
|
||||
Html::back();
|
||||
} else if (isset( $_REQUEST['form'] ) && isset( $_REQUEST['form']['BTN_CATCH'] ) && isset( $_REQUEST['form']['APP_UID'])) {
|
||||
// Claim task management
|
||||
// here we are in a Claim request
|
||||
$myCase = new PluginProcessmakerCase;
|
||||
if ($myCase->getFromGUID( $_REQUEST['form']['APP_UID'] )) {
|
||||
|
||||
$pmClaimCase = $PM_SOAP->claimCase($myCase->fields['case_guid'], $_REQUEST['DEL_INDEX'] );
|
||||
|
||||
// now manage tasks associated with item
|
||||
$PM_SOAP->claimTask($myCase->getID(), $_REQUEST['DEL_INDEX']);
|
||||
}
|
||||
glpi_processmaker_case_reload_page();
|
||||
|
||||
} else if (isset($_REQUEST['id']) && $_REQUEST['id'] > 0) {
|
||||
|
||||
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
|
||||
Html::helpHeader(__('Process cases', 'processmaker'), '', $_SESSION["glpiname"]);
|
||||
} else {
|
||||
Html::header(__('Process cases', 'processmaker'), $_SERVER['PHP_SELF'], "helpdesk", "PluginProcessmakerCase", "cases");
|
||||
}
|
||||
|
||||
if (!$PM_SOAP->config->fields['maintenance']) {
|
||||
if ($locCase->getFromDB($_REQUEST['id'])) {
|
||||
$locCase->display($_REQUEST);
|
||||
}
|
||||
} else {
|
||||
PluginProcessmakerProcessmaker::showUnderMaintenance();
|
||||
}
|
||||
|
||||
Html::footer();
|
||||
}
|
||||
|
||||
|
||||
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Session::checkLoginUser();
|
||||
|
||||
$locCase = new PluginProcessmakerCase();
|
||||
|
||||
function glpi_processmaker_case_reload_page() {
|
||||
global $PM_SOAP;
|
||||
// now redirect to item form page
|
||||
$config = $PM_SOAP->config;
|
||||
echo "<html><body><script>";
|
||||
if (isset($config->fields['domain']) && $config->fields['domain'] != '') {
|
||||
echo "document.domain='{$config->fields['domain']}';";
|
||||
}
|
||||
echo "</script><input id='GLPI_FORCE_RELOAD' type='hidden' value='GLPI_FORCE_RELOAD'/></body></html>";
|
||||
}
|
||||
|
||||
|
||||
// check if it is from PM pages
|
||||
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'route' && isset( $_REQUEST['UID'] ) && isset( $_REQUEST['APP_UID'] ) && isset( $_REQUEST['__DynaformName__'] )) {
|
||||
// then get item id from DB
|
||||
if ($locCase->getFromGUID($_REQUEST['APP_UID'])) {
|
||||
$PM_SOAP->derivateCase($locCase, $_REQUEST);
|
||||
}
|
||||
glpi_processmaker_case_reload_page();
|
||||
|
||||
} else if (isset($_REQUEST['purge'])) {
|
||||
// delete case from case table, this will also delete the tasks
|
||||
if ($locCase->getFromDB($_REQUEST['id']) && $locCase->deleteCase()) {
|
||||
Session::addMessageAfterRedirect(__('Case has been deleted!', 'processmaker'), true, INFO);
|
||||
} else {
|
||||
Session::addMessageAfterRedirect(__('Unable to delete case!', 'processmaker'), true, ERROR);
|
||||
}
|
||||
// will redirect to item or to list if no item
|
||||
$locCase->redirectToList();
|
||||
|
||||
} else if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'cancel') {
|
||||
// cancel case from PM
|
||||
$locCase = new PluginProcessmakerCase;
|
||||
$locCase->getFromDB($_POST['cases_id']);
|
||||
$resultPM = $PM_SOAP->cancelCase($locCase->fields['case_guid']);
|
||||
if ($resultPM->status_code === 0) {
|
||||
if ($locCase->cancelCase()) {
|
||||
Session::addMessageAfterRedirect(__('Case has been cancelled!', 'processmaker'), true, INFO);
|
||||
} else {
|
||||
Session::addMessageAfterRedirect(__('Unable to cancel case!', 'processmaker'), true, ERROR);
|
||||
}
|
||||
} else {
|
||||
Session::addMessageAfterRedirect(__('Unable to cancel case!', 'processmaker'), true, ERROR);
|
||||
}
|
||||
Html::back();
|
||||
} else if (isset( $_REQUEST['form'] ) && isset( $_REQUEST['form']['BTN_CATCH'] ) && isset( $_REQUEST['form']['APP_UID'])) {
|
||||
// Claim task management
|
||||
// here we are in a Claim request
|
||||
$myCase = new PluginProcessmakerCase;
|
||||
if ($myCase->getFromGUID( $_REQUEST['form']['APP_UID'] )) {
|
||||
|
||||
$pmClaimCase = $PM_SOAP->claimCase($myCase->fields['case_guid'], $_REQUEST['DEL_INDEX'] );
|
||||
|
||||
// now manage tasks associated with item
|
||||
$PM_SOAP->claimTask($myCase->getID(), $_REQUEST['DEL_INDEX']);
|
||||
}
|
||||
glpi_processmaker_case_reload_page();
|
||||
|
||||
} else if (isset($_REQUEST['id']) && $_REQUEST['id'] > 0) {
|
||||
|
||||
if ($_SESSION["glpiactiveprofile"]["interface"] == "helpdesk") {
|
||||
Html::helpHeader(__('Process cases', 'processmaker'), '', $_SESSION["glpiname"]);
|
||||
} else {
|
||||
Html::header(__('Process cases', 'processmaker'), $_SERVER['PHP_SELF'], "helpdesk", "PluginProcessmakerCase", "cases");
|
||||
}
|
||||
|
||||
if (!$PM_SOAP->config->fields['maintenance']) {
|
||||
if ($locCase->getFromDB($_REQUEST['id'])) {
|
||||
$locCase->display($_REQUEST);
|
||||
}
|
||||
} else {
|
||||
PluginProcessmakerProcessmaker::showUnderMaintenance();
|
||||
}
|
||||
|
||||
Html::footer();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,34 +1,34 @@
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Session::checkLoginUser();
|
||||
|
||||
Plugin::load('processmaker', true); // ???
|
||||
|
||||
if (!isset($_REQUEST["id"])) {
|
||||
$_REQUEST["id"] = "";
|
||||
}
|
||||
|
||||
$PluginCaselink = new PluginProcessmakerCaselink();
|
||||
|
||||
if (isset($_REQUEST["update"])) {
|
||||
$PluginCaselink->check($_REQUEST['id'], UPDATE);
|
||||
$PluginCaselink->update($_REQUEST);
|
||||
Html::back();
|
||||
} else if (isset($_REQUEST['add'])) {
|
||||
$PluginCaselink->check($_REQUEST['id'], UPDATE);
|
||||
$PluginCaselink->add($_REQUEST);
|
||||
Html::back();
|
||||
} else if (isset($_REQUEST['purge'])) {
|
||||
$PluginCaselink->check($_REQUEST['id'], PURGE);
|
||||
$PluginCaselink->delete($_REQUEST, true);
|
||||
$PluginCaselink->redirectToList();
|
||||
} else {
|
||||
|
||||
Html::header(__('ProcessMaker', 'processmaker'), $_SERVER['PHP_SELF'], "tools", "PluginProcessmakerMenu", "caselinks");
|
||||
|
||||
$PluginCaselink->display($_REQUEST);
|
||||
|
||||
Html::footer();
|
||||
}
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Session::checkLoginUser();
|
||||
|
||||
Plugin::load('processmaker', true); // ???
|
||||
|
||||
if (!isset($_REQUEST["id"])) {
|
||||
$_REQUEST["id"] = "";
|
||||
}
|
||||
|
||||
$PluginCaselink = new PluginProcessmakerCaselink();
|
||||
|
||||
if (isset($_REQUEST["update"])) {
|
||||
$PluginCaselink->check($_REQUEST['id'], UPDATE);
|
||||
$PluginCaselink->update($_REQUEST);
|
||||
Html::back();
|
||||
} else if (isset($_REQUEST['add'])) {
|
||||
$PluginCaselink->check($_REQUEST['id'], UPDATE);
|
||||
$PluginCaselink->add($_REQUEST);
|
||||
Html::back();
|
||||
} else if (isset($_REQUEST['purge'])) {
|
||||
$PluginCaselink->check($_REQUEST['id'], PURGE);
|
||||
$PluginCaselink->delete($_REQUEST, true);
|
||||
$PluginCaselink->redirectToList();
|
||||
} else {
|
||||
|
||||
Html::header(__('ProcessMaker', 'processmaker'), $_SERVER['PHP_SELF'], "tools", "PluginProcessmakerMenu", "caselinks");
|
||||
|
||||
$PluginCaselink->display($_REQUEST);
|
||||
|
||||
Html::footer();
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Html::header(__('ProcessMaker', 'processmaker'), $_SERVER['PHP_SELF'], "tools", "PluginProcessmakerMenu", "caselinks");
|
||||
|
||||
if (Session::haveRightsOr("plugin_processmaker_config", [READ, UPDATE])) {
|
||||
|
||||
Search::show('PluginProcessmakerCaselink');
|
||||
|
||||
} else {
|
||||
Html::displayRightError();
|
||||
}
|
||||
Html::footer();
|
||||
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Html::header(__('ProcessMaker', 'processmaker'), $_SERVER['PHP_SELF'], "tools", "PluginProcessmakerMenu", "caselinks");
|
||||
|
||||
if (Session::haveRightsOr("plugin_processmaker_config", [READ, UPDATE])) {
|
||||
|
||||
Search::show('PluginProcessmakerCaselink');
|
||||
|
||||
} else {
|
||||
Html::displayRightError();
|
||||
}
|
||||
Html::footer();
|
||||
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
<?php
|
||||
|
||||
include ( "../../../inc/includes.php");
|
||||
|
||||
$config = new PluginProcessmakerConfig();
|
||||
if (isset($_POST["update"])) {
|
||||
$config->check($_POST['id'], UPDATE);
|
||||
|
||||
// save
|
||||
$config->update($_POST);
|
||||
|
||||
|
||||
Html::back();
|
||||
|
||||
} else if (isset($_POST["refresh"])) {
|
||||
$config->refresh($_POST); // used to refresh process list, task category list
|
||||
Html::back();
|
||||
}
|
||||
|
||||
Html::redirect($CFG_GLPI["root_doc"]."/front/config.form.php?forcetab=".
|
||||
urlencode('PluginProcessmakerConfig$1'));
|
||||
<?php
|
||||
|
||||
include ( "../../../inc/includes.php");
|
||||
|
||||
$config = new PluginProcessmakerConfig();
|
||||
if (isset($_POST["update"])) {
|
||||
$config->check($_POST['id'], UPDATE);
|
||||
|
||||
// save
|
||||
$config->update($_POST);
|
||||
|
||||
|
||||
Html::back();
|
||||
|
||||
} else if (isset($_POST["refresh"])) {
|
||||
$config->refresh($_POST); // used to refresh process list, task category list
|
||||
Html::back();
|
||||
}
|
||||
|
||||
Html::redirect($CFG_GLPI["root_doc"]."/front/config.form.php?forcetab=".
|
||||
urlencode('PluginProcessmakerConfig$1'));
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Session::checkLoginUser();
|
||||
|
||||
Plugin::load('processmaker', true); // ???
|
||||
|
||||
if (!isset($_REQUEST["id"])) {
|
||||
$_REQUEST["id"] = "";
|
||||
}
|
||||
|
||||
$PluginProcess = new PluginProcessmakerProcess();
|
||||
|
||||
if (isset($_REQUEST["update"])) {
|
||||
$PluginProcess->check($_REQUEST['id'], UPDATE);
|
||||
$PluginProcess->update($_REQUEST);
|
||||
Html::back();
|
||||
|
||||
} else if (isset($_REQUEST["refreshtask"])) {
|
||||
$PluginProcess->check($_REQUEST['id'], UPDATE);
|
||||
$PluginProcess->refreshTasks($_REQUEST);
|
||||
Html::back();
|
||||
|
||||
} else {
|
||||
|
||||
Html::header(__('ProcessMaker', 'processmaker'), $_SERVER['PHP_SELF'], "tools", "PluginProcessmakerMenu", "processes");
|
||||
|
||||
$PluginProcess->display($_REQUEST);
|
||||
|
||||
Html::footer();
|
||||
}
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Session::checkLoginUser();
|
||||
|
||||
Plugin::load('processmaker', true); // ???
|
||||
|
||||
if (!isset($_REQUEST["id"])) {
|
||||
$_REQUEST["id"] = "";
|
||||
}
|
||||
|
||||
$PluginProcess = new PluginProcessmakerProcess();
|
||||
|
||||
if (isset($_REQUEST["update"])) {
|
||||
$PluginProcess->check($_REQUEST['id'], UPDATE);
|
||||
$PluginProcess->update($_REQUEST);
|
||||
Html::back();
|
||||
|
||||
} else if (isset($_REQUEST["refreshtask"])) {
|
||||
$PluginProcess->check($_REQUEST['id'], UPDATE);
|
||||
$PluginProcess->refreshTasks($_REQUEST);
|
||||
Html::back();
|
||||
|
||||
} else {
|
||||
|
||||
Html::header(__('ProcessMaker', 'processmaker'), $_SERVER['PHP_SELF'], "tools", "PluginProcessmakerMenu", "processes");
|
||||
|
||||
$PluginProcess->display($_REQUEST);
|
||||
|
||||
Html::footer();
|
||||
}
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Html::header(__('ProcessMaker', 'processmaker'), $_SERVER['PHP_SELF'], "tools", "PluginProcessmakerMenu", "processes");
|
||||
|
||||
if (Session::haveRightsOr("plugin_processmaker_config", [READ, UPDATE])) {
|
||||
$process=new PluginProcessmakerProcess();
|
||||
|
||||
if (isset( $_REQUEST['refresh'] ) && Session::haveRight("plugin_processmaker_config", UPDATE)) {
|
||||
$process->refresh();
|
||||
Html::back();
|
||||
}
|
||||
|
||||
$process->title();
|
||||
|
||||
Search::show('PluginProcessmakerProcess');
|
||||
|
||||
} else {
|
||||
Html::displayRightError();
|
||||
}
|
||||
Html::footer();
|
||||
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Html::header(__('ProcessMaker', 'processmaker'), $_SERVER['PHP_SELF'], "tools", "PluginProcessmakerMenu", "processes");
|
||||
|
||||
if (Session::haveRightsOr("plugin_processmaker_config", [READ, UPDATE])) {
|
||||
$process=new PluginProcessmakerProcess();
|
||||
|
||||
if (isset( $_REQUEST['refresh'] ) && Session::haveRight("plugin_processmaker_config", UPDATE)) {
|
||||
$process->refresh();
|
||||
Html::back();
|
||||
}
|
||||
|
||||
$process->title();
|
||||
|
||||
Search::show('PluginProcessmakerProcess');
|
||||
|
||||
} else {
|
||||
Html::displayRightError();
|
||||
}
|
||||
Html::footer();
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Session::checkCentralAccess();
|
||||
|
||||
$right = new PluginProcessmakerProcess_Profile();
|
||||
|
||||
if (isset($_POST["add"])) {
|
||||
|
||||
$right->check(-1, UPDATE, $_POST);
|
||||
$right->add($_POST);
|
||||
Html::back();
|
||||
}
|
||||
|
||||
Html::displayErrorAndDie("lost");
|
||||
<?php
|
||||
|
||||
include_once ("../../../inc/includes.php");
|
||||
|
||||
Session::checkCentralAccess();
|
||||
|
||||
$right = new PluginProcessmakerProcess_Profile();
|
||||
|
||||
if (isset($_POST["add"])) {
|
||||
|
||||
$right->check(-1, UPDATE, $_POST);
|
||||
$right->add($_POST);
|
||||
Html::back();
|
||||
}
|
||||
|
||||
Html::displayErrorAndDie("lost");
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* casechangelog short summary.
|
||||
*
|
||||
* casechangelog description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerCasechangelog extends CommonDBTM {
|
||||
|
||||
static function displayTabContentForItem(CommonGLPI $case, $tabnum = 1, $withtemplate = 0) {
|
||||
global $CFG_GLPI, $PM_SOAP;
|
||||
|
||||
$rand = rand();
|
||||
|
||||
$caseHistoryURL = $PM_SOAP->serverURL."/cases/ajaxListener?action=changeLogHistory&rand=$rand";
|
||||
|
||||
$PM_SOAP->echoDomain();
|
||||
echo "<script type='text/javascript' src='".$CFG_GLPI["root_doc"]."/plugins/processmaker/js/cases.js'></script>"; //?rand=$rand'
|
||||
|
||||
$iframe = "<iframe
|
||||
id='caseiframe-caseChangeLogHistory'
|
||||
style='border: none;'
|
||||
width='100%'
|
||||
src='$caseHistoryURL'
|
||||
onload=\"onOtherFrameLoad( 'caseChangeLogHistory', 'caseiframe-caseChangeLogHistory', 'body', 0 );\">
|
||||
</iframe>";
|
||||
|
||||
$PM_SOAP->initCaseAndShowTab(['APP_UID' => $case->fields['case_guid'], 'DEL_INDEX' => 1], $iframe, $rand);
|
||||
|
||||
}
|
||||
|
||||
function getTabNameForItem(CommonGLPI $case, $withtemplate = 0) {
|
||||
return __('Change log', 'processmaker');
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* casechangelog short summary.
|
||||
*
|
||||
* casechangelog description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerCasechangelog extends CommonDBTM {
|
||||
|
||||
static function displayTabContentForItem(CommonGLPI $case, $tabnum = 1, $withtemplate = 0) {
|
||||
global $CFG_GLPI, $PM_SOAP;
|
||||
|
||||
$rand = rand();
|
||||
|
||||
$caseHistoryURL = $PM_SOAP->serverURL."/cases/ajaxListener?action=changeLogHistory&rand=$rand";
|
||||
|
||||
$PM_SOAP->echoDomain();
|
||||
echo "<script type='text/javascript' src='".$CFG_GLPI["root_doc"]."/plugins/processmaker/js/cases.js'></script>"; //?rand=$rand'
|
||||
|
||||
$iframe = "<iframe
|
||||
id='caseiframe-caseChangeLogHistory'
|
||||
style='border: none;'
|
||||
width='100%'
|
||||
src='$caseHistoryURL'
|
||||
onload=\"onOtherFrameLoad( 'caseChangeLogHistory', 'caseiframe-caseChangeLogHistory', 'body', 0 );\">
|
||||
</iframe>";
|
||||
|
||||
$PM_SOAP->initCaseAndShowTab(['APP_UID' => $case->fields['case_guid'], 'DEL_INDEX' => 1], $iframe, $rand);
|
||||
|
||||
}
|
||||
|
||||
function getTabNameForItem(CommonGLPI $case, $withtemplate = 0) {
|
||||
return __('Change log', 'processmaker');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,86 +1,86 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PluginProcessmakerCasemap short summary.
|
||||
*
|
||||
* casemap description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerCasedynaform extends CommonDBTM {
|
||||
|
||||
static function displayTabContentForItem(CommonGLPI $case, $tabnum = 1, $withtemplate = 0) {
|
||||
global $CFG_GLPI, $PM_SOAP;
|
||||
|
||||
$config = $PM_SOAP->config;
|
||||
$rand = rand();
|
||||
|
||||
$proj = new PluginProcessmakerProcess;
|
||||
$proj->getFromDB($case->fields['plugin_processmaker_processes_id']);
|
||||
|
||||
$PM_SOAP->echoDomain();
|
||||
echo "<script type='text/javascript' src='".$CFG_GLPI["root_doc"]."/plugins/processmaker/js/cases.js'></script>"; //?rand=$rand'
|
||||
|
||||
echo "<script type='text/javascript'>
|
||||
var historyGridListChangeLogGlobal = { viewIdHistory: '', viewIdDin: '', viewDynaformName: '', idHistory: '' } ;
|
||||
var ActionTabFrameGlobal = { tabData: '', tabName: '', tabTitle: '' } ;
|
||||
function urldecode(url) {
|
||||
return decodeURIComponent(url.replace(/\+/g, ' '));
|
||||
}
|
||||
function addTabPanel(name, title, html){
|
||||
//debugger ;
|
||||
var loctabs = $('#tabspanel').next('div[id^=tabs]');
|
||||
if( !loctabs[0].children[name] ) { // panel is not yet existing, create one
|
||||
if( loctabs.find('a[href=\"#'+name+'\"]').length == 0 ) {
|
||||
loctabs.find('ul').append( '<li><a href=\'#' + name + '\'>' + title + '</a></li>' );
|
||||
}
|
||||
$.ajax( { url: '".$PM_SOAP->serverURL."/cases/cases_Open?sid=".$PM_SOAP->getPMSessionID()."&APP_UID={$case->fields['case_guid']}&DEL_INDEX=1&action=TO_DO&glpi_init_case=1&glpi_domain={$config->fields['domain']}',
|
||||
xhrFields: { withCredentials: true },
|
||||
cache: false,
|
||||
crossDomain: true,
|
||||
success: function(jqXHR) {
|
||||
//debugger;
|
||||
loctabs.append( '<div id=\'' + name + '\'>' + html + '</div>');
|
||||
loctabs.tabs('refresh'); // to show the panel
|
||||
var tabIndex = loctabs.find('a[href=\"#'+name+'\"]').parent().index();
|
||||
loctabs.tabs( 'option', 'active', tabIndex) ; // to activate it
|
||||
} });
|
||||
} else { // only activate it
|
||||
var tabIndex = loctabs.find('a[href=\"#'+name+'\"]').parent().index();
|
||||
loctabs.tabs( 'option', 'active', tabIndex) ; // to activate it
|
||||
}
|
||||
}
|
||||
var Actions = { tabFrame: function( actionToDo ) {
|
||||
//debugger ;
|
||||
if( actionToDo.search( '^historyDynaformGridPreview' ) == 0 ) {
|
||||
actionToDo = actionToDo.replace('_', '$') ;
|
||||
var act = actionToDo.replace( '$', '&DYN_UID=') ;
|
||||
addTabPanel( actionToDo,
|
||||
ActionTabFrameGlobal.tabTitle,
|
||||
'<iframe id=\'caseiframe-' + actionToDo + '\' style=\'border: none;\' onload=\'onOtherFrameLoad( \"'+actionToDo+'\", \"caseiframe-' + actionToDo + '\", \"form\", 0 );\' width=\'100%\' src=\'".$PM_SOAP->serverURL."/cases/casesHistoryDynaformPage_Ajax?actionAjax=' + act + '&rand=$rand\' ></iframe>'
|
||||
);
|
||||
}
|
||||
}
|
||||
} ;
|
||||
</script>";
|
||||
|
||||
$caseURL = $PM_SOAP->serverURL."/cases/casesHistoryDynaformPage_Ajax?actionAjax=historyDynaformPage&rand=$rand";
|
||||
|
||||
$iframe = "<iframe
|
||||
id='caseiframe-historyDynaformPage'
|
||||
style='border: none;'
|
||||
width='100%'
|
||||
src='$caseURL'
|
||||
onload=\"onOtherFrameLoad( 'historyDynaformPage', 'caseiframe-historyDynaformPage', 'body', 0 );\">
|
||||
</iframe>";
|
||||
|
||||
$PM_SOAP->initCaseAndShowTab(['APP_UID' => $case->fields['case_guid'], 'DEL_INDEX' => 1], $iframe, $rand);
|
||||
|
||||
}
|
||||
|
||||
function getTabNameForItem(CommonGLPI $case, $withtemplate = 0) {
|
||||
return __('Dynaforms', 'processmaker');
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PluginProcessmakerCasemap short summary.
|
||||
*
|
||||
* casemap description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerCasedynaform extends CommonDBTM {
|
||||
|
||||
static function displayTabContentForItem(CommonGLPI $case, $tabnum = 1, $withtemplate = 0) {
|
||||
global $CFG_GLPI, $PM_SOAP;
|
||||
|
||||
$config = $PM_SOAP->config;
|
||||
$rand = rand();
|
||||
|
||||
$proj = new PluginProcessmakerProcess;
|
||||
$proj->getFromDB($case->fields['plugin_processmaker_processes_id']);
|
||||
|
||||
$PM_SOAP->echoDomain();
|
||||
echo "<script type='text/javascript' src='".$CFG_GLPI["root_doc"]."/plugins/processmaker/js/cases.js'></script>"; //?rand=$rand'
|
||||
|
||||
echo "<script type='text/javascript'>
|
||||
var historyGridListChangeLogGlobal = { viewIdHistory: '', viewIdDin: '', viewDynaformName: '', idHistory: '' } ;
|
||||
var ActionTabFrameGlobal = { tabData: '', tabName: '', tabTitle: '' } ;
|
||||
function urldecode(url) {
|
||||
return decodeURIComponent(url.replace(/\+/g, ' '));
|
||||
}
|
||||
function addTabPanel(name, title, html){
|
||||
//debugger ;
|
||||
var loctabs = $('#tabspanel').next('div[id^=tabs]');
|
||||
if( !loctabs[0].children[name] ) { // panel is not yet existing, create one
|
||||
if( loctabs.find('a[href=\"#'+name+'\"]').length == 0 ) {
|
||||
loctabs.find('ul').append( '<li><a href=\'#' + name + '\'>' + title + '</a></li>' );
|
||||
}
|
||||
$.ajax( { url: '".$PM_SOAP->serverURL."/cases/cases_Open?sid=".$PM_SOAP->getPMSessionID()."&APP_UID={$case->fields['case_guid']}&DEL_INDEX=1&action=TO_DO&glpi_init_case=1&glpi_domain={$config->fields['domain']}',
|
||||
xhrFields: { withCredentials: true },
|
||||
cache: false,
|
||||
crossDomain: true,
|
||||
success: function(jqXHR) {
|
||||
//debugger;
|
||||
loctabs.append( '<div id=\'' + name + '\'>' + html + '</div>');
|
||||
loctabs.tabs('refresh'); // to show the panel
|
||||
var tabIndex = loctabs.find('a[href=\"#'+name+'\"]').parent().index();
|
||||
loctabs.tabs( 'option', 'active', tabIndex) ; // to activate it
|
||||
} });
|
||||
} else { // only activate it
|
||||
var tabIndex = loctabs.find('a[href=\"#'+name+'\"]').parent().index();
|
||||
loctabs.tabs( 'option', 'active', tabIndex) ; // to activate it
|
||||
}
|
||||
}
|
||||
var Actions = { tabFrame: function( actionToDo ) {
|
||||
//debugger ;
|
||||
if( actionToDo.search( '^historyDynaformGridPreview' ) == 0 ) {
|
||||
actionToDo = actionToDo.replace('_', '$') ;
|
||||
var act = actionToDo.replace( '$', '&DYN_UID=') ;
|
||||
addTabPanel( actionToDo,
|
||||
ActionTabFrameGlobal.tabTitle,
|
||||
'<iframe id=\'caseiframe-' + actionToDo + '\' style=\'border: none;\' onload=\'onOtherFrameLoad( \"'+actionToDo+'\", \"caseiframe-' + actionToDo + '\", \"form\", 0 );\' width=\'100%\' src=\'".$PM_SOAP->serverURL."/cases/casesHistoryDynaformPage_Ajax?actionAjax=' + act + '&rand=$rand\' ></iframe>'
|
||||
);
|
||||
}
|
||||
}
|
||||
} ;
|
||||
</script>";
|
||||
|
||||
$caseURL = $PM_SOAP->serverURL."/cases/casesHistoryDynaformPage_Ajax?actionAjax=historyDynaformPage&rand=$rand";
|
||||
|
||||
$iframe = "<iframe
|
||||
id='caseiframe-historyDynaformPage'
|
||||
style='border: none;'
|
||||
width='100%'
|
||||
src='$caseURL'
|
||||
onload=\"onOtherFrameLoad( 'historyDynaformPage', 'caseiframe-historyDynaformPage', 'body', 0 );\">
|
||||
</iframe>";
|
||||
|
||||
$PM_SOAP->initCaseAndShowTab(['APP_UID' => $case->fields['case_guid'], 'DEL_INDEX' => 1], $iframe, $rand);
|
||||
|
||||
}
|
||||
|
||||
function getTabNameForItem(CommonGLPI $case, $withtemplate = 0) {
|
||||
return __('Dynaforms', 'processmaker');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,38 +1,38 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* casehistory short summary.
|
||||
*
|
||||
* casehistory description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerCasehistory extends CommonDBTM {
|
||||
static function displayTabContentForItem(CommonGLPI $case, $tabnum = 1, $withtemplate = 0) {
|
||||
global $CFG_GLPI, $PM_SOAP;
|
||||
|
||||
$rand = rand();
|
||||
|
||||
$caseHistoryURL = $PM_SOAP->serverURL
|
||||
."/cases/ajaxListener?action=caseHistory&rand=$rand";
|
||||
|
||||
$PM_SOAP->echoDomain();
|
||||
echo "<script type='text/javascript' src='".$CFG_GLPI["root_doc"]."/plugins/processmaker/js/cases.js'></script>";
|
||||
|
||||
$iframe = "<iframe
|
||||
id='caseiframe-caseHistory'
|
||||
style='border: none;'
|
||||
width='100%'
|
||||
src='$caseHistoryURL'
|
||||
onload=\"onOtherFrameLoad( 'caseHistory', 'caseiframe-caseHistory', 'body', 0 );\">
|
||||
</iframe>";
|
||||
|
||||
$PM_SOAP->initCaseAndShowTab(['APP_UID' => $case->fields['case_guid'], 'DEL_INDEX' => 1], $iframe, $rand);
|
||||
|
||||
}
|
||||
|
||||
function getTabNameForItem(CommonGLPI $case, $withtemplate = 0) {
|
||||
return __('History', 'processmaker');
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* casehistory short summary.
|
||||
*
|
||||
* casehistory description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerCasehistory extends CommonDBTM {
|
||||
static function displayTabContentForItem(CommonGLPI $case, $tabnum = 1, $withtemplate = 0) {
|
||||
global $CFG_GLPI, $PM_SOAP;
|
||||
|
||||
$rand = rand();
|
||||
|
||||
$caseHistoryURL = $PM_SOAP->serverURL
|
||||
."/cases/ajaxListener?action=caseHistory&rand=$rand";
|
||||
|
||||
$PM_SOAP->echoDomain();
|
||||
echo "<script type='text/javascript' src='".$CFG_GLPI["root_doc"]."/plugins/processmaker/js/cases.js'></script>";
|
||||
|
||||
$iframe = "<iframe
|
||||
id='caseiframe-caseHistory'
|
||||
style='border: none;'
|
||||
width='100%'
|
||||
src='$caseHistoryURL'
|
||||
onload=\"onOtherFrameLoad( 'caseHistory', 'caseiframe-caseHistory', 'body', 0 );\">
|
||||
</iframe>";
|
||||
|
||||
$PM_SOAP->initCaseAndShowTab(['APP_UID' => $case->fields['case_guid'], 'DEL_INDEX' => 1], $iframe, $rand);
|
||||
|
||||
}
|
||||
|
||||
function getTabNameForItem(CommonGLPI $case, $withtemplate = 0) {
|
||||
return __('History', 'processmaker');
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,12 +1,12 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PluginProcessmakerCaselinkaction short summary.
|
||||
*
|
||||
* PluginProcessmakerCaselinkaction description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerCaselinkaction extends CommonDBTM {
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PluginProcessmakerCaselinkaction short summary.
|
||||
*
|
||||
* PluginProcessmakerCaselinkaction description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerCaselinkaction extends CommonDBTM {
|
||||
}
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PluginProcessmakerCasemap short summary.
|
||||
*
|
||||
* casemap description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerCasemap extends CommonDBTM {
|
||||
|
||||
static function displayTabContentForItem(CommonGLPI $case, $tabnum = 1, $withtemplate = 0) {
|
||||
global $CFG_GLPI, $PM_SOAP;
|
||||
|
||||
$rand = rand();
|
||||
|
||||
$proj = new PluginProcessmakerProcess;
|
||||
$proj->getFromDB($case->fields['plugin_processmaker_processes_id']);
|
||||
$project_type = $proj->fields['project_type'];
|
||||
|
||||
$caseMapUrl = $PM_SOAP->serverURL.(
|
||||
$project_type=='bpmn' ?
|
||||
"/designer?prj_uid=".$proj->fields['process_guid']."&prj_readonly=true&app_uid=".$case->fields['case_guid']
|
||||
:
|
||||
"/cases/ajaxListener?action=processMap"
|
||||
)."&rand=$rand";
|
||||
|
||||
$PM_SOAP->echoDomain();
|
||||
echo "<script type='text/javascript' src='".$CFG_GLPI["root_doc"]."/plugins/processmaker/js/cases.js'></script>"; //?rand=$rand'
|
||||
|
||||
$iframe = "<iframe
|
||||
id='caseiframe-caseMap'
|
||||
style='border: none;' width='100%'
|
||||
src='$caseMapUrl'
|
||||
onload=\"onOtherFrameLoad( 'caseMap', 'caseiframe-caseMap', 'body', ".($project_type=='bpmn' ? "true" : "false" )." );\">
|
||||
</iframe>";
|
||||
|
||||
$PM_SOAP->initCaseAndShowTab(['APP_UID' => $case->fields['case_guid'], 'DEL_INDEX' => 1], $iframe, $rand);
|
||||
|
||||
}
|
||||
|
||||
function getTabNameForItem(CommonGLPI $case, $withtemplate = 0) {
|
||||
return __('Map', 'processmaker');
|
||||
}
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PluginProcessmakerCasemap short summary.
|
||||
*
|
||||
* casemap description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerCasemap extends CommonDBTM {
|
||||
|
||||
static function displayTabContentForItem(CommonGLPI $case, $tabnum = 1, $withtemplate = 0) {
|
||||
global $CFG_GLPI, $PM_SOAP;
|
||||
|
||||
$rand = rand();
|
||||
|
||||
$proj = new PluginProcessmakerProcess;
|
||||
$proj->getFromDB($case->fields['plugin_processmaker_processes_id']);
|
||||
$project_type = $proj->fields['project_type'];
|
||||
|
||||
$caseMapUrl = $PM_SOAP->serverURL.(
|
||||
$project_type=='bpmn' ?
|
||||
"/designer?prj_uid=".$proj->fields['process_guid']."&prj_readonly=true&app_uid=".$case->fields['case_guid']
|
||||
:
|
||||
"/cases/ajaxListener?action=processMap"
|
||||
)."&rand=$rand";
|
||||
|
||||
$PM_SOAP->echoDomain();
|
||||
echo "<script type='text/javascript' src='".$CFG_GLPI["root_doc"]."/plugins/processmaker/js/cases.js'></script>"; //?rand=$rand'
|
||||
|
||||
$iframe = "<iframe
|
||||
id='caseiframe-caseMap'
|
||||
style='border: none;' width='100%'
|
||||
src='$caseMapUrl'
|
||||
onload=\"onOtherFrameLoad( 'caseMap', 'caseiframe-caseMap', 'body', ".($project_type=='bpmn' ? "true" : "false" )." );\">
|
||||
</iframe>";
|
||||
|
||||
$PM_SOAP->initCaseAndShowTab(['APP_UID' => $case->fields['case_guid'], 'DEL_INDEX' => 1], $iframe, $rand);
|
||||
|
||||
}
|
||||
|
||||
function getTabNameForItem(CommonGLPI $case, $withtemplate = 0) {
|
||||
return __('Map', 'processmaker');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PluginProcessmakerGlpikey short summary.
|
||||
*
|
||||
* PluginProcessmakerGlpikey description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerGlpikey extends GLPIKey {
|
||||
|
||||
protected $fields = [
|
||||
'glpi_plugin_processmaker_configs.pm_admin_passwd',
|
||||
'glpi_plugin_processmaker_configs.pm_dbserver_passwd',
|
||||
];
|
||||
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PluginProcessmakerGlpikey short summary.
|
||||
*
|
||||
* PluginProcessmakerGlpikey description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author MoronO
|
||||
*/
|
||||
class PluginProcessmakerGlpikey extends GLPIKey {
|
||||
|
||||
protected $fields = [
|
||||
'glpi_plugin_processmaker_configs.pm_admin_passwd',
|
||||
'glpi_plugin_processmaker_configs.pm_dbserver_passwd',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get fields
|
||||
*
|
||||
@@ -22,9 +22,9 @@ class PluginProcessmakerGlpikey extends GLPIKey {
|
||||
*/
|
||||
public function getFields() :array {
|
||||
return $this->fields;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Generate GLPI security key used for decryptable passwords
|
||||
* and update values in DB if necessary.
|
||||
@@ -43,6 +43,6 @@ class PluginProcessmakerGlpikey extends GLPIKey {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,133 +1,133 @@
|
||||
<?php
|
||||
|
||||
if (!defined('GLPI_ROOT')) {
|
||||
die("Sorry. You can't access directly to this file");
|
||||
}
|
||||
|
||||
|
||||
class PluginProcessmakerProfile extends CommonDBTM {
|
||||
|
||||
/**
|
||||
* Summary of getAllRights
|
||||
* @return array[]
|
||||
*/
|
||||
static function getAllRights() {
|
||||
$rights = [
|
||||
['itemtype' => 'PluginProcessmakerConfig',
|
||||
'label' => __('Process configuration', 'processmaker'),
|
||||
'field' => 'plugin_processmaker_config',
|
||||
'rights' => [READ => __('Read'), UPDATE => __('Update')]],
|
||||
['itemtype' => 'PluginProcessmakerConfig',
|
||||
'label' => __('Cases', 'processmaker'),
|
||||
'field' => 'plugin_processmaker_case',
|
||||
'rights' => [READ => __('Read'), CANCEL => __('Cancel', 'processmaker'), DELETE => __('Delete'), ADHOC_REASSIGN => __('Ad Hoc user re-assign', 'processmaker')]]
|
||||
];
|
||||
|
||||
return $rights;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Summary of showForm
|
||||
* @param mixed $ID
|
||||
* @param mixed $openform
|
||||
* @param mixed $closeform
|
||||
* @return bool
|
||||
*/
|
||||
function showForm($ID = 0, $openform = true, $closeform = true) {
|
||||
|
||||
if (!Session::haveRight("profile", READ)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$canedit = Session::haveRight("profile", UPDATE);
|
||||
$prof = new Profile();
|
||||
if ($ID) {
|
||||
$prof->getFromDB($ID);
|
||||
}
|
||||
echo "<form action='".$prof->getFormURL()."' method='post'>";
|
||||
$rights = $this->getAllRights();
|
||||
$prof->displayRightsChoiceMatrix($rights, ['canedit' => $canedit,
|
||||
'default_class' => 'tab_bg_2',
|
||||
'title' => __('ProcessMaker', 'processmaker')]);
|
||||
|
||||
if ($canedit && $closeform) {
|
||||
echo "<div class='center'>";
|
||||
echo Html::hidden('id', ['value' => $ID]);
|
||||
echo Html::submit(_sx('button', 'Save'),
|
||||
['name' => 'update']);
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
Html::closeForm();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary of createAdminAccess
|
||||
* @param mixed $ID
|
||||
*/
|
||||
static function createAdminAccess($ID) {
|
||||
self::addDefaultProfileInfos($ID, ['plugin_processmaker_config' => READ + UPDATE, 'plugin_processmaker_case' => READ + DELETE + CANCEL + ADHOC_REASSIGN], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary of getTabNameForItem
|
||||
* @param CommonGLPI $item
|
||||
* @param mixed $withtemplate
|
||||
* @return string|string[]
|
||||
*/
|
||||
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
|
||||
if ($item->getType()=='Profile') {
|
||||
return __('ProcessMaker', 'processmaker');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary of displayTabContentForItem
|
||||
* @param CommonGLPI $item
|
||||
* @param mixed $tabnum
|
||||
* @param mixed $withtemplate
|
||||
* @return bool
|
||||
*/
|
||||
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) {
|
||||
global $CFG_GLPI;
|
||||
|
||||
if ($item->getType()=='Profile') {
|
||||
$ID = $item->getID();
|
||||
$prof = new self();
|
||||
self::addDefaultProfileInfos($ID,
|
||||
['plugin_processmaker_config' => 0,
|
||||
'plugin_processmaker_case' => 0
|
||||
]);
|
||||
|
||||
$prof->showForm($ID);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $profile
|
||||
**/
|
||||
static function addDefaultProfileInfos($profiles_id, $rights, $drop_existing = false) {
|
||||
global $DB;
|
||||
$dbu = new DbUtils;
|
||||
$profileRight = new ProfileRight();
|
||||
foreach ($rights as $right => $value) {
|
||||
if ($dbu->countElementsInTable('glpi_profilerights', ['AND' => ['profiles_id' => $profiles_id, 'name' => $right]]) && $drop_existing) {
|
||||
$profileRight->deleteByCriteria(['profiles_id' => $profiles_id, 'name' => $right]);
|
||||
}
|
||||
if (!$dbu->countElementsInTable('glpi_profilerights', ['AND' => ['profiles_id' => $profiles_id, 'name' => $right]])) {
|
||||
$myright['profiles_id'] = $profiles_id;
|
||||
$myright['name'] = $right;
|
||||
$myright['rights'] = $value;
|
||||
$profileRight->add($myright);
|
||||
|
||||
//Add right to the current session
|
||||
$_SESSION['glpiactiveprofile'][$right] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
if (!defined('GLPI_ROOT')) {
|
||||
die("Sorry. You can't access directly to this file");
|
||||
}
|
||||
|
||||
|
||||
class PluginProcessmakerProfile extends CommonDBTM {
|
||||
|
||||
/**
|
||||
* Summary of getAllRights
|
||||
* @return array[]
|
||||
*/
|
||||
static function getAllRights() {
|
||||
$rights = [
|
||||
['itemtype' => 'PluginProcessmakerConfig',
|
||||
'label' => __('Process configuration', 'processmaker'),
|
||||
'field' => 'plugin_processmaker_config',
|
||||
'rights' => [READ => __('Read'), UPDATE => __('Update')]],
|
||||
['itemtype' => 'PluginProcessmakerConfig',
|
||||
'label' => __('Cases', 'processmaker'),
|
||||
'field' => 'plugin_processmaker_case',
|
||||
'rights' => [READ => __('Read'), CANCEL => __('Cancel', 'processmaker'), DELETE => __('Delete'), ADHOC_REASSIGN => __('Ad Hoc user re-assign', 'processmaker')]]
|
||||
];
|
||||
|
||||
return $rights;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Summary of showForm
|
||||
* @param mixed $ID
|
||||
* @param mixed $openform
|
||||
* @param mixed $closeform
|
||||
* @return bool
|
||||
*/
|
||||
function showForm($ID = 0, $openform = true, $closeform = true) {
|
||||
|
||||
if (!Session::haveRight("profile", READ)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$canedit = Session::haveRight("profile", UPDATE);
|
||||
$prof = new Profile();
|
||||
if ($ID) {
|
||||
$prof->getFromDB($ID);
|
||||
}
|
||||
echo "<form action='".$prof->getFormURL()."' method='post'>";
|
||||
$rights = $this->getAllRights();
|
||||
$prof->displayRightsChoiceMatrix($rights, ['canedit' => $canedit,
|
||||
'default_class' => 'tab_bg_2',
|
||||
'title' => __('ProcessMaker', 'processmaker')]);
|
||||
|
||||
if ($canedit && $closeform) {
|
||||
echo "<div class='center'>";
|
||||
echo Html::hidden('id', ['value' => $ID]);
|
||||
echo Html::submit(_sx('button', 'Save'),
|
||||
['name' => 'update']);
|
||||
echo "</div>\n";
|
||||
}
|
||||
|
||||
Html::closeForm();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary of createAdminAccess
|
||||
* @param mixed $ID
|
||||
*/
|
||||
static function createAdminAccess($ID) {
|
||||
self::addDefaultProfileInfos($ID, ['plugin_processmaker_config' => READ + UPDATE, 'plugin_processmaker_case' => READ + DELETE + CANCEL + ADHOC_REASSIGN], true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary of getTabNameForItem
|
||||
* @param CommonGLPI $item
|
||||
* @param mixed $withtemplate
|
||||
* @return string|string[]
|
||||
*/
|
||||
function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) {
|
||||
if ($item->getType()=='Profile') {
|
||||
return __('ProcessMaker', 'processmaker');
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Summary of displayTabContentForItem
|
||||
* @param CommonGLPI $item
|
||||
* @param mixed $tabnum
|
||||
* @param mixed $withtemplate
|
||||
* @return bool
|
||||
*/
|
||||
static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) {
|
||||
global $CFG_GLPI;
|
||||
|
||||
if ($item->getType()=='Profile') {
|
||||
$ID = $item->getID();
|
||||
$prof = new self();
|
||||
self::addDefaultProfileInfos($ID,
|
||||
['plugin_processmaker_config' => 0,
|
||||
'plugin_processmaker_case' => 0
|
||||
]);
|
||||
|
||||
$prof->showForm($ID);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $profile
|
||||
**/
|
||||
static function addDefaultProfileInfos($profiles_id, $rights, $drop_existing = false) {
|
||||
global $DB;
|
||||
$dbu = new DbUtils;
|
||||
$profileRight = new ProfileRight();
|
||||
foreach ($rights as $right => $value) {
|
||||
if ($dbu->countElementsInTable('glpi_profilerights', ['AND' => ['profiles_id' => $profiles_id, 'name' => $right]]) && $drop_existing) {
|
||||
$profileRight->deleteByCriteria(['profiles_id' => $profiles_id, 'name' => $right]);
|
||||
}
|
||||
if (!$dbu->countElementsInTable('glpi_profilerights', ['AND' => ['profiles_id' => $profiles_id, 'name' => $right]])) {
|
||||
$myright['profiles_id'] = $profiles_id;
|
||||
$myright['name'] = $right;
|
||||
$myright['rights'] = $value;
|
||||
$profileRight->add($myright);
|
||||
|
||||
//Add right to the current session
|
||||
$_SESSION['glpiactiveprofile'][$right] = $value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* selfservicedraft short summary.
|
||||
*
|
||||
* selfservicedraft description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author morono
|
||||
*/
|
||||
class PluginProcessmakerSelfservicedraft extends CommonDBTM {
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
/**
|
||||
* selfservicedraft short summary.
|
||||
*
|
||||
* selfservicedraft description.
|
||||
*
|
||||
* @version 1.0
|
||||
* @author morono
|
||||
*/
|
||||
class PluginProcessmakerSelfservicedraft extends CommonDBTM {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
function processmaker_install() {
|
||||
global $DB;
|
||||
|
||||
// installation from scratch
|
||||
$DB->runFile(GLPI_ROOT . "/plugins/processmaker/install/mysql/processmaker-empty.sql");
|
||||
|
||||
// add configuration singleton
|
||||
$query = "INSERT INTO `glpi_plugin_processmaker_configs` (`id`) VALUES (1);";
|
||||
$DB->query( $query ) or die("error creating default record in glpi_plugin_processmaker_configs" . $DB->error());
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
function processmaker_install() {
|
||||
global $DB;
|
||||
|
||||
// installation from scratch
|
||||
$DB->runFile(GLPI_ROOT . "/plugins/processmaker/install/mysql/processmaker-empty.sql");
|
||||
|
||||
// add configuration singleton
|
||||
$query = "INSERT INTO `glpi_plugin_processmaker_configs` (`id`) VALUES (1);";
|
||||
$DB->query( $query ) or die("error creating default record in glpi_plugin_processmaker_configs" . $DB->error());
|
||||
|
||||
}
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
function update_3_2_8_to_3_2_9() {
|
||||
global $DB;
|
||||
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_configs", "db_version")) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_configs`
|
||||
ADD COLUMN `db_version` VARCHAR(10) NULL;";
|
||||
$DB->query($query) or die("error adding db_version field to glpi_plugin_processmaker_configs" . $DB->error());
|
||||
}
|
||||
|
||||
return '3.2.9';
|
||||
|
||||
}
|
||||
<?php
|
||||
|
||||
function update_3_2_8_to_3_2_9() {
|
||||
global $DB;
|
||||
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_configs", "db_version")) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_configs`
|
||||
ADD COLUMN `db_version` VARCHAR(10) NULL;";
|
||||
$DB->query($query) or die("error adding db_version field to glpi_plugin_processmaker_configs" . $DB->error());
|
||||
}
|
||||
|
||||
return '3.2.9';
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,30 +1,30 @@
|
||||
<?php
|
||||
|
||||
function update_3_3_0_to_3_3_1() {
|
||||
global $DB;
|
||||
|
||||
// Alter table glpi_plugin_processmaker_processes
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_processes", "is_change" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_processes`
|
||||
ADD COLUMN `is_change` TINYINT(1) NOT NULL DEFAULT '0' AFTER `project_type`,
|
||||
ADD COLUMN `is_problem` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_change`,
|
||||
ADD COLUMN `is_incident` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_problem`,
|
||||
ADD COLUMN `is_request` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_incident`;";
|
||||
|
||||
$DB->query($query) or die("error adding is_change, etc... to glpi_plugin_processmaker_processes table" . $DB->error());
|
||||
|
||||
}
|
||||
|
||||
// Alter table glpi_plugin_processmaker_caselinks
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_caselinks", "is_targettoreassign" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_caselinks`
|
||||
ADD COLUMN `is_targettoreassign` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_targettoclaim`,
|
||||
ADD COLUMN `is_targettoimpersonate` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_targettoreassign`,
|
||||
ADD COLUMN `is_synchronous` TINYINT(1) NOT NULL DEFAULT '0' AFTER `externalapplication`;";
|
||||
|
||||
$DB->query($query) or die("error adding is_targettoreassign, etc... to glpi_plugin_processmaker_caselinks table" . $DB->error());
|
||||
|
||||
}
|
||||
|
||||
return '3.3.1';
|
||||
}
|
||||
<?php
|
||||
|
||||
function update_3_3_0_to_3_3_1() {
|
||||
global $DB;
|
||||
|
||||
// Alter table glpi_plugin_processmaker_processes
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_processes", "is_change" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_processes`
|
||||
ADD COLUMN `is_change` TINYINT(1) NOT NULL DEFAULT '0' AFTER `project_type`,
|
||||
ADD COLUMN `is_problem` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_change`,
|
||||
ADD COLUMN `is_incident` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_problem`,
|
||||
ADD COLUMN `is_request` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_incident`;";
|
||||
|
||||
$DB->query($query) or die("error adding is_change, etc... to glpi_plugin_processmaker_processes table" . $DB->error());
|
||||
|
||||
}
|
||||
|
||||
// Alter table glpi_plugin_processmaker_caselinks
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_caselinks", "is_targettoreassign" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_caselinks`
|
||||
ADD COLUMN `is_targettoreassign` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_targettoclaim`,
|
||||
ADD COLUMN `is_targettoimpersonate` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_targettoreassign`,
|
||||
ADD COLUMN `is_synchronous` TINYINT(1) NOT NULL DEFAULT '0' AFTER `externalapplication`;";
|
||||
|
||||
$DB->query($query) or die("error adding is_targettoreassign, etc... to glpi_plugin_processmaker_caselinks table" . $DB->error());
|
||||
|
||||
}
|
||||
|
||||
return '3.3.1';
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
function update_3_3_1_to_3_3_8() {
|
||||
global $DB;
|
||||
|
||||
// Alter table glpi_plugin_processmaker_configs
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_configs", "ssl_verify" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_configs`
|
||||
ADD COLUMN `ssl_verify` TINYINT(1) NOT NULL DEFAULT '0' AFTER `maintenance`;";
|
||||
|
||||
$DB->query($query) or die("error adding ssl_verify to glpi_plugin_processmaker_configs table" . $DB->error());
|
||||
}
|
||||
|
||||
return '3.3.8';
|
||||
<?php
|
||||
|
||||
function update_3_3_1_to_3_3_8() {
|
||||
global $DB;
|
||||
|
||||
// Alter table glpi_plugin_processmaker_configs
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_configs", "ssl_verify" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_configs`
|
||||
ADD COLUMN `ssl_verify` TINYINT(1) NOT NULL DEFAULT '0' AFTER `maintenance`;";
|
||||
|
||||
$DB->query($query) or die("error adding ssl_verify to glpi_plugin_processmaker_configs table" . $DB->error());
|
||||
}
|
||||
|
||||
return '3.3.8';
|
||||
}
|
||||
@@ -1,30 +1,30 @@
|
||||
<?php
|
||||
|
||||
function update_3_3_8_to_3_4_9() {
|
||||
global $DB;
|
||||
|
||||
// Alter table glpi_plugin_processmaker_configs
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_configs", "max_cases_per_item" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_configs`
|
||||
ADD COLUMN `max_cases_per_item` INT(11) NOT NULL DEFAULT '0' AFTER `db_version`;";
|
||||
|
||||
$DB->query($query) or die("error adding max_cases_per_item to glpi_plugin_processmaker_configs table" . $DB->error());
|
||||
}
|
||||
|
||||
// Alter table glpi_plugin_processmaker_processes
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_processes", "maintenance" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_processes`
|
||||
ADD COLUMN `maintenance` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_request`;";
|
||||
|
||||
$DB->query($query) or die("error adding maintenance to glpi_plugin_processmaker_processes table" . $DB->error());
|
||||
}
|
||||
// Alter table glpi_plugin_processmaker_processes
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_processes", "max_cases_per_item" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_processes`
|
||||
ADD COLUMN `max_cases_per_item` INT(11) NOT NULL DEFAULT '0' AFTER `maintenance`;";
|
||||
|
||||
$DB->query($query) or die("error adding max_cases_per_item to glpi_plugin_processmaker_processes table" . $DB->error());
|
||||
}
|
||||
|
||||
return '3.4.9';
|
||||
<?php
|
||||
|
||||
function update_3_3_8_to_3_4_9() {
|
||||
global $DB;
|
||||
|
||||
// Alter table glpi_plugin_processmaker_configs
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_configs", "max_cases_per_item" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_configs`
|
||||
ADD COLUMN `max_cases_per_item` INT(11) NOT NULL DEFAULT '0' AFTER `db_version`;";
|
||||
|
||||
$DB->query($query) or die("error adding max_cases_per_item to glpi_plugin_processmaker_configs table" . $DB->error());
|
||||
}
|
||||
|
||||
// Alter table glpi_plugin_processmaker_processes
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_processes", "maintenance" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_processes`
|
||||
ADD COLUMN `maintenance` TINYINT(1) NOT NULL DEFAULT '0' AFTER `is_request`;";
|
||||
|
||||
$DB->query($query) or die("error adding maintenance to glpi_plugin_processmaker_processes table" . $DB->error());
|
||||
}
|
||||
// Alter table glpi_plugin_processmaker_processes
|
||||
if (!$DB->fieldExists("glpi_plugin_processmaker_processes", "max_cases_per_item" )) {
|
||||
$query = "ALTER TABLE `glpi_plugin_processmaker_processes`
|
||||
ADD COLUMN `max_cases_per_item` INT(11) NOT NULL DEFAULT '0' AFTER `maintenance`;";
|
||||
|
||||
$DB->query($query) or die("error adding max_cases_per_item to glpi_plugin_processmaker_processes table" . $DB->error());
|
||||
}
|
||||
|
||||
return '3.4.9';
|
||||
}
|
||||
@@ -1,14 +1,14 @@
|
||||
<?php
|
||||
|
||||
function update_3_4_10_to_4_0_0() {
|
||||
global $DB;
|
||||
|
||||
// needs to change password encryption
|
||||
$pmglpikey = new PluginProcessmakerGlpikey;
|
||||
|
||||
if ($pmglpikey->migratePasswords()) {
|
||||
return '4.0.0';
|
||||
}
|
||||
|
||||
return false;
|
||||
<?php
|
||||
|
||||
function update_3_4_10_to_4_0_0() {
|
||||
global $DB;
|
||||
|
||||
// needs to change password encryption
|
||||
$pmglpikey = new PluginProcessmakerGlpikey;
|
||||
|
||||
if ($pmglpikey->migratePasswords()) {
|
||||
return '4.0.0';
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user