GLPI 9.5 compliance

Set version to 4.0.0
This commit is contained in:
Tomolimo
2021-03-18 10:01:49 +01:00
parent c895643c5c
commit 93424d51ab
36 changed files with 11047 additions and 10728 deletions

17
.gitattributes vendored
View File

@@ -1,17 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

216
.gitignore vendored
View File

@@ -1,216 +0,0 @@
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
*.pubxml
*.publishproj
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
#############
## Windows detritus
#############
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac crap
.DS_Store
#############
## Python
#############
*.py[cod]
# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg

View File

@@ -8,6 +8,8 @@ version 3.5.x is compatible with GLPI 9.3 and needs ProcessMaker 3.3.0-RE-1.x (h
version 3.6.x is compatible with GLPI 9.4 and needs ProcessMaker 3.3.0-RE-1.x (https://github.com/tomolimo/processmaker-server/releases/latest)
version 4.0.0 is compatible with GLPI 9.5 and needs ProcessMaker 3.3.0-RE-1.x (https://github.com/tomolimo/processmaker-server/releases/latest)
This plugin can run classic and bpmn processes
An IRC channel is available: #processmaker-glpi on https://webchat.freenode.net/

View File

@@ -0,0 +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);

View File

@@ -55,37 +55,29 @@ if (!isset($_REQUEST['page'])) {
}
if ($one_item < 0) {
$start = ($_REQUEST['page']-1)*$_REQUEST['page_limit'];
$LIMIT = "LIMIT $start,".$_REQUEST['page_limit'];
$start = ($_REQUEST['page'] - 1) * $_REQUEST['page_limit'];
$searchText = isset($_REQUEST['searchText']) ? $_REQUEST['searchText'] : "";
/*$result*/$res = PluginProcessmakerUser::getSqlSearchResult( $_REQUEST['specific_tags']['taskGuid'], false, $_REQUEST['right'], $_REQUEST["entity_restrict"],
$_REQUEST['value'], $used, $searchText, $LIMIT);
$res = PluginProcessmakerUser::getSqlSearchResult( $_REQUEST['specific_tags'], false, $_REQUEST['right'], $_REQUEST["entity_restrict"],
$_REQUEST['value'], $used, $searchText, $start, $_REQUEST['page_limit']);
} else {
$res = $DB->request([
'SELECT' => 'glpi_users.*',
'FIELDS' => 'glpi_users.*',
'DISTINCT' => true,
'FROM' => 'glpi_users',
'WHERE' => [
'glpi_users.id' => $one_item
]
]);
//$query = "SELECT DISTINCT `glpi_users`.*
// FROM `glpi_users`
// WHERE `glpi_users`.`id` = '$one_item';";
//$result = $DB->query($query);
}
$users = [];
// Count real items returned
$count = 0;
//if ($DB->numrows($result)) {
// while ($data = $DB->fetch_assoc($result)) {
//if ($res->numrows()) {
foreach ($res as $data) {
foreach ($res as $data) {
$users[$data["id"]] = $dbu->formatUserName($data["id"], $data["name"], $data["realname"],
$data["firstname"]);
$data["firstname"], 0);
$logins[$data["id"]] = $data["name"];
}
//}
}
$datas = [];

View File

@@ -28,7 +28,7 @@ $commoninputs = "<input type='hidden' name='items_id' value='".$_REQUEST['items_
"<input type='hidden' name='tasktype' value='".$_REQUEST['tasktype']."'>".
"<input type='hidden' name='tasks_id' value='".$_REQUEST['tasks_id']."'>";
$PM_SOAP = new PluginProcessmakerProcessmaker; // not used in this context, just here to define the type of $PM_SOAP
$PM_SOAP = new PluginProcessmakerProcessmaker;
$PM_DB = new PluginProcessmakerDB;
$rand = rand();
@@ -39,10 +39,16 @@ echo "<input type='hidden' name='comment' value=''>";
echo $commoninputs;
$can_unclaim = false; // by default
$grp = false;
$query = "SELECT TAS_GROUP_VARIABLE FROM TASK WHERE TAS_UID='".$_REQUEST['taskGuid']."' AND TAS_ASSIGN_TYPE='SELF_SERVICE';";
$res = $PM_DB->query($query);
if ($PM_DB->numrows($res) > 0) {
if ($PM_DB->numrows($res) > 0 && $row = $PM_DB->fetch_assoc($res)) {
$can_unclaim = true;
if ($row['TAS_GROUP_VARIABLE'] != '') {
//self-service value based assignment
$PM_SOAP->login(true); // needs to be logged in to be able to call SOAP
$grp = $PM_SOAP->getGLPIGroupIdForSelfServiceTask($_REQUEST['caseGuid'], $_REQUEST['taskGuid']);
}
}
PluginProcessmakerUser::dropdown( ['name' => 'users_id_recipient',
@@ -51,14 +57,15 @@ PluginProcessmakerUser::dropdown( ['name' => 'users_id_recipient',
'entity' => 0, //$item->fields["entities_id"], // not used, as any user can be assigned to any tasks
'entity_sons' => false, // not used, as any user can be assigned to any tasks
'right' => 'all',
'all' => ($can_unclaim ? 0 : -1),
'rand' => $rand,
'width' => '',
'specific_tags' => ['taskGuid' => $_REQUEST['taskGuid']]
'specific_tags' => ['taskGuid' => $_REQUEST['taskGuid'], 'grpGuid' => ($grp !== false ? $grp['uid'] : 0)]
]);
echo "&nbsp;&nbsp;";
echo "<input type='submit' name='reassign$rand' value='".__('Re-assign', 'processmaker')."' class='submit'>";
echo "<input type='submit' name='reassign' value='".__('Re-assign', 'processmaker')."' class='submit' style='display:none'>";
echo "<input type='submit' name='reassign$rand' value='".__s('Re-assign', 'processmaker')."' class='submit'>";
echo "<input type='submit' name='reassign' value='".__s('Re-assign', 'processmaker')."' class='submit' style='display:none'>";
echo HTML::scriptBlock("
$(function () {
@@ -90,7 +97,7 @@ echo HTML::scriptBlock("
hide: true
}
$('<div id=reassign$rand></div>').appendTo($('#processmaker_form_task$rand-".$_REQUEST['delIndex']."'));
var locDlg = $('#reassign$rand').html(content + '<p><textarea id=comment$rand rows=6 cols=60></textarea></p><font color=red>Input at least 10 words in English to justify.</font>').dialog(dlgContents);
var locDlg = $('#reassign$rand').html(content + '<p><textarea id=comment$rand rows=6 cols=60></textarea></p><font color=red>".addslashes(__('Input at least 10 words in English to justify.','processmaker'))."</font>').dialog(dlgContents);
$('#comment$rand').focus();
$('#comment$rand').on('keydown keyup', function(e) {
if ($('#comment$rand').val().split(/\W+/).length > 10) {
@@ -107,21 +114,25 @@ echo HTML::scriptBlock("
e.preventDefault();
if ($('input[name=users_id]').val() == $('input[name=users_id_recipient]').val()) {
// task is already assigned to this user
alert('".__('Task is already assigned to this user or group!', 'processmaker')."', '".__('Re-assign task', 'processmaker')."');
if ($('input[name=users_id]').val() == 0) {
alert('".addslashes(__('Task is already un-assigned!', 'processmaker'))."', '".addslashes(__('Re-assign task', 'processmaker'))."');
} else {
alert('".addslashes(__('Task is already assigned to this user!', 'processmaker'))."', '".addslashes(__('Re-assign task', 'processmaker'))."');
}
} else if ($('input[name=users_id_recipient]').val() == 0) {
// un-claim
if (".($can_unclaim ? 1 : 0)." && $('input[name=users_id]').val() != 0) {
showCommentDlg('".__('Un-claim task', 'processmaker')."',
'".__('Please input reason to un-claim<br/>(task will be re-assigned to former group):', 'processmaker')."',
'".__('Un-claim', 'processmaker')."');
showCommentDlg('".addslashes(__('Un-claim task', 'processmaker'))."',
'".addslashes(__('Please input reason to un-claim<br/>(task will be re-assigned to former group):', 'processmaker'))."',
'".addslashes(__('Un-claim', 'processmaker'))."');
} else {
// task can't be unclaim because it isn't SELF_SERVICE
alert('".__('Can\\\'t un-assign Task!', 'processmaker')."', '".__('Un-claim task', 'processmaker')."');
alert('".addslashes(__("Can't un-assign task!", 'processmaker'))."', '".addslashes(__('Un-claim task', 'processmaker'))."');
}
} else {
showCommentDlg('".__('Re-assign task', 'processmaker')."',
'".__('Please input reason to re-assign:', 'processmaker')."',
'".__('Re-assign', 'processmaker')."');
showCommentDlg('".addslashes(__('Re-assign task', 'processmaker'))."',
'".addslashes(__('Please input reason to re-assign:', 'processmaker'))."',
'".addslashes(__('Re-assign', 'processmaker'))."');
}
return false;
});
@@ -131,7 +142,7 @@ echo HTML::scriptBlock("
if (Session::getLoginUserID() != $_REQUEST['users_id']) {
echo "&nbsp;&nbsp;";
echo "<input type='submit' name='reminder' value='".__('Send reminder', 'processmaker')."' class='submit'>";
echo "<input type='submit' name='reminder' value='".__s('Send reminder', 'processmaker')."' class='submit'>";
}
Html::closeForm(true);

View File

@@ -5,7 +5,7 @@ include_once ("../../../inc/includes.php");
Html::header(__('ProcessMaker', 'processmaker'), $_SERVER['PHP_SELF'], "helpdesk", "PluginProcessmakerCase", "cases");
if (!$PM_SOAP->config->fields['maintenance']) {
if (Session::haveRightsOr("plugin_processmaker_case", [READ, UPDATE])) {
if (Session::haveRightsOr("plugin_processmaker_case", [READ, DELETE, CANCEL, ADHOC_REASSIGN])) {
Search::show('PluginProcessmakerCase');
} else {

View File

@@ -41,10 +41,10 @@ function processMakerShowProcessList ($ID, $from_helpdesk) {
/**
* Summary of processMakerShowCase
* @param mixed $ID
* @param mixed $users_id
* @param mixed $from_helpdesk
*/
function processMakerShowCase($ID, $from_helpdesk) {
function processMakerShowCase($users_id, $from_helpdesk) {
global $CFG_GLPI, $PM_SOAP;
$caseInfo = $PM_SOAP->getCaseInfo( $_REQUEST['case_guid'] );
@@ -62,19 +62,19 @@ function processMakerShowCase($ID, $from_helpdesk) {
// as showFormHelpdesk uses $_POST, we must set it
$_POST = $_REQUEST;
// must be using bare text
$save_rich_text = $CFG_GLPI["use_rich_text"];
$CFG_GLPI["use_rich_text"] = false;
//// must be using bare text
//$save_rich_text = $CFG_GLPI["use_rich_text"];
//$CFG_GLPI["use_rich_text"] = false;
// to get the HTML code for the helpdesk form
$saved_ob_level = ob_get_level();
ob_start();
$tkt->showFormHelpdesk($ID);
$tkt->showFormHelpdesk($users_id);
$buffer = ob_get_clean();
$CFG_GLPI["use_rich_text"] = $save_rich_text;
//$CFG_GLPI["use_rich_text"] = $save_rich_text;
// 9.1 only: hack to fix an issue with the initEditorSystem which calls scriptStart without calling scriptEnd
if (ob_get_level() > $saved_ob_level) {
@@ -93,7 +93,8 @@ function processMakerShowCase($ID, $from_helpdesk) {
// so that only the already escaped entites will get the double encoding
// will also change </b> end of bold into a local identifier
$endOfBold = 'end_of_bold'.rand();
$buffer = str_replace(['&lt;', '&gt;', '</b>'], ['<', '>', $endOfBold], $buffer);
$endOfSpan = 'end_of_span'.rand();
$buffer = str_replace(['&lt;', '&gt;', '</b>', '</span>'], ['<', '>', $endOfBold, $endOfSpan], $buffer);
// will convert any UTF-8 char that can't be expressed in ASCII into an HTML entity
$buffer = mb_convert_encoding($buffer, 'HTML-ENTITIES');
@@ -162,8 +163,8 @@ function processMakerShowCase($ID, $from_helpdesk) {
$buffer = $dom->saveHTML();
// revert back </b>
$buffer = str_replace($endOfBold, '</b>', $buffer);
// revert back </b> and </span>
$buffer = str_replace([$endOfSpan, $endOfBold], ['</span>', '</b>'], $buffer);
// will revert back any char converted above
$buffer = mb_convert_encoding($buffer, 'UTF-8', 'HTML-ENTITIES');
@@ -245,11 +246,8 @@ Html::helpHeader(__('New ticket'), $_SERVER['PHP_SELF'], $_SESSION["glpiname"]);
if (isset($_REQUEST['case_guid'])) {
$res = $DB->request(
'glpi_plugin_processmaker_cases', [
'case_guid'=>$_REQUEST['case_guid']
]);
$query = "SELECT * FROM glpi_plugin_processmaker_cases WHERE case_guid='".$_REQUEST['case_guid']."'";
$res = $DB->request('glpi_plugin_processmaker_cases', ['case_guid' => $_REQUEST['case_guid']]);
//$query = "SELECT * FROM glpi_plugin_processmaker_cases WHERE case_guid='".$_REQUEST['case_guid']."'";
//$res = $DB->query( $query );
//if ($DB->numrows( $res )) { // a ticket already exists for this case, then show new cases
if ($res->numrows()) { // a ticket already exists for this case, then show new cases

View File

@@ -124,9 +124,20 @@ function plugin_processmaker_addLeftJoin($type, $ref_table, $new_table, $linkfie
* @return void
*/
function plugin_pre_item_update_processmaker(CommonITILObject $parm) {
global $DB;//, $PM_SOAP;
//global $DB;//, $PM_SOAP;
if (isset($_SESSION['glpiname'])) { // && $parm->getType() == 'Ticket') {
// look at previous status
if (isset($parm->input['status'])
&& $parm->input['status'] == CommonITILObject::SOLVED
&& !in_array($parm->fields['status'], [CommonITILObject::SOLVED, CommonITILObject::CLOSED])
&& !PluginProcessmakerCase::canSolve(['item' => $parm])) {
$parm->input = []; // empty array... to prevent item update
Session::addMessageAfterRedirect(__('At least one \'Process case\' is running!<br/>Solving is currently disabled!', 'processmaker'), false, ERROR);
return;
}
if (isset($_SESSION['glpiname'])) {
$locVar = [ ];
foreach ($parm->input as $key => $val) {
switch ($key) {
@@ -161,7 +172,7 @@ function plugin_pre_item_update_processmaker(CommonITILObject $parm) {
$itemType = $parm->getType();
$locCase = new PluginProcessmakerCase;
foreach (PluginProcessmakerCase::getIDsFromItem($itemType, $itemId ) as $cases_id) {
foreach (PluginProcessmakerCase::getIDsFromItem($itemType, $itemId) as $cases_id) {
$locCase->getFromDB($cases_id);
$locCase->sendVariables($locVar);
@@ -242,6 +253,7 @@ function plugin_processmaker_giveItem($itemtype, $ID, $data, $num) {
return;
}
function plugin_processmaker_change_profile() {
if ($_SESSION['glpiactiveprofile']['interface'] == "helpdesk") {
// must add the rights for simplified interface

View File

@@ -98,10 +98,11 @@ class PluginProcessmakerCase extends CommonDBTM {
// count how many cases are on this item
$cnt = count(self::getIDsFromItem($itemtype, $items_id));
if ($cnt == 0) {
return ['processmakercases' => __('Process case', 'processmaker')];
$tab = self::getTypeName(2); // to force plurial for tab name
if ($cnt) {
$tab .= "<sup class='tab_nb'>$cnt</sup>";
}
return ['processmakercases' => _n('Process case', 'Process cases', $cnt, 'processmaker')."<sup class='tab_nb'>$cnt</sup>"];
return ['processmakercases' => $tab];
}
}
@@ -240,49 +241,10 @@ class PluginProcessmakerCase extends CommonDBTM {
// will unclaim the task
// to unclaim a task, we must un-assign the task in the APP_DELEGATION table
// and un-assign the task in glpi_itemtypeTask table
$groupname = '';
// should get the group that is assigned to the task in SELF_SERVICE assign type
$query = "SELECT TAS_GROUP_VARIABLE FROM TASK WHERE TAS_UID='".$taskGuid."' AND TAS_ASSIGN_TYPE='SELF_SERVICE' LIMIT 1;";
foreach($PM_DB->request($query) as $pmGroup) {
// should have only one record
if ($pmGroup['TAS_GROUP_VARIABLE'] == '') {
// then we are in the self-service with a group in the TASK_USER table
// TU_RELATION=2 is groups and TU_TYPE=1 means normal (= not adhoc)
// then get the group name from the CONTENT table
$query = "SELECT CONTENT.CON_VALUE FROM TASK_USER
JOIN CONTENT ON CONTENT.CON_ID=TASK_USER.USR_UID AND CONTENT.CON_CATEGORY='GRP_TITLE' AND CONTENT.CON_LANG = 'en'
WHERE TASK_USER.TAS_UID='".$taskGuid."' AND TASK_USER.TU_RELATION=2 AND TASK_USER.TU_TYPE=1 LIMIT 1;";
$groups_id_tech = $PM_SOAP->getGLPIGroupIdForSelfServiceTask($this->fields['case_guid'], $taskGuid);
foreach ($PM_DB->request($query) as $onlyrec) {
$groupname = $onlyrec['CON_VALUE'];
}
} else {
// then we are in the self-service with a case variable that contains either a group either an array of users
// array of users is not yet supported by PM plugin, as GLPI tasks have one and only one users_id_tech.
// group guid (in the case variable) must be retrieved from APP DATA
// TODO
////////////////////////////////////////////////////////////////
// Currently this case is not manageable by GLPI
// as GLPI needs at least a user or a group to be assigned to a task
// and when using the self-service value based assignment, there
// is a case variable that contains a list of users. This list of users cannot be mapped to a group in GLI
// OR may be we may create an artificial group in GLPI that would contains the list of users
////////////////////////////////////////////////////////////////
// and then we get the name of the group from the CONTENT table
//$query = "SELECT CON_VALUE FROM CONTENT
// WHERE CONTENT.CON_ID='$groupId' AND CONTENT.CON_CATEGORY='GRP_TITLE' AND CONTENT.CON_LANG='en' ;";
}
}
$groups_id_tech = PluginProcessmakerProcessmaker::getGLPIGroupId($groupname);
if ($groups_id_tech) {
if ($groups_id_tech !== false) {
// unclaim the case only when a GLPI group can be found
$query = "UPDATE APP_DELEGATION SET USR_UID='', DEL_INIT_DATE=NULL, USR_ID=0 WHERE APP_NUMBER=".$this->getID()." AND DEL_INDEX=$delIndex;";
@@ -296,7 +258,7 @@ class PluginProcessmakerCase extends CommonDBTM {
$glpi_task->update( ['id' => $glpi_task->getID(),
$foreignkey => $glpi_task->fields[$foreignkey],
'users_id_tech' => 0,
'groups_id_tech' => $groups_id_tech,
'groups_id_tech' => $groups_id_tech['id'],
'update' => true] );
PluginProcessmakerNotificationTargetProcessmaker::restoreNotificationState($donotif);
@@ -318,7 +280,7 @@ class PluginProcessmakerCase extends CommonDBTM {
$this->getNameID(['forceid' => true]),
DropdownTranslation::getTranslatedValue($glpi_task->fields['taskcategories_id'], 'TaskCategory', 'name', $_SESSION['glpilanguage'], $taskCat->fields['name']),
Html::clean($dbu->getUserName(isset($glpi_task->oldvalues['users_id_tech']) ? $glpi_task->oldvalues['users_id_tech'] : 0)),
Html::clean($groupname),
Html::clean($groups_id_tech['name']),
$options['comment']
);
// unescape some chars and replace CRLF, CR or LF by <br/>
@@ -784,11 +746,7 @@ class PluginProcessmakerCase extends CommonDBTM {
$items_id = $item->getField('id');
$itemtype = $item->getType();
//if (!Session::haveRight("problem", Problem::READALL)
// || !$item->can($ID, READ)) {
// return false;
//}
$canupdate = $item->can($items_id, UPDATE);
@@ -810,13 +768,6 @@ class PluginProcessmakerCase extends CommonDBTM {
]
]
]);
//$query = "SELECT gppc.`id` AS assocID, gppc.`id` as id, gppp.id as pid, gppp.name as pname, gppc.`case_status`, gppc.`plugin_processmaker_cases_id`
// FROM `glpi_plugin_processmaker_cases` as gppc
// LEFT JOIN `glpi_plugin_processmaker_processes` AS gppp ON gppp.`id`=gppc.`plugin_processmaker_processes_id`
// WHERE gppc.`itemtype` = '$itemtype'
// AND gppc.`items_id` = $items_id
// ";
//$result = $DB->query($query);
$cases = [];
$used = [];
@@ -832,17 +783,6 @@ class PluginProcessmakerCase extends CommonDBTM {
}
}
}
//if ($numrows = $DB->numrows($result)) {
// while ($data = $DB->fetch_assoc($result)) {
// $cases[$data['id']] = $data;
// $used[$data['id']] = $data['id'];
// if (isset($pid[$data['pid']])) {
// $pid[$data['pid']] += 1;
// } else {
// $pid[$data['pid']] = 1;
// }
// }
//}
$columns = ['pname' => __('Process', 'processmaker'),
'name' => __('Title', 'processmaker'),
@@ -922,11 +862,11 @@ class PluginProcessmakerCase extends CommonDBTM {
$header_end .= "</tr>";
echo $header_begin.$header_top.$header_end;
//Session::initNavigateListItems('PluginProcessmakerCase',
// //TRANS : %1$s is the itemtype name,
// // %2$s is the name of the item (used for headings of a list)
// sprintf(__('%1$s = %2$s'),
// $itemtype::getTypeName(1), $item->fields["name"]));
Session::initNavigateListItems('PluginProcessmakerCase',
//TRANS : %1$s is the itemtype name,
// %2$s is the name of the item (used for headings of a list)
sprintf(__('%1$s = %2$s'),
$itemtype::getTypeName(1), $item->fields["name"]));
$i = 0;
foreach ($cases as $data) {
@@ -940,7 +880,7 @@ class PluginProcessmakerCase extends CommonDBTM {
echo "<tr class='tab_bg_1'>";
if ($canupdate) {
echo "<td width='10'>";
// prevent massiveaction on subprocess
// show massive action only for main cases (not for subcases)
if ($data['plugin_processmaker_cases_id'] == 0) {
Html::showMassiveActionCheckBox(__CLASS__, $data["assocID"]);
}
@@ -951,7 +891,7 @@ class PluginProcessmakerCase extends CommonDBTM {
echo "<td class='center'>".self::getStatus($data['case_status'])."</td>";
echo "<td class='center'>";
if ($data['plugin_processmaker_cases_id'] > 0) {
// then this is a subprocess of
// then this is a subcase of
$maincase = new self;
if ($maincase->getFromDB($data['plugin_processmaker_cases_id'])) {
echo $maincase->getLink();
@@ -960,12 +900,11 @@ class PluginProcessmakerCase extends CommonDBTM {
echo '-';
}
echo "</td>";
//echo "<td class='center'>".Html::convDateTime($data["date_creation"])."</td>";
echo "</tr>";
$i++;
}
echo $header_begin.$header_top.$header_end;
echo $header_begin.$header_bottom.$header_end;
}
@@ -1148,20 +1087,29 @@ class PluginProcessmakerCase extends CommonDBTM {
}
//static function getIcon() {
// // return "fas fa-code-branch fa-rotate-90";
// return "fas fa-blog fa-flip-vertical";
// // return "fas fa-cogs fa-flip-vertical";
//}
/**
* Summary of getMenuContent
* @return array
*/
static function getMenuContent() {
//if (!Session::haveRightsOr('plugin_processmaker_config', [READ, UPDATE])) {
// return;
//}
if (!Session::haveRightsOr('plugin_processmaker_case', [READ, DELETE, CANCEL, ADHOC_REASSIGN])) {
return [];
}
$front_page = "/plugins/processmaker/front";
$menu = [];
$menu['title'] = self::getTypeName(Session::getPluralNumber());
$menu['page'] = "$front_page/case.php";
$menu['icon'] = "'></i><img src=\"/plugins/processmaker/pics/processmaker-xxs.png\" style=\"vertical-align: middle;\"/><i class='";
$menu['links']['search'] = PluginProcessmakerCase::getSearchURL(false);
if (Session::haveRightsOr("config", [READ, UPDATE])) {
$menu['links']['config'] = PluginProcessmakerConfig::getFormURL(false);
@@ -1547,7 +1495,7 @@ class PluginProcessmakerCase extends CommonDBTM {
}
function showForm ($ID, $options = ['candel'=>false]) {
function showForm($ID, $options = []) {
$options['colspan'] = 6;
$options['formtitle'] = sprintf( __('Case status is \'%s\'', 'processmaker'), self::getStatus($this->fields['case_status']));
@@ -1564,7 +1512,9 @@ class PluginProcessmakerCase extends CommonDBTM {
//echo '</div>' ;
Html::closeForm();
$options['candel'] = true;
$options['candel'] = $options['candel'] ?? $this->canPurgeItem($ID);
$this->showFormButtons($options);
echo Html::scriptBlock("

View File

@@ -81,7 +81,7 @@ class PluginProcessmakerConfig extends CommonDBTM {
if (empty($input["pm_dbserver_passwd"])) {
unset($input["pm_dbserver_passwd"]);
} else {
$input["pm_dbserver_passwd"] = Toolbox::encrypt(stripslashes($input["pm_dbserver_passwd"]), GLPIKEY);
$input["pm_dbserver_passwd"] = Toolbox::sodiumEncrypt(stripslashes($input["pm_dbserver_passwd"]));
}
}
@@ -93,7 +93,7 @@ class PluginProcessmakerConfig extends CommonDBTM {
if (empty($input["pm_admin_passwd"])) {
unset($input["pm_admin_passwd"]);
} else {
$input["pm_admin_passwd"] = Toolbox::encrypt(stripslashes($input["pm_admin_passwd"]), GLPIKEY);
$input["pm_admin_passwd"] = Toolbox::sodiumEncrypt(stripslashes($input["pm_admin_passwd"]));
}
}
@@ -151,7 +151,7 @@ class PluginProcessmakerConfig extends CommonDBTM {
];
$config = $PM_SOAP->config;
$config->showFormHeader(['colspan' => 4]);
$config->showFormHeader(['colspan' => 2]);
if (!$config->fields['maintenance']) {
@@ -170,7 +170,7 @@ class PluginProcessmakerConfig extends CommonDBTM {
function parseUrl( url ) {
var a = document.createElement('a');
a.href = url;
// debugger;
//debugger;
return { host: a.hostname, port: a.port, scheme: a.protocol.slice(0, -1), path: a.pathname, query: a.search.slice(1), fragment: a.hash.slice(1) } ;
}
var domain = '';
@@ -226,7 +226,6 @@ class PluginProcessmakerConfig extends CommonDBTM {
if ($config->fields['pm_server_URL'] != ''
&& $config->fields['pm_workspace'] != ''
&& $config->fields["pm_admin_user"] != ''
// && ($pm->login(true))) {
&& ($PM_SOAP->login(true))) {
echo "<font color='green'>".__('Test successful');
$setup_ok = true;
@@ -236,7 +235,7 @@ class PluginProcessmakerConfig extends CommonDBTM {
}
echo "</font></span></td></tr>\n";
echo "<tr><td colspan='4' class='center b'>".__('SQL server setup', 'processmaker')."</td></tr>";
echo "<tr><th colspan='2'>".__('SQL server setup', 'processmaker')."</th></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td >" . __('SQL server (MariaDB or MySQL)', 'processmaker') . "</td>";
@@ -268,7 +267,7 @@ class PluginProcessmakerConfig extends CommonDBTM {
}
echo "</font></span></td></tr>\n";
echo "<tr><td colspan='4' class='center b'>".__('Settings')."</td></tr>";
echo "<tr><th colspan='2' >".__('Settings')."</th></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td >".__('Theme Name', 'processmaker')."</td><td >";
@@ -284,7 +283,7 @@ class PluginProcessmakerConfig extends CommonDBTM {
echo "</td></tr>\n";
echo "<tr class='tab_bg_1'>";
echo "<td >".__('Task Writer (edit to change name)', 'processmaker')."</td><td >";
echo "<td >".__('Task writer (edit to change name)', 'processmaker')."</td><td >";
$rand = mt_rand();
User::dropdown(['name' => 'users_id',
'display_emptychoice' => true,
@@ -307,18 +306,10 @@ class PluginProcessmakerConfig extends CommonDBTM {
echo "<td >".__('Group in ProcessMaker which will contain all GLPI users', 'processmaker')."</td><td >";
$pmGroups = [ 0 => Dropdown::EMPTY_VALUE ];
//$res = $PM_DB->request([
// 'SELECT DISTINCT' => 'CON_ID',
// 'FIELDS' => 'CON_VALUE',
// 'FROM' => 'CONTENT',
// 'WHERE' => ['CON_CATEGORY' => 'GRP_TITLE'],
// 'ORDER' => 'CON_VALUE'
// ]);
//$query = "SELECT DISTINCT CON_ID, CON_VALUE FROM CONTENT WHERE CON_CATEGORY='GRP_TITLE' ORDER BY CON_VALUE;";
if ($PM_DB->connected) {
$res = $PM_DB->request([
'SELECT DISTINCT' => 'CON_ID',
'FIELDS' => 'CON_VALUE',
'DISTINCT' => 'CON_ID',
'FIELDS' => ['CON_ID', 'CON_VALUE'],
'FROM' => 'CONTENT',
'WHERE' => ['CON_CATEGORY' => 'GRP_TITLE'],
'ORDER' => 'CON_VALUE'
@@ -326,7 +317,7 @@ class PluginProcessmakerConfig extends CommonDBTM {
foreach ($res as $row) {
$pmGroups[ $row['CON_ID'] ] = $row['CON_VALUE'];
}
Dropdown::showFromArray( 'pm_group_guid', $pmGroups, ['value' => $config->fields['pm_group_guid']] );
Dropdown::showFromArray('pm_group_guid', $pmGroups, ['value' => $config->fields['pm_group_guid']]);
} else {
echo "<font color='red'>".__('Not connected');
}
@@ -338,21 +329,21 @@ class PluginProcessmakerConfig extends CommonDBTM {
echo "</td></tr>\n";
} else {
echo "<tr><td colspan='4' class='center b'>";
echo "<tr><td colspan='2' class='center b'>";
PluginProcessmakerProcessmaker::showUnderMaintenance();
echo "</td></tr>";
}
echo "<tr><td colspan='4' class='center b'>".__('Maintenance')."</td></tr>";
echo "<tr><th colspan='2'>".__('Maintenance')."</th></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td >".__('Maintenance mode')."</td><td >";
Dropdown::showYesNo("maintenance", $config->fields['maintenance']);
echo "</td></tr>";
echo "<tr><td colspan='4'></td></tr>";
echo "<tr><td colspan='2'></td></tr>";
echo "<tr><th colspan='4'>".__('Processmaker system information', 'processmaker')."</th></tr>";
echo "<tr><th colspan='2'>".__('ProcessMaker system information', 'processmaker')."</th></tr>";
if ($setup_ok) {
$info = $PM_SOAP->systemInformation( );
echo '<tr><td>'.__('Version', 'processmaker').'</td><td>'.$info->version.'</td></tr>';
@@ -367,7 +358,7 @@ class PluginProcessmakerConfig extends CommonDBTM {
} else {
echo '<tr><td>'.__('Version', 'processmaker').'</td><td>'.__('Not yet!', 'processmaker').'</td></tr>';
}
$config->showFormButtons(['candel' => false]);
$config->showFormButtons(['candel' => false, 'colspan' => 1]);
return false;
}

View File

@@ -17,7 +17,7 @@ class PluginProcessmakerDB extends DBmysql {
&& $config->fields['pm_workspace'] != '' ) {
$this->dbhost = $config->fields['pm_dbserver_name'];
$this->dbuser = $config->fields['pm_dbserver_user'];
$this->dbpassword = Toolbox::decrypt($config->fields['pm_dbserver_passwd'], GLPIKEY);
$this->dbpassword = Toolbox::sodiumDecrypt($config->fields['pm_dbserver_passwd']);
$this->dbdefault = isset($config->fields['pm_dbname']) ? $config->fields['pm_dbname'] : '';
parent::__construct();
}

48
inc/glpikey.class.php Normal file
View File

@@ -0,0 +1,48 @@
<?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
*
* @return array
*/
public function getFields() :array {
return $this->fields;
}
/**
* Generate GLPI security key used for decryptable passwords
* and update values in DB if necessary.
* @return boolean
*/
public function migratePasswords() {
global $DB;
// Fetch old key and migrate
$sodium_key = null;
$old_key = $this->getLegacyKey();
if ($DB instanceof DBmysql) {
return $this->migrateFieldsInDb($sodium_key, $old_key);
}
return false;
}
}

View File

@@ -9,7 +9,7 @@ class PluginProcessmakerMenu extends CommonGLPI {
static function getMenuContent() {
if (!Session::haveRightsOr('plugin_processmaker_config', [READ, UPDATE])) {
return;
return [];
}
$front_page = "/plugins/processmaker/front";
@@ -20,6 +20,7 @@ class PluginProcessmakerMenu extends CommonGLPI {
if (Session::haveRightsOr("config", [READ, UPDATE])) {
$menu['links']['config'] = PluginProcessmakerConfig::getFormURL(false);
}
$menu['icon'] = "'></i><img src=\"/plugins/processmaker/pics/processmaker-xxs.png\" style=\"vertical-align: middle;\"/><i class='";
$itemtypes = ['PluginProcessmakerProcess' => 'processes',
'PluginProcessmakerCaselink' => 'caselinks'

View File

@@ -45,6 +45,13 @@ class PluginProcessmakerProcess extends CommonDBTM {
}
// static function getIcon() {
//// return "fas fa-code-branch fa-rotate-90";
// return "fas fa-blog fa-flip-vertical";
//// return "fas fa-cogs fa-flip-vertical";
// }
/**
* Get default values to search engine to override
**/
@@ -525,7 +532,7 @@ class PluginProcessmakerProcess extends CommonDBTM {
'id' => '14',
'table' => 'glpi_itilcategories',
'field' => 'completename',
'name' => __('Category'),
'name' => __('Category (self-service)', 'processmaker'),
'datatype' => 'dropdown',
'massiveaction' => false
];
@@ -731,18 +738,41 @@ class PluginProcessmakerProcess extends CommonDBTM {
Dropdown::showYesNo("is_request", $this->fields["is_request"]);
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td rowspan=2>".__('Visible for Self-service interface (change ITIL Category for Self-service to enable / disable)', 'processmaker')."</td>";
echo "<td rowspan=2>".Dropdown::getYesNo($this->fields["itilcategories_id"])."</td>";
echo "<td >".__('Type for Self-service interface', 'processmaker')."</td><td>";
if (true) { // $canupdate || !$ID
$rand = Ticket::dropdownType('type',
['value' => $this->fields["type"],
]);
$params = ['type' => '__VALUE__',
'value' => $this->fields['itilcategories_id'],
'currenttype' => $this->fields['type'],
'condition' => ['is_helpdeskvisible' => '1']
];
Ajax::updateItemOnSelectEvent("dropdown_type$rand", "show_category_by_type",
$CFG_GLPI["root_doc"]."/plugins/processmaker/ajax/dropdownTicketCategories.php",
$params);
} else {
echo Ticket::getTicketTypeName($this->fields["type"]);
}
echo "</td></tr>";
echo "<tr class='tab_bg_1'>";
echo "<td >".__('ITIL Category for Self-service interface (left empty to disable)', 'processmaker')."</td><td>";
if (true) { // $canupdate || !$ID || $canupdate_descr
$opt = ['value' => $this->fields["itilcategories_id"]];
$opt['value'] = $this->fields["itilcategories_id"];
$opt['condition']['is_helpdeskvisible'] = '1';
switch ($this->fields['type']) {
case Ticket::INCIDENT_TYPE :
$opt['condition'] = "`is_incident`='1'";
$opt['condition']['is_incident'] = '1';
break;
case Ticket::DEMAND_TYPE :
$opt['condition'] = "`is_request`='1'";
$opt['condition']['is_request'] = '1';
break;
default :
@@ -750,32 +780,12 @@ class PluginProcessmakerProcess extends CommonDBTM {
}
echo "<span id='show_category_by_type'>";
if (isset($idticketcategorysearch)) {
$opt['rand'] = $idticketcategorysearch;
}
Dropdown::show('ITILCategory', $opt);
echo "</span>";
} else {
echo Dropdown::getDropdownName("glpi_itilcategories", $this->fields["itilcategories_id"]);
}
echo "<td >".__('Type for Self-service interface', 'processmaker')."</td><td>";
if (true) { // $canupdate || !$ID
$idticketcategorysearch = mt_rand(); $opt = ['value' => $this->fields["type"]];
$rand = Ticket::dropdownType('type', $opt, [], ['toupdate' => "search_".$idticketcategorysearch ]);
$opt = ['value' => $this->fields["type"]];
$params = ['type' => '__VALUE__',
//'entity_restrict' => -1, //$this->fields['entities_id'],
'value' => $this->fields['itilcategories_id'],
'currenttype' => $this->fields['type']];
Ajax::updateItemOnSelectEvent("dropdown_type$rand", "show_category_by_type",
$CFG_GLPI["root_doc"]."/ajax/dropdownTicketCategories.php",
$params);
} else {
echo Ticket::getTicketTypeName($this->fields["type"]);
}
echo "</td>";
echo "</tr>";
echo "<tr class='tab_bg_1'>";

View File

@@ -60,8 +60,7 @@ class PluginProcessmakerProcess_Profile extends CommonDBTM
echo "</div>";
}
$res = $DB->request([
'SELECT DISTINCT' => 'gpp.id AS linkID',
'FIELDS' => [
'SELECT' => [
'gpp.id AS linkID',
'glpi_profiles.id',
'glpi_profiles.name',
@@ -69,6 +68,7 @@ class PluginProcessmakerProcess_Profile extends CommonDBTM
'glpi_entities.completename',
'gpp.entities_id'
],
'DISTINCT' => true,
'FROM' => self::getTable() .' AS gpp',
'LEFT JOIN' => [
'glpi_profiles' => [
@@ -87,21 +87,6 @@ class PluginProcessmakerProcess_Profile extends CommonDBTM
'WHERE' => [ 'gpp.plugin_processmaker_processes_id' => $ID ],
'ORDER' => [ 'glpi_profiles.name', 'glpi_entities.completename' ]
]);
//$query = "SELECT DISTINCT gpp.`id` AS linkID,
// `glpi_profiles`.`id`,
// `glpi_profiles`.`name`,
// `gpp`.`is_recursive`,
// `glpi_entities`.`completename`,
// `gpp`.`entities_id`
// FROM `". self::getTable() ."` as gpp
// LEFT JOIN `glpi_profiles`
// ON (`gpp`.`profiles_id` = `glpi_profiles`.`id`)
// LEFT JOIN `glpi_entities`
// ON (`gpp`.`entities_id` = `glpi_entities`.`id`)
// WHERE `gpp`.`plugin_processmaker_processes_id` = '$ID'
// ORDER BY `glpi_profiles`.`name`, `glpi_entities`.`completename`";
//$result = $DB->query($query);
//$num = $DB->numrows($result);
$num = $res->numrows();
echo "<div class='spaced'>";
Html::openMassiveActionsForm('mass'.__CLASS__.$rand);

View File

@@ -22,7 +22,7 @@ class getVariableStruct {
}
$pmHideSolution = false;
//$pmHideSolution = false;
if (!function_exists('http_formdata_flat_hierarchy')) {
@@ -247,7 +247,7 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
}
if ($admin_or_user === true) { // admin rights has been requested, then force new login
$config = PluginProcessmakerConfig::getInstance();
$locSession = $this->pmSoapClient->login( [ 'userid' => $config->fields['pm_admin_user'], 'password' => Toolbox::decrypt($config->fields['pm_admin_passwd'], GLPIKEY)] );
$locSession = $this->pmSoapClient->login( [ 'userid' => $config->fields['pm_admin_user'], 'password' => Toolbox::sodiumDecrypt($config->fields['pm_admin_passwd'])] );
if (is_object( $locSession ) && $locSession->status_code == 0) {
$_SESSION["pluginprocessmaker"]["session"]["admin"] = true;
$_SESSION["pluginprocessmaker"]["session"]["id"] = $locSession->message;
@@ -273,7 +273,7 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
$pmusr->getFromDB($gusr->getID());
//if (!isset($pmusr->fields['password']) || $pmusr->fields['password'] == "") {
if (is_object($pmusr) && array_key_exists('pm_users_id', $pmusr->fields)) {
$pass = md5(Toolbox::encrypt( $gusr->getID().$gusr->getName().time(), GLPIKEY) );
$pass = md5(Toolbox::sodiumEncrypt($gusr->getID().$gusr->getName().time()));
//$pmusr->update( array('id' => $pmusr->getID(), 'password' => $pass) );
// and must be updated also in PM db
$PM_DB->update('RBAC_USERS', ['USR_PASSWORD' => $pass], ['USR_UID' => $pmusr->fields['pm_users_id']]);
@@ -1280,9 +1280,9 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
//if($pmgrp_key = array_search($PM_SOAP->pm_group_guid, array_column($pmGroupList, 'guid'))) {
// $pmgroup = $pmGroupList[$pmgrp_key];
//}
foreach ($pmGroupList as $pmGroupList) {
if ($pmGroupList->guid == $PM_SOAP->pm_group_guid) {
$pmGroup = $pmGroupList;
foreach ($pmGroupList as $pmGrp) {
if ($pmGrp->guid == $PM_SOAP->pm_group_guid) {
$pmGroup = $pmGrp;
break; // to get the name :)
}
}
@@ -1313,8 +1313,8 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
if ($user['is_active'] != 0 && $user['is_deleted'] != 1) {
$status = "ACTIVE";
$task->addVolume(1);
$pass = substr( Toolbox::encrypt($user['id'].$user['name'].time(), GLPIKEY), 0, 20);
$pmResult = $PM_SOAP->createUser( $user['name'], $user['firstname'], $user['realname'], "", "PROCESSMAKER_OPERATOR", $pass, $status);
$pass = md5(Toolbox::sodiumEncrypt($user['id'].$user['name'].time()));
$pmResult = $PM_SOAP->createUser($user['name'], $user['firstname'], $user['realname'], "", "PROCESSMAKER_OPERATOR", $pass, $status);
if ($pmResult->status_code == 0) {
$task->log( "Added user: '".$user['name']."'" );
@@ -1352,13 +1352,19 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
// now should refresh the existing users
$arrayIntersect = array_intersect_key( $glpiUserList, $pmUserList );
foreach ($arrayIntersect as $user) {
if ($user['pmUserId'] == null || ($user['pmUserId'] != $pmUserList[strtolower($user['name'])]['guid'])) { //must be inserted into DB
// insert into DB the link between glpi users and pm user
$pmuserlistGuid = $pmUserList[strtolower($user['name'])]['guid'];
if ($user['pmUserId'] == null || ($user['pmUserId'] != $pmuserlistGuid)) { //must be deleted, inserted or updated into DB
$existingID = PluginProcessmakerUser::getGLPIUserId($pmuserlistGuid);
$pmuser = new PluginProcessmakerUser;
if ($existingID && $existingID != $user['id']) {
// there is already an existing record, must delete it before updating or adding
$ret = $pmuser->delete( [ 'id' => $existingID, 'pm_users_id' => $pmuserlistGuid ] );
}
// insert into DB the link between glpi users and pm user
if ($pmuser->getFromDB( $user['id'] )) {
$ret = $pmuser->update( [ 'id' => $user['id'], 'pm_users_id' => $pmUserList[strtolower($user['name'])]['guid'] ] );
$ret = $pmuser->update( [ 'id' => $user['id'], 'pm_users_id' => $pmuserlistGuid ] );
} else {
$ret = $pmuser->add( [ 'id' => $user['id'], 'pm_users_id' => $pmUserList[strtolower($user['name'])]['guid'] ] );
$ret = $pmuser->add( [ 'id' => $user['id'], 'pm_users_id' => $pmuserlistGuid ] );
}
//$query = "REPLACE INTO glpi_plugin_processmaker_users (glpi_users_id, pm_users_id) VALUES (".$user['id'].", '". $pmUserList[strtolower($user['name'])]['guid']."');" ;
@@ -1517,7 +1523,7 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
$caseresetvariables['GLPI_ITEM_DUE_DATE'] = '';
}
$re = '/^(?\'date\'[0-9]{4}-[0-1][0-9]-[0-3][0-9])( (?\'time\'[0-2][0-9]:[0-5][0-9]:[0-5][0-9]))*$/';
if (preg_match($re, $parm->input['time_to_resolve'], $matches) && !array_key_exists('time', $matches)) {
if (isset($parm->input['time_to_resolve']) && preg_match($re, $parm->input['time_to_resolve'], $matches) && !array_key_exists('time', $matches)) {
$parm->input['time_to_resolve'] .= " 23:59:59";
}
@@ -1670,9 +1676,8 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
* @param $items_id integer item id to which a task will be added
* @param $caseInfo mixed getCaseInfoResponse object (see: getCaseInfo() function)
* @param $delIndex integer index of the delegation
* @param $techId integer GLPI user id to which a task must be assigned, if == 0 will use $groupId and/or $pmTaskId
* @param $groupId string PM group guid to assign to task, used when $techId == 0
* @param $pmTaskId string PM task guid, used when $groupId == 0 AND $techID == 0
* @param $techId integer GLPI user id to which a task must be assigned, if == 0 will use $pmTaskId
* @param $pmTaskId string PM task guid, used when $techID == 0 to dynamically find the group (Self-Service)
* @param $options array of options, default values are
* 'txtTaskContent' => '',
* 'start_date' => '',
@@ -1680,7 +1685,7 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
* 'notif' => true
* @return
*/
public function addTask($cases_id, $itemtype, $items_id, $caseInfo, $delIndex, $techId, $groupId, $pmTaskId, $delThread, $options = []) {
public function addTask($cases_id, $itemtype, $items_id, $caseInfo, $delIndex, $techId, $pmTaskId, $delThread, $options = []) {
global $DB, $PM_DB, $_SESSION;
$dbu = new DbUtils;
@@ -1739,77 +1744,9 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
$input['users_id'] = $this->taskWriter;
// manage groups
$groups_id_tech = 0;
if ($techId == 0) { // then we must look-up DB to get the group that will be assigned to the task
$groupname='';
if ($groupId == 0) {
// TU_RELATION=2 is groups and TU_TYPE=1 means normal (= not adhoc)
$res = $PM_DB->request([
'SELECT' => 'CONTENT.CON_VALUE',
'FROM' => 'TASK_USER',
'INNER JOIN' => [
'CONTENT' => [
'AND' => [
'FKEY' => [
'CONTENT' => 'CON_ID',
'TASK_USER' => 'USR_UID'
],
['CONTENT.CON_CATEGORY' => 'GRP_TITLE'],
['CONTENT.CON_LANG' => 'en']
]
]
],
'WHERE' => [
'AND' => [
'TASK_USER.TAS_UID' => $pmTaskId,
'TASK_USER.TU_RELATION' => 2,
'TASK_USER.TU_TYPE' => 1
]
],
'LIMIT' => 1
]);
//$query = "SELECT CONTENT.CON_VALUE FROM TASK_USER
// JOIN CONTENT ON CONTENT.CON_ID=TASK_USER.USR_UID AND CONTENT.CON_CATEGORY='GRP_TITLE' AND CONTENT.CON_LANG = 'en'
// WHERE TASK_USER.TAS_UID='$pmTaskId' AND TASK_USER.TU_RELATION=2 LIMIT 1;";
} else {
$res = $PM_DB->request([
'SELECT' => 'CON_VALUE',
'FROM' => 'CONTENT',
'WHERE' => [
'AND' => [
'CONTENT.CON_ID' => $groupId,
'CONTENT.CON_CATEGORY' => 'GRP_TITLE',
'CONTENT.CON_LANG' => 'en'
]
]
]);
//$query = "SELECT CON_VALUE FROM CONTENT
// WHERE CONTENT.CON_ID='$groupId' AND CONTENT.CON_CATEGORY='GRP_TITLE' AND CONTENT.CON_LANG='en' ;";
}
// as there is a LIMIT of 1
// or
// as there is only one group per guid
// then we should have at maximun 1 record
foreach ($res as $onlyrec) {
//foreach ($PM_DB->request($query) as $onlyrec) {
$groupname = $onlyrec['CON_VALUE'];
}
$res = $DB->request([
'SELECT' => 'id AS glpi_group_id',
'FROM' => 'glpi_groups',
'WHERE' => ['name' => ['LIKE', $groupname]]
]);
if ($row = $res->next()) {
$groups_id_tech = $row['glpi_group_id'];
}
//$query = "SELECT id AS glpi_group_id FROM glpi_groups WHERE name LIKE '$groupname';";
//$res = $DB->query($query);
//if ($DB->numrows($res) > 0) {
// $row = $DB->fetch_array( $res );
// $groups_id_tech = $row['glpi_group_id'];
//}
if ($techId == 0) {
// then we must look-up DB to get the group that will be assigned to the task
$groups_id_tech = $this->getGLPIGroupIdForSelfServiceTask($caseInfo->caseId, $pmTaskId);
} else {
// adds the user tech to ticket watcher if neccessary
self::addWatcher( $itemtype, $items_id, $techId );
@@ -1836,8 +1773,8 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
$input['users_id_tech'] = 0; // by default as it can't be empty
if ($techId) {
$input['users_id_tech'] = $techId;
} else if ($groups_id_tech) {
$input['groups_id_tech'] = $groups_id_tech;
} else if (is_array($groups_id_tech)) {
$input['groups_id_tech'] = $groups_id_tech['id'];
}
if ($options['reminder'] != '' && $techId) {
@@ -1881,34 +1818,17 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
// send notification if needed for new task as now we have the PluginProcessmakerTask in the DB
$donotif = PluginProcessmakerNotificationTargetProcessmaker::saveNotificationState($options['notif']);
// Notification management
$item = new $itemtype;
$item->getFromDB($items_id);
// search if at least one active notification is existing for that pm task with that event 'task_update_'.$glpi_task->fields['taskcategories_id']
$res = PluginProcessmakerNotificationTargetTask::getNotifications('task_add', $glpi_task->fields['taskcategories_id'], $item->fields['entities_id']);
if ($res['notifications'] && count($res['notifications']) > 0) {
// send notification now!
$pm_task = new PluginProcessmakerTask($glpi_task->getType());
$pm_task->getFromDB($glpi_task->getId());
NotificationEvent::raiseEvent($res['event'],
$pm_task,
['plugin_processmaker_cases_id' => $cases_id,
'itemtype' => $glpi_task->getType(),
'task_id' => $glpi_task->getID(),
'is_private' => isset($glpi_task->fields['is_private']) ? $glpi_task->fields['is_private'] : 0,
'entities_id' => $item->fields['entities_id']
]);
} else {
NotificationEvent::raiseEvent('add_task',
$item,
['plugin_processmaker_cases_id' => $cases_id,
'itemtype' => $itemtype,
'task_id' => $glpi_task->getID(),
'is_private' => isset($glpi_task->fields['is_private']) ? $glpi_task->fields['is_private'] : 0
]);
}
$glpi_item = new $itemtype;
$glpi_item->getFromDB($items_id);
$pm_task->sendNotification('task_add', $glpi_task, $glpi_item);
PluginProcessmakerNotificationTargetProcessmaker::restoreNotificationState($donotif);
}
}
@@ -1921,12 +1841,14 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
*/
static function getGLPIGroupId(string $pmGroupName) {
global $DB;
if ($pmGroupName != '') {
$query = "SELECT id AS glpi_group_id FROM glpi_groups WHERE name LIKE '$pmGroupName';";
$res = $DB->query($query);
if ($DB->numrows($res) > 0) {
$row = $DB->fetch_array($res);
return $row['glpi_group_id'];
}
}
return false;
}
@@ -1967,7 +1889,6 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
$caseInfo,
$caseInfo->currentUsers[0]->delIndex,
$userId,
0,
$caseInfo->currentUsers[0]->taskId,
$caseInfo->currentUsers[0]->delThread,
$options
@@ -2187,29 +2108,12 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
// send notification if needed for new task as now the PluginProcessmakerTask has been updated in the DB
$donotif = PluginProcessmakerNotificationTargetProcessmaker::saveNotificationState($options['notif']);
// Notification management
// search if at least one active notification is existing for that pm task with that event 'task_update_'.$glpi_task->fields['taskcategories_id']
$res = PluginProcessmakerNotificationTargetTask::getNotifications('task_done', $glpi_task->fields['taskcategories_id'], $hostItem->fields['entities_id']);
if ($res['notifications'] && count($res['notifications']) > 0) {
// send notification now!
$pm_task = new PluginProcessmakerTask($glpi_task->getType());
$pm_task->getFromDB($glpi_task->getId());
NotificationEvent::raiseEvent($res['event'],
$pm_task,
['plugin_processmaker_cases_id' => $cases_id,
'itemtype' => $glpi_task->getType(),
'task_id' => $glpi_task->getID(),
'is_private' => isset($glpi_task->fields['is_private']) ? $glpi_task->fields['is_private'] : 0,
'entities_id' => $hostItem->fields['entities_id']
]);
} else {
NotificationEvent::raiseEvent('update_task',
$hostItem,
['plugin_processmaker_cases_id' => $cases_id,
'itemtype' => $hostItem->getType(),
'task_id' => $glpi_task->getID(),
'is_private' => isset($glpi_task->fields['is_private']) ? $glpi_task->fields['is_private'] : 0
]);
}
$pm_task->sendNotification('task_done', $glpi_task, $hostItem);
PluginProcessmakerNotificationTargetProcessmaker::restoreNotificationState($donotif);
// restore current glpi time
@@ -2368,7 +2272,13 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
// look if it is a meta task for this process
// means a re-assign or an un-claim task info
$pm_process = new PluginProcessmakerProcess;
if ($pm_process->getFromDBByQuery( " WHERE `taskcategories_id` = ".$params['item']->fields['taskcategories_id'])) {
$restrict=[
'WHERE' => [
'taskcategories_id' => $params['item']->fields['taskcategories_id']
],
];
//if ($pm_process->getFromDBByQuery( " WHERE `taskcategories_id` = ".$params['item']->fields['taskcategories_id'])) {
if ($pm_process->getFromDBByRequest($restrict)) {
// then look into content to get case id
$re = '/<input name=\'caseid\' type=\'hidden\' value=\'(?\'caseid\'\d+)\'><input name=\'taskid\' type=\'hidden\' value=\'(?\'taskid\'\d+)\'>/';
if (preg_match($re, $params['item']->fields['content'], $matches)) {
@@ -2390,27 +2300,22 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
} else {
$params['item']->fields['content'] = str_replace( '##processmaker.taskcomment##', $taskComment, $params['item']->fields['content'] );
}
$taskJSId = strtolower("viewitem".$params['item']->getType().$params['item']->getId());
// special case for <hr> which will provoke the rendering to be split into several <p>
// add <p></p> which othervise will be missing
if (stripos($params['item']->fields['content'], '<hr>') !== false) {
$params['item']->fields['content'] = str_ireplace('<hr>', '<hr><p>', $params['item']->fields['content']).'</p>';
}
$taskJSId = strtolower("viewitem".$params['item']->getType().$params['item']->getId()); //.$params['options']['rand']);
$tmpCase = new PluginProcessmakerCase;
$tmpCase->getFromDB($pmTask->fields['plugin_processmaker_cases_id']);
$urlLink = $tmpCase->getLinkURL().'&forcetab=PluginProcessmakerTask$'.$pmTask->fields['items_id'];
echo Html::scriptBlock( "
$('#$taskJSId').find('.item_content').children().not('.read_more').on('click', function ( ) {
function $taskJSId(ev) {
//debugger;
document.location='$urlLink'
} ).css('cursor', 'pointer') ;
$('tr[id=\"$taskJSId\"]').children().on('click', function ( ) {
//debugger;
document.location='$urlLink'
} ).css('cursor', 'pointer') ;
if ($(ev.target).parent('.read_more').length == 0) {
document.location='$urlLink';
}
};
$('#$taskJSId').find('.item_content').on('click', $taskJSId).css('cursor', 'pointer');
$('#$taskJSId').find('.read_more').css('cursor', 'auto');
$('tr[id=\"$taskJSId\"]').children().on('click', $taskJSId).css('cursor', 'pointer');
");
$params['item']->fields['content'] = str_replace( ["\n##processmakercase.url##", '\n##processmakercase.url##', '##processmakercase.url##'], "", $params['item']->fields['content'] );
@@ -2425,130 +2330,64 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
}
}
/**
* Summary of pre_show_tab_arbehaviours
* @param array $params info about tab to be shown
* @return void
*/
static function pre_show_tab_processmaker($params) {
global $pmHideSolution;
//global $pmHideSolution;
$plugin = new Plugin();
$itemtype = $params['item']->getType();
switch ($itemtype) {
case 'Ticket':
case 'Problem':
case 'Change':
if ($params['options']['id'] && $params['options']['itemtype'] == $itemtype) {
if (in_array($itemtype, ['Ticket', 'Problem', 'Change'])
&& $params['options']['id']
&& $params['options']['itemtype'] == $itemtype
&& $params['options']['tabnum'] == 1
&& !PluginProcessmakerCase::canSolve($params)
&& Session::getCurrentInterface() == "central") {
// then we are in an ITIL Object
if (isset($_SESSION['glpiactiveprofile']['interface']) && $_SESSION['glpiactiveprofile']['interface'] != "helpdesk") {
$tabnum = $params['options']['tabnum'];
// tabnum 1 : Processing Ticket, tabnum 2 : Solution
// tabnum 1 : Processing Ticket
// a case may be solved or not (ex: PIR tasks for Change Management)
if ($tabnum == 2 or $tabnum == 1) {
// we must check if we can solve item even if PM case is still running (ex: PIR tasks for Change Management)
$pmCanSolve = PluginProcessmakerCase::canSolve( $params );
if (!$pmCanSolve) {
// don't display message if arbehaviours is install and activated
if (!$plugin->isInstalled('arbehaviours') || !$plugin->isActivated('arbehaviours')) {
$messageOne = __('A \'Case\' is running!', 'processmaker');
$messageTwo = __('You must manage it first (see \'Process - Case\' tab)!', 'processmaker');
// output explicit message to explain why it's not possible to add solution
$message = "<div style='margin-bottom: 20px;' class='box'>
<div class='box-tleft'>
<div class='box-tright'>
<div class='box-tcenter'>
</div>
</div>
</div>
<div class='box-mleft'>
<div class='box-mright'>
<div class='box-mcenter'>
<h3>
<span class='red'>".$messageOne."
<br>
</span>
</h3>
<h3>
<span >".$messageTwo."
</span>
</h3>
</div>
</div>
</div>
<div class='box-bleft'>
<div class='box-bright'>
<div class='box-bcenter'>
</div>
</div>
</div>
</div> ";
}
$pmHideSolution = true;
$itemtype = strtolower($itemtype);
if ($tabnum == 1 && isset($_SESSION['glpiactiveprofile'][$itemtype.'_status'])) {
// don't display message if arbehaviours is install and activated
if (!$plugin->isInstalled('arbehaviours') || !$plugin->isActivated('arbehaviours')) {
self::displayMessage($message, '', WARNING);
if ((!$plugin->isInstalled('arbehaviours') || !$plugin->isActivated('arbehaviours'))
&& isset($_SESSION['glpiactiveprofile'][$itemtype.'_status'])) {
//save current $_SESSION['glpiactiveprofile'][$itemtype.'_status'']
$_SESSION['glpiactiveprofile'][$itemtype.'_status_save'] = $_SESSION['glpiactiveprofile'][$itemtype.'_status'];
// for all $params['options']['itemtype']. status, disable solved ( life cycles )
foreach ($_SESSION['glpiactiveprofile'][$itemtype.'_status'] as $key => $value) {
$_SESSION['glpiactiveprofile'][$itemtype.'_status'][$key][CommonITILObject::SOLVED] = 0;
}
}
} else {
// then output a new div and hide solution for content
echo $message;
echo "<div id='toHideSolution' style='display: none;'>";
}
}
echo Html::scriptBlock("
//$('head').append('<style type=\"text/css\">li.solution {pointer-events:none; opacity:0.3;}</style>');
debugger;
$('li.solution').css({pointerEvents: 'none', opacity: 0.3});
");
self::displayMessage(__('At least one \'Process case\' is running!<br/>Adding a solution is currently disabled!', 'processmaker'), false, INFO);
////backup current $_SESSION['glpiactiveprofile'][$itemtype.'_status']
//$_SESSION['glpiactiveprofile'][$itemtype.'_status_pm_save'] = $_SESSION['glpiactiveprofile'][$itemtype.'_status'];
//// for all $params['options']['itemtype'].status, we must disable solved (life cycles)
//foreach ($_SESSION['glpiactiveprofile'][$itemtype.'_status'] as $key => $value) {
// //$_SESSION['glpiactiveprofile'][$itemtype.'_status'][$key][CommonITILObject::SOLVED] = 0;
//}
}
}
}
}
}
//public static function post_show_tab_processmaker($params) {
public static function post_show_tab_processmaker($params) {
global $pmHideSolution;
// //$itemtype = strtolower($params['item']->getType());
// //if (isset($_SESSION['glpiactiveprofile'][$itemtype.'_status_pm_save'])) {
// // // we must restore rigths
// // // replace $_SESSION['glpiactiveprofile'][$itemtype.'_status'] with saved value
$itemtype = $params['item']->getType();
switch ($itemtype) {
// // $_SESSION['glpiactiveprofile'][$itemtype.'_status'] = $_SESSION['glpiactiveprofile'][$itemtype.'_status_pm_save'];
// // unset($_SESSION['glpiactiveprofile'][$itemtype.'_status_save']);
// //}
case 'Ticket':
case 'Problem':
case 'Change':
if ($params['options']['id']) {
// then we are in an itil object
if (isset($_SESSION['glpiactiveprofile']['interface']) && $_SESSION['glpiactiveprofile']['interface'] != "helpdesk") {
$tabnum = $params['options']['tabnum'];
if ($tabnum == 2 or $tabnum == 1) {
// then we are showing the Solution tab or Processing Ticket tab
if ($pmHideSolution) {
echo "</div>";
}
$itemtype = strtolower($itemtype);
// replace $_SESSION['glpiactiveprofile'][$itemtype.'_status'] with saved value
if ($tabnum == 1 && isset($_SESSION['glpiactiveprofile'][$itemtype.'_status_save'])) {
$_SESSION['glpiactiveprofile'][$itemtype.'_status'] = $_SESSION['glpiactiveprofile'][$itemtype.'_status_save'];
}
}
}
}
break;
}
}
//}
/**
@@ -2597,7 +2436,7 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
*/
public function saveForm($request) {
$loggable = false;
$logtrace = false; //isset($_SESSION['glpi_use_mode']) && ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE);
$request = stripcslashes_deep( $request );
$ch = curl_init();
@@ -2610,7 +2449,15 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
//curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if ($logtrace) {
curl_setopt($ch, CURLOPT_VERBOSE, 1);
$curl_log = fopen('L:/inetpub/wwwroot/glpi/files/_log/curl.log', 'a');
Toolbox::logInFile( "pmtrace", "curl log file open: ".$curl_log );
fprintf($curl_log, "Test\n");
fflush($curl_log);
curl_setopt($ch, CURLOPT_STDERR, $curl_log);
}
curl_setopt($ch, CURLOPT_HTTPHEADER, ["Expect:"]);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, $this->config->fields['ssl_verify']);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, $this->config->fields['ssl_verify']);
@@ -2622,9 +2469,12 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
// ### first call to open case and get cookies GET ###
curl_setopt($ch, CURLOPT_URL, $this->serverURL."/cases/cases_Open?sid=".$this->getPMSessionID()."&APP_UID=".$request['APP_UID']."&DEL_INDEX=".$request['DEL_INDEX']."&action=TO_DO" );
$response = curl_exec ($ch);
if ($loggable) {
Toolbox::logInFile( "pmtrace", "URL:\n".$this->serverURL."/cases/cases_Open?sid=".$this->getPMSession()."\nResponse:\n".$response."\n\n\n" );
if ($logtrace) {
Toolbox::logInFile( "pmtrace", "Before curl_exec: ".$this->serverURL."/cases/cases_Open?sid=".$this->getPMSessionID()."&APP_UID=".$request['APP_UID']."&DEL_INDEX=".$request['DEL_INDEX']."&action=TO_DO" );
}
$response = curl_exec($ch);
if ($logtrace) {
Toolbox::logInFile( "pmtrace", "URL:\n".$this->serverURL."/cases/cases_Open?sid=".$this->getPMSessionID()."\nResponse:\n".$response."\n\n\n" );
}
// change option to indicate that the next call will be POST
@@ -2668,8 +2518,9 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
Toolbox::logInFile( "pmtrace", curl_error($ch).":".curl_errno($ch)."\n" );
}
curl_close ($ch);
if ($loggable) {
if ($logtrace) {
Toolbox::logInFile( "pmtrace", "URL:\n".$this->serverURL."/cases/cases_SaveData?UID=".$request['UID']."&APP_UID=".$request['APP_UID']."\nData:\n".print_r($data, true )."\nResponse:\n".$response."\n\n\n" );
fclose($curl_log);
}
return ($response ? true : false);
@@ -2833,9 +2684,8 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
//if (strlen( $entityAncestors ) > 0) {
if ($category > 0) {
$query = [
'SELECT DISTINCT' => ['glpi_plugin_processmaker_processes.id' ],
'FIELDS' => ['glpi_plugin_processmaker_processes.name'],
//'DISTINCT' => true,
'FIELDS' => ['glpi_plugin_processmaker_processes.id', 'glpi_plugin_processmaker_processes.name'],
'DISTINCT' => true,
'FROM' => 'glpi_plugin_processmaker_processes',
'INNER JOIN' => [
'glpi_plugin_processmaker_processes_profiles' => [
@@ -2990,13 +2840,17 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
//$cookies,
global $PM_DB, $CFG_GLPI, $DB;
$logtrace = false; //isset($_SESSION['glpi_use_mode']) && ($_SESSION['glpi_use_mode'] == Session::DEBUG_MODE);
$itemtype = $myCase->getField('itemtype');
$items_id = $myCase->getField('items_id');
$item = new $itemtype;
$item->getFromDB($items_id);
//Toolbox::logInFile("processmaker_derivate", Toolbox::backtrace(false) . "derivateCase: myCase = " . print_r($myCase, true) . "\nrequest = " . print_r($request, true) . "\nusers_id = " . print_r($users_id, true) );
if ($logtrace) {
Toolbox::logInFile("pmtrace", Toolbox::backtrace(false) . "derivateCase: myCase = " . print_r($myCase, true) . "\nrequest = " . print_r($request, true) . "\nusers_id = " . print_r($users_id, true) );
}
// save the dynaform variables into the current case
if (isset($request['UID']) && isset($request['APP_UID']) && isset($request['__DynaformName__'])) {
$resultSave = $this->saveForm( $request );
@@ -3004,7 +2858,9 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
// now derivate the case !!!
$pmRouteCaseResponse = $this->routeCase($myCase->fields['case_guid'], $request['DEL_INDEX']);
//Toolbox::logInFile("processmaker_derivate", "routeCase: pmRouteCaseResponse = " . print_r($pmRouteCaseResponse, true));
if ($logtrace) {
Toolbox::logInFile("pmtrace", "routeCase: pmRouteCaseResponse = " . print_r($pmRouteCaseResponse, true));
}
if ($pmRouteCaseResponse->status_code != 0) {
Session::addMessageAfterRedirect(sprintf(__('Unable to derivate case! Retry in a moment, or ask your administrator.<hr>Error code: %u<br/>Error message: %s<br/>', 'processmaker'),
@@ -3017,8 +2873,8 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
$casevariables = ["GLPI_ITEM_TASK_CONTENT",
"GLPI_ITEM_APPEND_TO_TASK",
"GLPI_NEXT_GROUP_TO_BE_ASSIGNED",
"GLPI_ITEM_TASK_GROUP",
//"GLPI_NEXT_GROUP_TO_BE_ASSIGNED",
//"GLPI_ITEM_TASK_GROUP",
"GLPI_ITEM_TITLE",
"GLPI_TICKET_FOLLOWUP_CONTENT",
"GLPI_ITEM_FOLLOWUP_CONTENT",
@@ -3079,13 +2935,13 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
$txtTaskContent = $casevariablevalues[ 'GLPI_ITEM_TASK_CONTENT' ];
}
$groupId = 0;
if (array_key_exists( 'GLPI_NEXT_GROUP_TO_BE_ASSIGNED', $casevariablevalues )) {
$groupId = $casevariablevalues[ 'GLPI_NEXT_GROUP_TO_BE_ASSIGNED' ];
}
if (array_key_exists( 'GLPI_ITEM_TASK_GROUP', $casevariablevalues )) {
$groupId = $casevariablevalues[ 'GLPI_ITEM_TASK_GROUP' ];
}
//$groupId = 0;
//if (array_key_exists( 'GLPI_NEXT_GROUP_TO_BE_ASSIGNED', $casevariablevalues )) {
// $groupId = $casevariablevalues[ 'GLPI_NEXT_GROUP_TO_BE_ASSIGNED' ];
//}
//if (array_key_exists( 'GLPI_ITEM_TASK_GROUP', $casevariablevalues )) {
// $groupId = $casevariablevalues[ 'GLPI_ITEM_TASK_GROUP' ];
//}
$taskStartDate = '';
$taskEndDate = '';
@@ -3277,7 +3133,6 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
$sub_caseInfo,
$sub_route->delIndex,
PluginProcessmakerUser::getGLPIUserId($sub_route->userId),
0,
$sub_route->taskId,
$sub_route->delThread,
[ 'txtTaskContent' => $txtTaskContent,
@@ -3354,16 +3209,15 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
}
} else {
$this->addTask( $myCase->getID(), $itemtype,
$this->addTask($myCase->getID(),
$itemtype,
$items_id,
$caseInfo,
$route->delIndex,
PluginProcessmakerUser::getGLPIUserId( $route->userId ),
$groupId,
PluginProcessmakerUser::getGLPIUserId($route->userId),
$route->taskId,
$route->delThread,
[ 'txtTaskContent' => $txtTaskContent,
['txtTaskContent' => $txtTaskContent,
'start_date' => $taskStartDate,
'end_date' => $taskEndDate,
'reminder' => $taskReminder]
@@ -3416,7 +3270,6 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
$parentCaseInfo,
$open_task->delIndex,
PluginProcessmakerUser::getGLPIUserId($open_task->userId),
$groupId,
$open_task->taskId,
$open_task->delThread,
[ 'txtTaskContent' => $txtTaskContent,
@@ -3488,15 +3341,15 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
//set title and css class
switch ($msgtype) {
case ERROR:
$title = __('Error');
$title = __s('Error');
$class = 'err_msg';
break;
case WARNING:
$title = __('Warning');
$title = __s('Warning');
$class = 'warn_msg';
break;
case INFO:
$title = __('Information');
$title = _sn('Information', 'Information', 1);
$class = 'info_msg';
break;
}
@@ -3506,7 +3359,7 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
echo "</div>";
$scriptblock = "
$(document).ready(function() {
$(function() {
var _of = window;
var _at = 'right-20 bottom-20';
//calculate relative dialog position
@@ -3598,4 +3451,76 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
echo Html::scriptBlock($script);
}
}
/**
* Summary of getGLPIGroupIDForSelfServiceTask
* Gets GLPI group ID that is assigned to a task for a case when task is Self-Service
* @param string $caseId is the UID of the case
* @param string $pmTaskId is the UID of the task must be currently in SELF-SERVICE
* @return bool|array false if not found, otherwise is an array containing the 'name', GLPI 'id' and the PM 'uid' of the group
*/
public function getGLPIGroupIdForSelfServiceTask ($caseId, $pmTaskId) {
global $PM_DB;
$groupname = NULL;
// we must differentiate if rule assignement is self-service or self-service value based
//$query = "SELECT TAS_GROUP_VARIABLE
// FROM TASK
// WHERE TAS_UID='$pmTaskId'
// AND TAS_ASSIGN_TYPE='SELF_SERVICE';";
$query = ['SELECT' => 'TAS_GROUP_VARIABLE',
'FROM' => 'TASK',
'WHERE' => ['TAS_UID' => '$pmTaskId',
'TAS_ASSIGN_TYPE' => 'SELF_SERVICE']];
//$req = $PM_DB->query($query);
//$row = $PM_DB->fetchAssoc($req);
foreach ($PM_DB->request($query) as $row) {
// there is only one row
if ($row['TAS_GROUP_VARIABLE'] == '') {
// Assignement is Self-Service
// the group title can be found in the GROUPWF table when the assignement rule is Self-Service
// TU_RELATION=2 is groups and TU_TYPE=1 means normal (= not adhoc)
$queryname = "SELECT GROUPWF.GRP_TITLE AS 'GRP_TITLE', GROUPWF.GRP_UID AS 'GRP_UID' FROM TASK_USER
JOIN GROUPWF ON GROUPWF.GRP_UID = TASK_USER.USR_UID
WHERE TASK_USER.TAS_UID = '$pmTaskId'
AND TASK_USER.TU_RELATION = 2
AND TASK_USER.TU_TYPE = 1
LIMIT 1;";
} else {
// Assignement is Self-Service Value Based
// in this case we must retreive the group from the case variable which is in if the TASK table
$casevariable = substr($row['TAS_GROUP_VARIABLE'], 2);
$vars = $this->getVariables($caseId, [$casevariable]);
if (array_key_exists($casevariable, $vars) && $vars[$casevariable] != '') {
// here is the UID of the group that needs to be assigned to the task
// then we need the name of the group
// the group title can be found in the GROUPWF table
$queryname = "SELECT GRP_TITLE, GRP_UID
FROM GROUPWF
WHERE GRP_UID = '{$vars[$casevariable]}';";
}
}
}
// as there is a LIMIT of 1
// or
// as there is only one group per guid
// then we should have at maximun 1 record
foreach ($PM_DB->request($queryname) as $onlyrec) {
$groupname = $onlyrec;
}
if (isset($groupname)) {
return ['name' => $groupname['GRP_TITLE'],
'id' => self::getGLPIGroupId($groupname['GRP_TITLE']),
'uid' => $groupname['GRP_UID']
];
}
return false;
}
}

View File

@@ -115,7 +115,7 @@ class PluginProcessmakerTask extends CommonITILTask
return true;
}
static function populatePlanning($params) {
static function populatePlanning($params = []) :array {
//global $CFG_GLPI;
$events = [];
@@ -423,6 +423,7 @@ class PluginProcessmakerTask extends CommonITILTask
tasktype : '{$task[$tabnum]['itemtype']}',
tasks_id : {$task[$tabnum]['items_id']},
users_id : {$current_assigned_user},
caseGuid : '{$case->fields['case_guid']}',
taskGuid : '{$currentUser->taskId}',
delIndex : {$task[$tabnum]['del_index']},
delThread : {$currentUser->delThread},

View File

@@ -36,11 +36,11 @@ class PluginProcessmakerTaskCategory extends CommonDBTM
self::title($item);
echo "<div class='center'><br><table class='tab_cadre_fixehov'>";
echo "<tr><th colspan='7'>".__('Task List', 'processmaker')."</th></tr>";
echo "<tr><th colspan='7'>".__('Task list', 'processmaker')."</th></tr>";
echo "<tr><th>".__('Task name', 'processmaker')."</th>".
"<th>".__('Complete name')."</th>" .
"<th>".__('Start', 'processmaker')."</th>" .
"<th>".__('Task GUID', 'processmaker')."</th>" .
"<th>".__('Task guid', 'processmaker')."</th>" .
"<th>".__('Comments')."</th>" .
"<th>".__('Active')."</th>" .
"<th>".__('Sub-process', 'processmaker')."</th>" .
@@ -144,7 +144,7 @@ class PluginProcessmakerTaskCategory extends CommonDBTM
echo "<th>".__('Complete name')."</th>" .
"<th>".__('Start', 'processmaker')."</th>" .
"<th>".__('Task GUID', 'processmaker')."</th>" .
"<th>".__('Task guid', 'processmaker')."</th>" .
"<th>".__('Comments')."</th>" .
"<th>".__('Active')."</th>" .
"<th>".__('Sub-process', 'processmaker')."</th>" .

View File

@@ -16,22 +16,31 @@ class PluginProcessmakerUser extends CommonDBTM {
*
* Internaly used by showGroup_Users, dropdownUsers and ajax/dropdownUsers.php
*
* @param $count true if execute an count(*),
* @param $right limit user who have specific right
* @param $entity_restrict Restrict to a defined entity
* @param $value default value
* @param $used array: Already used items ID: not to display in dropdown
* @param $search pattern
*
* @param array $tags contains taskGuid and grpGuid (task UID and Group UID)
* @param boolean $count true if execute an count(*),
* @param string|string[] $right limit user who have specific right
* @param integer $entity_restrict Restrict to a defined entity
* @param integer $value default value
* @param integer[] $used array: Already used items ID: not to display in dropdown
* @param string $search pattern
* @param integer $start start LIMIT value (default 0)
* @param integer $limit limit LIMIT value (default -1 no limit)
* @param boolean $inactive_deleted true to retreive also inactive or deleted users
* @return DBmysqlIterator
**/
static function getSqlSearchResult ($taskId, $count = true, $right = "all", $entity_restrict = -1, $value = 0,
$used = [], $search = '', $limit = '') {
static function getSqlSearchResult (array $tags, $count = true, $right = "all", $entity_restrict = -1, $value = 0,
array $used = [], $search = '',$start = 0, $limit = -1,
$inactive_deleted = 0) {
global $DB, $PM_DB, $CFG_GLPI;
// first need to get all users from $taskId
$adhoc_users = Session::haveRight('plugin_processmaker_case', ADHOC_REASSIGN) ? 2 : -1;
// TU_TYPE in (1, 2) means 1 is normal, 2 is for adhoc
// TU_RELATION is 1 for user, and 2 for group
// TU_TYPE in (1, 2) means 1 is normal user, 2 is for adhoc users
$tu_type = [];
$tu_type[] = Session::haveRight('plugin_processmaker_case', ADHOC_REASSIGN) ? 2 : -1; // by default get (or not if no rights) the ad-hoc users
if ($tags['grpGuid'] == 0) {
$tu_type[] = 1; // if no group for selfservice value based assignment then get also the users
}
$res1 = new QuerySubQuery([
'SELECT' => 'GROUP_USER.USR_UID AS pm_user_id',
'FROM' => 'TASK_USER',
@@ -42,14 +51,14 @@ class PluginProcessmakerUser extends CommonDBTM {
'TASK_USER' => 'USR_UID',
['AND' => [
'TASK_USER.TU_RELATION' => 2,
'TASK_USER.TU_TYPE' => [1, $adhoc_users]
'TASK_USER.TU_TYPE' => $tu_type
]
]
]
]
],
'WHERE' => [
'TAS_UID' => $taskId,
'TAS_UID' => $tags['taskGuid'],
]
]);
$res2 = new QuerySubQuery([
@@ -57,92 +66,75 @@ class PluginProcessmakerUser extends CommonDBTM {
'FROM' => 'TASK_USER',
'WHERE' => [
'AND' => [
'TAS_UID' => $taskId,
'TAS_UID' => $tags['taskGuid'],
'TASK_USER.TU_RELATION' => 1,
'TASK_USER.TU_TYPE' => [1, $adhoc_users]
'TASK_USER.TU_TYPE' => $tu_type
]
]
]);
$union = new QueryUnion([$res1, $res2]);
$subqueries = [$res1, $res2];
if ($tags['grpGuid'] != 0) {
// then add the user for the selfservice value based assignement
$res3 = new QuerySubQuery([
'SELECT' => 'GROUP_USER.USR_UID AS pm_user_id',
'FROM' => 'GROUP_USER',
'WHERE' => ['GROUP_USER.GRP_UID' => $tags['grpGuid']]
]);
$subqueries[] = $res3;
}
$union = new QueryUnion($subqueries);
$res = $PM_DB->request([
'FROM' => $union
]);
//$db_pm = PluginProcessmakerConfig::getInstance()->getProcessMakerDB();
//$pmQuery = "SELECT GROUP_USER.USR_UID AS pm_user_id FROM TASK_USER
// JOIN GROUP_USER ON GROUP_USER.GRP_UID=TASK_USER.USR_UID AND TASK_USER.TU_RELATION = 2 AND TASK_USER.TU_TYPE=1
// WHERE TAS_UID = '$taskId'
// UNION
// SELECT TASK_USER.USR_UID AS pm_user_id FROM TASK_USER
// WHERE TAS_UID = '$taskId' AND TASK_USER.TU_RELATION = 1 AND TASK_USER.TU_TYPE=1 ; ";
$pmUsers = [ ];
//foreach ($PM_DB->request( $pmQuery ) as $pmUser) {
foreach ($res as $pmUser) {
$pmUsers[ ] = $pmUser[ 'pm_user_id' ];
}
//$where = '';
$joinprofile = false;
switch ($right) {
case "id" :
$used[] = Session::getLoginUserID();
//$where = " `glpi_users`.`id` = '".Session::getLoginUserID()."' ";
$query2['WHERE']['AND']['glpi_users.id'] = Session::getLoginUserID();
$query['WHERE']['AND']['glpi_users.id'] = Session::getLoginUserID();
break;
case "all" :
//$where = " `glpi_users`.`id` > '0' ";
$query2['WHERE']['AND']['glpi_users.id'] = ['>', 0];
$query['WHERE']['AND']['glpi_users.id'] = ['>', 0];
break;
}
//$where .= " AND glpi_plugin_processmaker_users.pm_users_id IN ('".join("', '", $pmUsers)."') ";
//$where .= " AND `glpi_users`.`is_deleted` = '0'
// AND `glpi_users`.`is_active` = '1' ";
$query2['WHERE']['AND']['glpi_plugin_processmaker_users.pm_users_id'] = $pmUsers;
$query2['WHERE']['AND']['glpi_users.is_deleted'] = 0;
$query2['WHERE']['AND']['glpi_users.is_active'] = 1;
$query['WHERE']['AND']['glpi_plugin_processmaker_users.pm_users_id'] = $pmUsers;
$query['WHERE']['AND']['glpi_users.is_deleted'] = 0;
$query['WHERE']['AND']['glpi_users.is_active'] = 1;
if ((is_numeric($value) && $value)
|| count($used)) {
//$where .= " AND `glpi_users`.`id` NOT IN (";
if (is_numeric($value)) {
//$first = false;
//$where .= $value;
$used[] = $value;
//$query2['WHERE']['AND']['NOT']['glpi_users.id'] = $value;
} else {
//$first = true;
}
//$query2['WHERE']['AND']['NOT']['glpi_users.id'] = $used;
//foreach ($used as $val) {
// if ($first) {
// $first = false;
// } else {
// $where .= ",";
// }
// $where .= $val;
//}
//$where .= ")";
}
if ($count) {
//$query = "SELECT COUNT(DISTINCT glpi_users.id ) AS cpt ";
$query2['SELECT'] = ['COUNT DISTINCT' => 'glpi_users.id AS cpt'];
$query['FIELDS'] = 'glpi_users.id';
$query['COUNT'] = 'cpt';
$query['DISTINCT'] = true;
} else {
//$query = "SELECT DISTINCT glpi_users.id , `glpi_users`.`realname`, `glpi_users`.`firstname`, `glpi_users`.`name`, `glpi_useremails`.`email` ";
$query2['SELECT DISTINCT'] = 'glpi_users.id';
$query2['FIELDS'] = ['glpi_users.realname', 'glpi_users.firstname', 'glpi_users.name', 'glpi_useremails.email'];
$query['FIELDS'] = ['glpi_users.id', 'glpi_users.realname', 'glpi_users.firstname', 'glpi_users.name', 'glpi_useremails.email'];
$query['DISTINCT'] = true;
}
$query2['FROM'] = 'glpi_plugin_processmaker_users';
//$query .= "FROM glpi_plugin_processmaker_users
// JOIN glpi_users ON glpi_users.id=glpi_plugin_processmaker_users.id ";
$query2['FROM'] = 'glpi_plugin_processmaker_users';
$query2['INNER JOIN'] = [
$query['FROM'] = 'glpi_plugin_processmaker_users';
$query['FROM'] = 'glpi_plugin_processmaker_users';
$query['INNER JOIN'] = [
'glpi_users' => [
'FKEY' => [
'glpi_users' => 'id',
@@ -151,9 +143,7 @@ class PluginProcessmakerUser extends CommonDBTM {
]
];
//$query .= " LEFT JOIN `glpi_useremails`
// ON (`glpi_users`.`id` = `glpi_useremails`.`users_id` AND `glpi_useremails`.is_default = 1)";
$query2['LEFT JOIN'] = [
$query['LEFT JOIN'] = [
'glpi_useremails' => [
'FKEY' => [
'glpi_users' => 'id',
@@ -171,11 +161,9 @@ class PluginProcessmakerUser extends CommonDBTM {
]
]
];
//$query .= " LEFT JOIN `glpi_profiles_users`
// ON (`glpi_users`.`id` = `glpi_profiles_users`.`users_id`)";
if ($joinprofile) {
$query2['LEFT JOIN'] = [
$query['LEFT JOIN'] = [
'glpi_profiles' => [
'FKEY' => [
'glpi_profiles' => 'id',
@@ -183,58 +171,49 @@ class PluginProcessmakerUser extends CommonDBTM {
]
]
];
//$query .= " LEFT JOIN `glpi_profiles`
// ON (`glpi_profiles`.`id` = `glpi_profiles_users`.`profiles_id`) ";
}
if ($count) {
$query2['WHERE']['AND']['NOT']['glpi_users.id'] = $used;
//$query .= " WHERE $where ";
$query['WHERE']['AND']['NOT']['glpi_users.id'] = $used;
} else {
if (strlen($search)>0 && $search!=$CFG_GLPI["ajax_wildcard"]) {
$query2['WHERE']['AND'] = [
'glpi_users.name' => ['LIKE',Search::makeTextSearchValue($search)],
$txt_search = Search::makeTextSearchValue($search);
$firstname_field = $DB->quoteName(User::getTableField('firstname'));
$realname_field = $DB->quoteName(User::getTableField('realname'));
$fields = $_SESSION["glpinames_format"] == User::FIRSTNAME_BEFORE
? [$firstname_field, $realname_field]
: [$realname_field, $firstname_field];
$concat = new \QueryExpression(
'CONCAT(' . implode(',' . $DB->quoteValue(' ') . ',', $fields) . ')'
. ' LIKE ' . $DB->quoteValue($txt_search)
);
$query['WHERE']['AND'] = [
'glpi_users.name' => ['LIKE', $txt_search],
'OR' => [
'glpi_users.realname' => ['LIKE',Search::makeTextSearchValue($search)],
'glpi_users.firstname' => ['LIKE',Search::makeTextSearchValue($search)],
'glpi_users.phone' => ['LIKE',Search::makeTextSearchValue($search)],
'glpi_useremails.email' => ['LIKE',Search::makeTextSearchValue($search)],
'RAW' => [
"CONCAT(`glpi_users`.`realname`,' ',`glpi_users`.`firstname`)".Search::makeTextSearch($search)
]
'glpi_users.realname' => ['LIKE', $txt_search],
'glpi_users.firstname' => ['LIKE', $txt_search],
'glpi_users.phone' => ['LIKE', $txt_search],
'glpi_useremails.email' => ['LIKE', $txt_search],
$concat
]
];
//$where .= " AND (`glpi_users`.`name` ".Search::makeTextSearch($search)."
// OR `glpi_users`.`realname` ".Search::makeTextSearch($search)."
// OR `glpi_users`.`firstname` ".Search::makeTextSearch($search)."
// OR `glpi_users`.`phone` ".Search::makeTextSearch($search)."
// OR `glpi_useremails`.`email` ".Search::makeTextSearch($search)."
// OR CONCAT(`glpi_users`.`realname`,' ',`glpi_users`.`firstname`) ".
// Search::makeTextSearch($search).")";
}
$query2['WHERE']['AND']['NOT']['glpi_users.id'] = $used;
//$query .= " WHERE $where ";
$query['WHERE']['AND']['NOT']['glpi_users.id'] = $used;
if ($_SESSION["glpinames_format"] == User::FIRSTNAME_BEFORE) {
//$query.=" ORDER BY `glpi_users`.`firstname`,
// `glpi_users`.`realname`,
// `glpi_users`.`name` ";
$query2['ORDER'] = ['glpi_users.firstname', 'glpi_users.realname', 'glpi_users.name'];
$query['ORDER'] = ['glpi_users.firstname', 'glpi_users.realname', 'glpi_users.name'];
} else {
//$query.=" ORDER BY `glpi_users`.`realname`,
// `glpi_users`.`firstname`,
// `glpi_users`.`name` ";
$query2['ORDER'] = ['glpi_users.realname', 'glpi_users.firstname', 'glpi_users.name'];
$query['ORDER'] = ['glpi_users.realname', 'glpi_users.firstname', 'glpi_users.name'];
}
if ($search != $CFG_GLPI["ajax_wildcard"]) {
//$query .= " $limit";
$query2['LIMIT'] = 200;
$query['LIMIT'] = $limit;
$query['START'] = $start;
}
}
return $DB->request($query2);
//return $DB->query($query);
return $DB->request($query);
}

View File

@@ -81,7 +81,7 @@ CREATE TABLE IF NOT EXISTS `glpi_plugin_processmaker_configs` (
`domain` varchar(50) DEFAULT '',
`maintenance` tinyint(1) NOT NULL DEFAULT '0',
`ssl_verify` tinyint(1) NOT NULL DEFAULT '0',
`db_version` varchar(10) NOT NULL DEFAULT '3.4.10',
`db_version` varchar(10) NOT NULL DEFAULT '4.0.0',
`max_cases_per_item` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@@ -48,9 +48,13 @@ function processmaker_update() {
// will upgrade 3.4.9 to 3.4.10
include_once(GLPI_ROOT."/plugins/processmaker/install/update_3_4_9_to_3_4_10.php");
$new_version = update_3_4_9_to_3_4_10();
case '3.4.10' :
// will upgrade 3.4.10 to 4.0.0
include_once(GLPI_ROOT."/plugins/processmaker/install/update_3_4_10_to_4_0_0.php");
$new_version = update_3_4_10_to_4_0_0();
}
if (isset($new_version)) {
if (isset($new_version) && $new_version !== false) {
// end update by updating the db version number
$query = "UPDATE `glpi_plugin_processmaker_configs` SET `db_version` = '$new_version' WHERE `id` = 1;";

View File

@@ -0,0 +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;
}

Binary file not shown.

View File

@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: processmaker-plugin\n"
"POT-Creation-Date: 2018-08-06 14:32+0200\n"
"PO-Revision-Date: 2018-08-06 14:43+0200\n"
"PO-Revision-Date: 2021-02-15 14:25\n"
"Last-Translator: tomolimo\n"
"Language-Team: Czech\n"
"Language: cs_CZ\n"
@@ -12,11 +12,7 @@ msgstr ""
"X-Generator: Poedit 2.1.1\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=4; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 3;\n"
"X-Poedit-KeywordsList: ;__:1,2t;_e:1,2t;_x:1c,2,3t;_n:1,2,4t;__s:1,2t;"
"_ex:1c,2,3t;_sx:1c,2,3t;_nx:1c,2,3,5t\n"
"X-Crowdin-Project: processmaker-plugin\n"
"X-Crowdin-Language: cs\n"
"X-Crowdin-File: /3.3.0/source.po\n"
"X-Poedit-KeywordsList: ;__:1,2t;_e:1,2t;_x:1c,2,3t;_n:1,2,4t;__s:1,2t;_ex:1c,2,3t;_sx:1c,2,3t;_nx:1c,2,3,5t\n"
"X-Poedit-SearchPath-0: ajax\n"
"X-Poedit-SearchPath-1: front\n"
"X-Poedit-SearchPath-2: inc\n"
@@ -24,6 +20,11 @@ msgstr ""
"X-Poedit-SearchPath-4: js\n"
"X-Poedit-SearchPath-5: hook.php\n"
"X-Poedit-SearchPath-6: setup.php\n"
"X-Crowdin-Project: processmaker-plugin\n"
"X-Crowdin-Project-ID: 310131\n"
"X-Crowdin-Language: cs\n"
"X-Crowdin-File: /3.3.0/source.po\n"
"X-Crowdin-File-ID: 15\n"
#: ajax/task_users.php:25
msgid "Re-assign task to"
@@ -102,7 +103,7 @@ msgstr[3] "Případy procesu"
#: inc/case.class.php:80
msgid "Sub-case"
msgstr ""
msgstr "Dílčí případ"
#: inc/case.class.php:312
msgid "Current task(s) properties"
@@ -130,11 +131,11 @@ msgstr "Chcete-li uplatnit"
#: inc/case.class.php:377
msgid "Sub-case properties"
msgstr ""
msgstr "Vlastnosti dílčího případu"
#: inc/case.class.php:380
msgid "Parent case properties"
msgstr ""
msgstr "Vlastnosti nadřazeného případu"
#: inc/case.class.php:382
msgid "Case properties"
@@ -176,12 +177,12 @@ msgstr "Poslední úprava"
#: inc/case.class.php:479
#, php-format
msgid "Case is linked to a %1s"
msgstr ""
msgstr "Případ je propojen s %1s"
#: inc/case.class.php:481
#, php-format
msgid "Sub-case is linked to a %1s"
msgstr ""
msgstr "Dílčí případ je propojen s %1s"
#: inc/case.class.php:506
msgid "Case cancellation"
@@ -213,7 +214,7 @@ msgstr "Titulek"
#: inc/case.class.php:587 inc/case.class.php:1070
msgid "Sub-case of"
msgstr ""
msgstr "Dílčí případ z"
#: inc/case.class.php:602
msgid "Add a new case"
@@ -433,11 +434,11 @@ msgstr "Nikde se neopakující identif. procesu"
#: inc/process.class.php:433
msgid "Process type"
msgstr ""
msgstr "Typ procesu"
#: inc/process.class.php:439
msgid "Hide case num. & title"
msgstr ""
msgstr "Skrýt číslo případu a nadpis"
#: inc/process.class.php:445
msgid "Insert Task Category"
@@ -449,19 +450,19 @@ msgstr "Typ požadavku (samoobslužné)"
#: inc/process.class.php:464 inc/process.class.php:609
msgid "Visible in Incident for Central interface"
msgstr ""
msgstr "Viditelné v incidentu pro ústřední rozhraní"
#: inc/process.class.php:470 inc/process.class.php:614
msgid "Visible in Request for Central interface"
msgstr ""
msgstr "Viditelné v požadavku pro ústřední rozhraní"
#: inc/process.class.php:476 inc/process.class.php:666
msgid "Visible in Change"
msgstr ""
msgstr "Viditelné ve změně"
#: inc/process.class.php:482 inc/process.class.php:671
msgid "Visible in Problem"
msgstr ""
msgstr "Viditelné v problému"
#: inc/process.class.php:519
msgctxt "process_type"
@@ -487,15 +488,15 @@ msgstr "Vložit komentáře kategorie úkolu do jeho popisu"
#: inc/process.class.php:619
msgid "ITIL Category for Self-service interface (left empty to disable)"
msgstr ""
msgstr "ITIL kategorie pro samoobslužné rozhraní (ponecháním nevyplněného bude vypnuto)"
#: inc/process.class.php:646
msgid "Type for Self-service interface"
msgstr ""
msgstr "Typ samoobslužného rozhraní"
#: inc/process.class.php:676
msgid "Process type (to be changed only if not up-to-date)"
msgstr ""
msgstr "Typ procesu (který má být změněno pouze pokud není aktuální)"
#: inc/process_profile.class.php:26 inc/process_profile.class.php:45
msgid "Authorizations"
@@ -544,11 +545,8 @@ msgid "You must manage it first (see 'Process - Case' tab)!"
msgstr "Nejprve je třeba toto spravovat (viz panel „Proces případ“)!"
#: inc/processmaker.class.php:3038
msgid ""
"ProcessMaker plugin is under maintenance, please retry later, thank you."
msgstr ""
"Na zásuvném modulu ProcessMaker probíhá údržba, zkuste to prosím později "
"děkujeme."
msgid "ProcessMaker plugin is under maintenance, please retry later, thank you."
msgstr "Na zásuvném modulu ProcessMaker probíhá údržba, zkuste to prosím později děkujeme."
#: inc/profile.class.php:17
msgid "Process configuration"
@@ -568,7 +566,7 @@ msgstr[3] "Process case tasks"
#: inc/task.class.php:258
msgid "Sub-case task(s)"
msgstr ""
msgstr "Úkoly dílčího případu"
#: inc/taskcategory.class.php:21 inc/taskcategory.class.php:31
msgid "Task List"
@@ -610,3 +608,4 @@ msgstr "Dílčí proces"
#~ msgid "Plugin is under maintenance, please retry later, thank you."
#~ msgstr "Plugin is under maintenance, please retry later, thank you."

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@@ -1,18 +1,19 @@
msgid ""
msgstr ""
"Project-Id-Version: processmaker-plugin\n"
"POT-Creation-Date: 2020-07-13 09:41+0200\n"
"PO-Revision-Date: 2020-07-13 11:02+0200\n"
"POT-Creation-Date: 2021-02-15 17:32+0100\n"
"PO-Revision-Date: 2021-02-15 17:34+0100\n"
"Last-Translator: tomolimo\n"
"Language-Team: French\n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 2.3.1\n"
"X-Generator: Poedit 2.4.2\n"
"X-Poedit-Basepath: ..\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Poedit-KeywordsList: ;__:1,2t;_e:1,2t;_x:1c,2,3t;_n:1,2,4t;__s:1,2t;_ex:1c,2,3t;_sx:1c,2,3t;_nx:1c,2,3,5t\n"
"X-Poedit-KeywordsList: ;__:1,2t;_e:1,2t;_x:1c,2,3t;_n:1,2,4t;__s:1,2t;"
"_ex:1c,2,3t;_sx:1c,2,3t;_nx:1c,2,3,5t\n"
"X-Crowdin-Project: processmaker-plugin\n"
"X-Crowdin-Project-ID: 310131\n"
"X-Crowdin-Language: fr\n"
@@ -28,54 +29,63 @@ msgstr ""
#: ajax/task_users.php:36
msgid "Re-assign task to"
msgstr "Ré-affecter tâche à"
msgstr "Réattribuer la tâche à"
#: ajax/task_users.php:60 ajax/task_users.php:61 ajax/task_users.php:124
#: ajax/task_users.php:67 ajax/task_users.php:68 ajax/task_users.php:135
msgid "Re-assign"
msgstr "Ré-affecter"
msgstr "Réattribuer"
#: ajax/task_users.php:110
#| msgid "Task already assigned to this person!"
msgid "Task is already assigned to this user or group!"
msgstr "La tâche est déjà affectée à cet utilisateur (ou ce groupe) !"
#: ajax/task_users.php:100
msgid "Input at least 10 words in English to justify."
msgstr "Entrez au moins 10 mots en anglais pour justifier."
#: ajax/task_users.php:110 ajax/task_users.php:122
#| msgid "Re-assign task to"
#: ajax/task_users.php:118
msgid "Task is already un-assigned!"
msgstr "L'attribution de cette tâche est déjà supprimée !"
#: ajax/task_users.php:118 ajax/task_users.php:120 ajax/task_users.php:133
msgid "Re-assign task"
msgstr "Ré-affecter tâche"
msgstr "Réattribuer la tâche"
#: ajax/task_users.php:114 ajax/task_users.php:119
#| msgid "Claim target task"
#: ajax/task_users.php:120
msgid "Task is already assigned to this user!"
msgstr "La tâche est déjà attribuée à cet utilisateur !"
#: ajax/task_users.php:125 ajax/task_users.php:130
msgid "Un-claim task"
msgstr "Annuler affectation de la tâche"
msgstr "Supprimer l'attribution de la tâche"
#: ajax/task_users.php:115
msgid "Please input reason to un-claim<br/>(task will be re-assigned to former group):"
msgstr "Saisir la raison pour l'annulation de l'affectation<br/>(la tâche sera ré-affectée au groupe précédent) :"
#: ajax/task_users.php:126
msgid ""
"Please input reason to un-claim<br/>(task will be re-assigned to former "
"group):"
msgstr ""
"Saisir la raison pour l'annulation de l'attribution<br/>(la tâche sera "
"réattribuée au groupe précédent) :"
#: ajax/task_users.php:116
#: ajax/task_users.php:127
msgid "Un-claim"
msgstr "Annulation de l'affectation"
msgstr "Suppression de l'attribution"
#: ajax/task_users.php:119
msgid "Can\\'t un-assign Task!"
msgstr "Annulation de l'affectation impossible !"
#: ajax/task_users.php:123
msgid "Please input reason to re-assign:"
msgstr "Saisir la raison pour la ré-affectation :"
#: ajax/task_users.php:130
msgid "Can't un-assign task!"
msgstr "Suppression de l'attribution impossible !"
#: ajax/task_users.php:134
msgid "Please input reason to re-assign:"
msgstr "Saisir la raison pour la réattribution :"
#: ajax/task_users.php:145
msgid "Send reminder"
msgstr "Envoyer un rappel"
#: front/case.form.php:32
msgid "Case has been deleted!"
msgstr "Le cas a été effacé !"
msgstr "Le cas a été supprimé !"
#: front/case.form.php:34
msgid "Unable to delete case!"
msgstr "Impossible d'effacer le cas !"
msgstr "Impossible de supprimer le cas !"
#: front/case.form.php:46
msgid "Case has been cancelled!"
@@ -85,12 +95,12 @@ msgstr "Le cas a été annulé !"
msgid "Unable to cancel case!"
msgstr "Impossible d'annuler le cas !"
#: front/case.form.php:70 front/case.form.php:72 inc/case.class.php:1310
#: front/case.form.php:70 front/case.form.php:72 inc/case.class.php:1272
msgid "Process cases"
msgstr "Cas des processus"
#: front/case.php:5 front/caselink.form.php:29 front/caselink.php:5
#: front/process.form.php:27 front/process.php:5 inc/caselink.class.php:157
#: front/process.form.php:27 front/process.php:5 inc/caselink.class.php:158
#: inc/config.class.php:50 inc/config.class.php:363 inc/process.class.php:409
#: inc/profile.class.php:52 inc/profile.class.php:83
msgid "ProcessMaker"
@@ -98,222 +108,235 @@ msgstr "ProcessMaker"
#: front/processmaker.form.php:80
msgid "Task re-assigned!"
msgstr "Tâche ré-affectée !"
msgstr "Tâche réattribuée !"
#: front/processmaker.form.php:82
msgid "Error re-assigning task: "
msgstr "Impossible de ré-affecter cette tâche :"
msgstr "Impossible de réattribuer cette tâche :"
#: front/processmaker.form.php:93
#| msgid "Task name"
msgid "Task un-claimed!"
msgstr "Annulation de l'affectation de la tâche effectuée !"
msgstr "Annulation de l'attribution de la tâche effectuée !"
#: front/processmaker.form.php:95
msgid "Can't un-claim task! Verify 'Assignement Rules' in the process definition."
msgstr "Annulation de l'affectation impossible ! Vérifiez les règles d'assignation dans la définition du Processus."
msgid ""
"Can't un-claim task! Verify 'Assignement Rules' in the process definition."
msgstr ""
"Annulation de l'attribution impossible ! Vérifiez les règles d'attribution "
"dans la définition du Processus."
#: front/processmaker.helpdesk.form.php:21
msgid "Process - Case"
msgstr "Processus - Cas"
#: front/processmaker.helpdesk.form.php:24 inc/case.class.php:799
#: front/processmaker.helpdesk.form.php:24 inc/case.class.php:761
msgid "Select the process you want to add"
msgstr "Choisir le processus à démarrer"
msgstr "Choisir le processus à ajouter"
#: hook.php:9 inc/taskcategory.class.php:214
msgid "Synchronize Task List"
msgstr "Synchroniser la liste des Tâches"
msgstr "Synchroniser la liste des tâches"
#: hook.php:76 inc/case.class.php:89
msgid "Case"
msgstr "Cas"
#: hook.php:76 inc/case.class.php:778 inc/case.class.php:1355
#: hook.php:76 inc/case.class.php:740 inc/case.class.php:1317
msgid "Status"
msgstr "Statut"
#: inc/case.class.php:25 inc/case.class.php:102 inc/case.class.php:104
#: inc/case.class.php:25
msgid "Process case"
msgid_plural "Process cases"
msgstr[0] "Cas du processus"
msgstr[1] "Cas des processus"
msgstr[1] "Cas du processus"
#: inc/case.class.php:92
msgid "Sub-case"
msgstr "Sous-cas"
#: inc/case.class.php:303
#: inc/case.class.php:265
#, php-format
msgid "<b>Task un-claimed!</b><br/><b>Case: </b>%s<br/><b>Task: </b>\"%s\" has been un-assigned from \"%s\" and assigned to \"%s\" group.<br/><b>Reason: </b>%s"
msgstr "<b>Annulation de l'affection de la tâche effectuée !</b><br/><b>Cas : </b>%s<br/><b>Tâche : </b>\"%s\" a été libérée de \"%s\" et assignée au groupe \"%s\".<br/><b>Motif : </b>%s"
msgid ""
"<b>Task un-claimed!</b><br/><b>Case: </b>%s<br/><b>Task: </b>\"%s\" has been "
"un-assigned from \"%s\" and assigned to \"%s\" group.<br/><b>Reason: </b>%s"
msgstr ""
"<b>Suppression de l'attribution de la tâche effectuée !</b><br/><b>Cas : </b>"
"%s<br/><b>Tâche : </b>\"%s\" a été libérée de \"%s\" et attribuée au groupe "
"\"%s\".<br/><b>Motif : </b>%s"
#: inc/case.class.php:420
#: inc/case.class.php:382
#, php-format
msgid "<b>Task re-assigned!</b><br/><b>Case: </b>%s<br/><b>Task: </b>\"%s\" has been re-assigned from \"%s\" to \"%s\".<br/><b>Reason: </b>%s"
msgstr "<b>Tâche ré-assignée !</b><br/><b>Cas : </b>%s<br/><b>Tâche : </b>\"%s\" a été ré-assignée de \"%s\" à \"%s\".<br/><b>Motif : </b>%s"
msgid ""
"<b>Task re-assigned!</b><br/><b>Case: </b>%s<br/><b>Task: </b>\"%s\" has "
"been re-assigned from \"%s\" to \"%s\".<br/><b>Reason: </b>%s"
msgstr ""
"<b>Tâche réattribuée !</b><br/><b>Cas : </b>%s<br/><b>Tâche : </b>\"%s\" a "
"été réattribuée de \"%s\" à \"%s\".<br/><b>Motif : </b>%s"
#: inc/case.class.php:429
#: inc/case.class.php:391
#, php-format
msgid "<b>Task assigned!</b><br/><b>Case: </b>%s<br/><b>Task: </b>\"%s\" has been assigned to \"%s\".<br/><b>Reason: </b>%s"
msgstr "<b>Tâche assignée !</b><br/><b>Cas : </b>%s<br/><b>Tâche : </b>\"%s\" a été asignée à \"%s\".<br/><b>Motif : </b>%s"
msgid ""
"<b>Task assigned!</b><br/><b>Case: </b>%s<br/><b>Task: </b>\"%s\" has been "
"assigned to \"%s\".<br/><b>Reason: </b>%s"
msgstr ""
"<b>Tâche attribuée !</b><br/><b>Cas : </b>%s<br/><b>Tâche : </b>\"%s\" a été "
"attribuée à \"%s\".<br/><b>Motif : </b>%s"
#: inc/case.class.php:510
#: inc/case.class.php:472
msgid "Current task(s) properties"
msgstr "Propriétés des tâches en cours"
#: inc/case.class.php:514 inc/task.class.php:283
#: inc/case.class.php:476 inc/task.class.php:283
msgid "Task"
msgstr "Tâche"
#: inc/case.class.php:515 inc/task.class.php:284
#: inc/case.class.php:477 inc/task.class.php:284 inc/taskcategory.class.php:43
#: inc/taskcategory.class.php:122
msgid "Task guid"
msgstr "Guid de la tâche"
#: inc/case.class.php:516 inc/task.class.php:285
#: inc/case.class.php:478 inc/task.class.php:285
msgid "Current user"
msgstr "Utilisateur actuel"
#: inc/case.class.php:517 inc/task.class.php:286
#: inc/case.class.php:479 inc/task.class.php:286
msgid "Task delegation date"
msgstr "Date de délégation de tâche"
msgstr "Date d'attribution de tâche"
#: inc/case.class.php:539 inc/task.class.php:295
#: inc/case.class.php:501 inc/task.class.php:295
msgid "To be claimed"
msgstr "A réclamer"
#: inc/case.class.php:575
#: inc/case.class.php:537
msgid "Sub-case properties"
msgstr "Propriétés du sous-cas"
#: inc/case.class.php:578
#: inc/case.class.php:540
msgid "Parent case properties"
msgstr "Propriétés du cas parent"
#: inc/case.class.php:580
#: inc/case.class.php:542
msgid "Case properties"
msgstr "Propriétés du cas"
#: inc/case.class.php:585 inc/case.class.php:776 inc/case.class.php:1328
#: inc/case.class.php:547 inc/case.class.php:738 inc/case.class.php:1290
#: inc/process.class.php:576
msgid "Process"
msgstr "Processus"
#: inc/case.class.php:586 inc/notificationtargetprocessmaker.class.php:64
#: inc/case.class.php:548 inc/notificationtargetprocessmaker.class.php:64
msgid "Case title"
msgstr "Titre du cas"
#: inc/case.class.php:587
#: inc/case.class.php:549
msgid "Case number"
msgstr "Numéro du cas"
#: inc/case.class.php:588
#: inc/case.class.php:550
msgid "Case status"
msgstr "Statut du cas"
#: inc/case.class.php:589
#: inc/case.class.php:551
msgid "Case guid"
msgstr "Guid du cas"
#: inc/case.class.php:590
#: inc/case.class.php:552
msgid "Creator"
msgstr "Créateur"
#: inc/case.class.php:591 inc/case.class.php:1370
#: inc/case.class.php:553 inc/case.class.php:1332
msgid "Creation date"
msgstr "Date de création"
#: inc/case.class.php:592
#: inc/case.class.php:554
msgid "Last update"
msgstr "Dernière mise à jour"
#: inc/case.class.php:675
#: inc/case.class.php:637
#, php-format
msgid "Case is linked to a %1s"
msgstr "Le cas est lié à un %1s"
#: inc/case.class.php:677
#: inc/case.class.php:639
#, php-format
msgid "Sub-case is linked to a %1s"
msgstr "Le sous-cas est lié à un %1s"
#: inc/case.class.php:698
#: inc/case.class.php:660
msgid "Case cancellation"
msgstr "Annulation du cas"
#: inc/case.class.php:699
#: inc/case.class.php:661
msgid "Cancel case"
msgstr "Annuler cas"
#: inc/case.class.php:703
#: inc/case.class.php:665
msgid "Confirm cancellation?"
msgstr "Confirmer lannulation ?"
#: inc/case.class.php:703 inc/profile.class.php:23
#: inc/case.class.php:665 inc/profile.class.php:23
msgid "Cancel"
msgstr "Annuler"
#: inc/case.class.php:717
#: inc/case.class.php:679
msgid "Case deletion"
msgstr "Suppression du cas"
#: inc/case.class.php:777 inc/case.class.php:1321
#: inc/case.class.php:739 inc/case.class.php:1283
msgid "Title"
msgstr "Titre"
#: inc/case.class.php:779 inc/case.class.php:1362
#: inc/case.class.php:741 inc/case.class.php:1324
msgid "Sub-case of"
msgstr "Sous-cas de"
#: inc/case.class.php:796
#: inc/case.class.php:758
msgid "Add a new case"
msgstr "Ajouter un nouveau cas"
#: inc/case.class.php:1227
#: inc/case.class.php:1189
msgctxt "case_status"
msgid "Draft"
msgstr "Brouillon"
#: inc/case.class.php:1228
#: inc/case.class.php:1190
msgctxt "case_status"
msgid "To do"
msgstr "A faire"
#: inc/case.class.php:1229
#: inc/case.class.php:1191
msgctxt "case_status"
msgid "Completed"
msgstr "Terminé"
#: inc/case.class.php:1230
#: inc/case.class.php:1192
msgctxt "case_status"
msgid "Cancelled"
msgstr "Annulé"
#: inc/case.class.php:1314
#: inc/case.class.php:1276
msgid "ID"
msgstr "ID"
#: inc/case.class.php:1335 inc/notificationtargetprocessmaker.class.php:72
#| msgid "Item entity"
#: inc/case.class.php:1297 inc/notificationtargetprocessmaker.class.php:72
msgid "Item type"
msgstr "Type de l'item"
#: inc/case.class.php:1342
#: inc/case.class.php:1304
msgid "Item"
msgstr "Item"
#: inc/case.class.php:1349
#: inc/case.class.php:1311
msgid "Item entity"
msgstr "Entité de l'item"
#: inc/case.class.php:1379
#| msgid "Last update"
#: inc/case.class.php:1341
msgid "Last update date"
msgstr "Date de dernière mise à jour"
#: inc/case.class.php:1392
#: inc/case.class.php:1354
#, php-format
#| msgid "Case status"
msgid "Case status is '%s'"
msgstr "L'état du cas est '%s'"
@@ -341,43 +364,43 @@ msgstr "Lien-cas"
msgid "Synchronous"
msgstr "Synchrone"
#: inc/caselink.class.php:80 inc/caselink.class.php:179
#: inc/caselink.class.php:80 inc/caselink.class.php:180
msgid "External data"
msgstr "Données externes"
#: inc/caselink.class.php:85 inc/caselink.class.php:185
#: inc/caselink.class.php:85 inc/caselink.class.php:186
msgid "Self"
msgstr "Self"
#: inc/caselink.class.php:90 inc/caselink.class.php:203
#: inc/caselink.class.php:90 inc/caselink.class.php:204
msgid "Source task GUID"
msgstr "GUID de la tâche source"
#: inc/caselink.class.php:98 inc/caselink.class.php:209
#: inc/caselink.class.php:99 inc/caselink.class.php:210
msgid "Target task GUID"
msgstr "GUID de la tâche cible"
#: inc/caselink.class.php:106 inc/caselink.class.php:221
#: inc/caselink.class.php:107 inc/caselink.class.php:222
msgid "Target process GUID"
msgstr "GUID du Processus cible"
#: inc/caselink.class.php:115 inc/caselink.class.php:215
#: inc/caselink.class.php:116 inc/caselink.class.php:216
msgid "Target dynaform GUID"
msgstr "GUID du dynaform cible"
#: inc/caselink.class.php:120 inc/caselink.class.php:227
#: inc/caselink.class.php:121 inc/caselink.class.php:228
msgid "Source condition"
msgstr "Condition d'activation du lien"
#: inc/caselink.class.php:126 inc/caselink.class.php:191
#: inc/caselink.class.php:127 inc/caselink.class.php:192
msgid "Claim target task"
msgstr "Tâche cible 'à réclamer'"
#: inc/caselink.class.php:136
#: inc/caselink.class.php:137
msgid "Impersonate target task user"
msgstr "Personnifier l'utilisateur de la tâche cible"
#: inc/caselink.class.php:141 inc/caselink.class.php:197
#: inc/caselink.class.php:142 inc/caselink.class.php:198
msgid "External application JSON config"
msgstr "Configuration JSON de l'application externe"
@@ -390,9 +413,12 @@ msgid "ProcessMaker setup"
msgstr "Configuration du serveur ProcessMaker"
#: inc/config.class.php:159
#| msgid "Server URL (must be in same domain than GLPI)"
msgid "Server URL (must be in same domain than GLPI, if GLPI is using HTTPS, PM server must also use HTTPS)"
msgstr "URL du serveur (doit être dans le même domaine que GLPI, si GLPI utilise HTTPS, alors PM doit aussi utiliser HTTPS)"
msgid ""
"Server URL (must be in same domain than GLPI, if GLPI is using HTTPS, PM "
"server must also use HTTPS)"
msgstr ""
"URL du serveur (doit être dans le même domaine que GLPI, si GLPI utilise "
"HTTPS, alors PM doit aussi utiliser HTTPS)"
#: inc/config.class.php:163
msgid "Common domain with GLPI"
@@ -412,7 +438,7 @@ msgstr "Nom du Workspace"
#: inc/config.class.php:211
msgid "Server administrator name"
msgstr "Non de l'administreur du server ProcessMaker"
msgstr "Nom de l'administrateur du server ProcessMaker"
#: inc/config.class.php:216
msgid "Server administrator password"
@@ -451,7 +477,7 @@ msgid "Main Task Category (edit to change name)"
msgstr "Catégorie principale des tâches (éditer pour changer le nom)"
#: inc/config.class.php:286
msgid "Task Writer (edit to change name)"
msgid "Task writer (edit to change name)"
msgstr "Auteur des tâches (éditer pour changer le nom)"
#: inc/config.class.php:306
@@ -484,7 +510,7 @@ msgstr "Version de PHP"
#: inc/config.class.php:347
msgid "DB version"
msgstr "Version de la Db"
msgstr "Version de la DB"
#: inc/config.class.php:348
msgid "DB server IP"
@@ -515,30 +541,22 @@ msgid "eMail recipients"
msgstr "Destinataires des emails"
#: inc/notificationtargetprocessmaker.class.php:60
#| msgid "Process case"
#| msgid_plural "Process cases"
msgid "Process category"
msgstr "Catégorie du processus"
#: inc/notificationtargetprocessmaker.class.php:61
#| msgid "Process case"
#| msgid_plural "Process cases"
msgid "Process category id"
msgstr "ID de la catégorie du processus"
#: inc/notificationtargetprocessmaker.class.php:62
#| msgid "Process case task"
#| msgid_plural "Process case tasks"
msgid "Process category comment"
msgstr "Commentaire de la catégorie du processus"
#: inc/notificationtargetprocessmaker.class.php:63
#| msgid "Case guid"
msgid "Case id"
msgstr "ID du cas"
#: inc/notificationtargetprocessmaker.class.php:65
#| msgid "Case deletion"
msgid "Case description"
msgstr "Description du cas"
@@ -563,17 +581,14 @@ msgid "Value for key in 'ZZZ' assoc array (1-dimension array)"
msgstr "Valeur pour la clé 'key' du tableau associatif à une dimension 'ZZZ'"
#: inc/notificationtargetprocessmaker.class.php:73
#| msgid "Item"
msgid "Item id"
msgstr "ID de l'item"
#: inc/notificationtargetprocessmaker.class.php:74
#| msgid "Item"
msgid "Item URL"
msgstr "URL de l'item"
#: inc/notificationtargetprocessmaker.class.php:75
#| msgid "Item entity"
msgid "Item title"
msgstr "Titre de l'item"
@@ -586,11 +601,14 @@ msgid "YYY is to be replaced by any array variables"
msgstr "YYY doit être remplacé par n'importe quel nom de tableau"
#: inc/notificationtargetprocessmaker.class.php:90
msgid "ZZZ is to be replaced by any assoc array variables (1-dimension array with key/value pairs)"
msgstr "ZZZ doit être replacé par n'importe quel nom de tableau associatif à une dimension (paire clé/valeur)"
msgid ""
"ZZZ is to be replaced by any assoc array variables (1-dimension array with "
"key/value pairs)"
msgstr ""
"ZZZ doit être replacé par n'importe quel nom de tableau associatif à une "
"dimension (paire clé/valeur)"
#: inc/notificationtargettask.class.php:195
#| msgid "Task delegation date"
msgid "Task action"
msgstr "Action de la tâche"
@@ -608,7 +626,7 @@ msgstr "Type de processus"
#: inc/process.class.php:455
msgid "Hide case num. & title"
msgstr "Cacher num. et titre du cas"
msgstr "Cacher le numéro et le titre du cas"
#: inc/process.class.php:461
msgid "Insert Task Category"
@@ -654,15 +672,18 @@ msgstr "Processus"
#: inc/process.class.php:627
msgid "Hide case number and title in task descriptions"
msgstr "Masquer numéro et titre des cas dans les descriptions des tâches"
msgstr "Masquer le numéro et le titre des cas dans les descriptions des tâches"
#: inc/process.class.php:632
msgid "Insert Task Category comments in Task Description"
msgstr "Insérer les commentaires des Catégories de Tâches dans les descriptions des Tâches"
msgstr ""
"Insérer les commentaires des catégories de tâches dans les descriptions des "
"tâches"
#: inc/process.class.php:652
msgid "ITIL Category for Self-service interface (left empty to disable)"
msgstr "Catégorie ITIL pour l'interface libre-service (laissez vide pour désactiver)"
msgstr ""
"Catégorie ITIL pour l'interface libre-service (laissez vide pour désactiver)"
#: inc/process.class.php:679
msgid "Type for Self-service interface"
@@ -674,7 +695,6 @@ msgstr "Type de processus (à modifier uniquement si pas à jour)"
#: inc/process.class.php:862
#, php-format
#| msgid "ProcessMaker plugin is under maintenance, please retry later, thank you."
msgid "Process '%s' is under maintenance, please retry later, thank you."
msgstr "Le processus '%s' est en maintenance, ré-essayez plus tard, merci."
@@ -698,7 +718,8 @@ msgstr "Impossible de créer le cas : pas de droits pour cela !"
#: inc/processmaker.class.php:1012
msgid "Syncs GLPI users and groups into ProcessMaker."
msgstr "Synchronisation des utilisateurs GLPI et des groups avec ProcessMaker."
msgstr ""
"Synchronisation des utilisateurs GLPI et des groupes avec ProcessMaker."
#: inc/processmaker.class.php:1014
msgid "Cleaning of orphan cases."
@@ -712,26 +733,33 @@ msgstr "Nombre de jours avant nettoyage des cas orphelins"
msgid "To apply task actions between cases."
msgstr "Pour appliquer des actions de tâches entre cas."
#: inc/processmaker.class.php:1720
#: inc/processmaker.class.php:1707
msgid "Case title: "
msgstr "Titre du cas : "
#: inc/processmaker.class.php:2275
#: inc/processmaker.class.php:2262
msgid "A 'Case' is running!"
msgstr "Un 'Cas' est en cours !"
#: inc/processmaker.class.php:2276
#: inc/processmaker.class.php:2263
msgid "You must manage it first (see 'Process - Case' tab)!"
msgstr "Vous devez d'abord le terminer (voir onglet 'Processus - Cas') !"
#: inc/processmaker.class.php:2774
#: inc/processmaker.class.php:2779
#, php-format
msgid "Unable to derivate case! Retry in a moment, or ask your administrator.<hr>Error code: %u<br/>Error message: %s<br/>"
msgstr "Impossible de dériver le cas ! Ré-essayez dans un moment, ou demandez à votre administrateur.<hr>Code d'erreur : %u<br/>Message d'erreur : %s<br/>"
msgid ""
"Unable to derivate case! Retry in a moment, or ask your administrator."
"<hr>Error code: %u<br/>Error message: %s<br/>"
msgstr ""
"Impossible de dériver le cas ! Ré-essayez dans un moment, ou demandez à "
"votre administrateur.<hr>Code d'erreur : %u<br/>Message d'erreur : %s<br/>"
#: inc/processmaker.class.php:3281
msgid "ProcessMaker plugin is under maintenance, please retry later, thank you."
msgstr "Le plugin ProcessMaker est en maintenance, veuillez ré-essayer plus tard, merci."
#: inc/processmaker.class.php:3283
msgid ""
"ProcessMaker plugin is under maintenance, please retry later, thank you."
msgstr ""
"Le plugin ProcessMaker est en maintenance, veuillez ré-essayer plus tard, "
"merci."
#: inc/profile.class.php:17
msgid "Process configuration"
@@ -743,7 +771,7 @@ msgstr "Cas"
#: inc/profile.class.php:23
msgid "Ad Hoc user re-assign"
msgstr "Ré-assignation d'un utilisateur Ad Hoc"
msgstr "Réattribution d'un utilisateur Ad Hoc"
#: inc/task.class.php:29
msgid "Process case task"
@@ -756,47 +784,161 @@ msgid "Sub-case task(s)"
msgstr "Tache(s) du sous-cas"
#: inc/taskcategory.class.php:24 inc/taskcategory.class.php:116
#| msgid "Process case"
#| msgid_plural "Process cases"
msgid "Process task"
msgstr "Tâche du processus"
#: inc/taskcategory.class.php:29
#| msgid "Task List"
#: inc/taskcategory.class.php:29 inc/taskcategory.class.php:39
msgid "Task list"
msgstr "List des tâches"
#: inc/taskcategory.class.php:39
msgid "Task List"
msgstr "Liste des tâches"
#: inc/taskcategory.class.php:40 inc/taskcategory.class.php:118
msgid "Task name"
msgstr "Nom de la Tâche"
msgstr "Nom de la tâche"
#: inc/taskcategory.class.php:42 inc/taskcategory.class.php:68
#: inc/taskcategory.class.php:121 inc/taskcategory.class.php:155
msgid "Start"
msgstr "Démarrer"
#: inc/taskcategory.class.php:43 inc/taskcategory.class.php:122
msgid "Task GUID"
msgstr "GUID de la Tâche"
#: inc/taskcategory.class.php:46 inc/taskcategory.class.php:86
#: inc/taskcategory.class.php:125 inc/taskcategory.class.php:173
msgid "Sub-process"
msgstr "Sous-processus"
#: inc/taskcategory.class.php:117
#| msgid "Process case"
#| msgid_plural "Process cases"
msgid "Process name"
msgstr "Nom du procesus"
msgstr "Nom du processus"
#~ msgid "Delete case"
#, fuzzy
#~| msgid "Delete case"
#~ msgid "Delete permanently"
#~ msgstr "Delete case"
#, fuzzy
#~| msgid "None!"
#~ msgid "None"
#~ msgstr "Aucun !"
#, fuzzy
#~| msgid "Maintenance"
#~ msgid "Maintenance mode"
#~ msgstr "Maintenance"
#, fuzzy
#~| msgid "Case id"
#~ msgid "Case URL"
#~ msgstr "ID du cas"
#, fuzzy
#~| msgid "Task guid"
#~ msgid "Task add"
#~ msgstr "Guid de la tâche"
#, fuzzy
#~| msgid "Task re-assigned!"
#~ msgid "Task re-assign"
#~ msgstr "Tâche réattribuée !"
#, fuzzy
#~| msgid "Task un-claimed!"
#~ msgid "Task un-claim"
#~ msgstr "Annulation de l'attribution de la tâche effectuée !"
#, fuzzy
#~| msgid "Task name"
#~ msgid "Task done"
#~ msgstr "Nom de la tâche"
#, fuzzy
#~| msgid "Send reminder"
#~ msgid "Task reminder"
#~ msgstr "Envoyer un rappel"
#, fuzzy
#~| msgid "Creation date"
#~ msgid "Opening date"
#~ msgstr "Date de création"
#, fuzzy
#~| msgid "Case description"
#~ msgid "Description"
#~ msgstr "Description du cas"
#, fuzzy
#~| msgid "Process category id"
#~ msgid "Category id"
#~ msgstr "ID de la catégorie du processus"
#, fuzzy
#~| msgid "Process category comment"
#~ msgid "Category comment"
#~ msgstr "Commentaire de la catégorie du processus"
#, fuzzy
#~| msgid "Task action"
#~ msgid "Total duration"
#~ msgstr "Action de la tâche"
#, fuzzy
#~| msgid "Re-assign task"
#~ msgid "User assigned to task"
#~ msgstr "Réattribuer la tâche"
#, fuzzy
#~| msgid "Case is linked to a %1s"
#~ msgid "User login assigned to task"
#~ msgstr "Le cas est lié à un %1s"
#, fuzzy
#~| msgid "Re-assign task"
#~ msgid "Group assigned to task"
#~ msgstr "Réattribuer la tâche"
#, fuzzy
#~| msgid "Start"
#~ msgid "Start date"
#~ msgstr "Démarrer"
#, fuzzy
#~| msgid "Last update"
#~ msgid "Last updater"
#~ msgstr "Dernière mise à jour"
#, fuzzy
#~| msgid "Task delegation date"
#~ msgid "Delegation index"
#~ msgstr "Date d'attribution de tâche"
#, fuzzy
#~| msgid "Delete case"
#~ msgid "Delete"
#~ msgstr "Delete case"
#, fuzzy
#~| msgctxt "case_status"
#~| msgid "Completed"
#~ msgid "Complete name"
#~ msgstr "Terminé"
#, fuzzy
#~| msgid "Re-assign"
#~ msgctxt "processmaker"
#~ msgid "Re-assign"
#~ msgstr "Réattribuer"
#, fuzzy
#~| msgid "Process case"
#~| msgid_plural "Process cases"
#~ msgctxt "processmaker"
#~ msgid "Process case"
#~ msgstr "Cas du processus"
#~ msgid "Task GUID"
#~ msgstr "Task GUID"
#~ msgid "Task List"
#~ msgstr "Task List"
#~ msgid "Case item"
#~ msgstr "Case item"

File diff suppressed because it is too large Load Diff

BIN
pics/processmaker-mid.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

BIN
pics/processmaker-tiny.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

BIN
pics/processmaker-xxs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

BIN
pics/processmaker.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@@ -29,17 +29,21 @@
<compatibility>9.1</compatibility>
</version>
<version>
<num>3.4.26</num>
<num>3.4.30</num>
<compatibility>9.2</compatibility>
</version>
<version>
<num>3.5.11</num>
<num>3.5.15</num>
<compatibility>9.3</compatibility>
</version>
<version>
<num>3.6.17</num>
<num>3.6.21</num>
<compatibility>9.4</compatibility>
</version>
<version>
<num>4.0.0</num>
<compatibility>9.5</compatibility>
</version>
</versions>
<langs>
<lang>en_gb</lang>

View File

@@ -1,6 +1,6 @@
<?php
define('PROCESSMAKER_VERSION', '3.6.17');
define('PROCESSMAKER_VERSION', '4.0.0');
// used for case cancellation
define("CANCEL", 256);
@@ -13,6 +13,9 @@ function plugin_init_processmaker() {
$PLUGIN_HOOKS['csrf_compliant']['processmaker'] = true;
$plugin = new Plugin();
if ($plugin->isActivated('processmaker')) {
$objects = ['Ticket', 'Change', 'Problem'];
Plugin::registerClass('PluginProcessmakerProcessmaker');
@@ -39,8 +42,8 @@ function plugin_init_processmaker() {
$PLUGIN_HOOKS['pre_show_tab']['processmaker']
= ['PluginProcessmakerProcessmaker', 'pre_show_tab_processmaker'];
$PLUGIN_HOOKS['post_show_tab']['processmaker']
= ['PluginProcessmakerProcessmaker', 'post_show_tab_processmaker'];
//$PLUGIN_HOOKS['post_show_tab']['processmaker']
// = ['PluginProcessmakerProcessmaker', 'post_show_tab_processmaker'];
// Display a menu entry ?
if (Session::haveRightsOr('plugin_processmaker_config', [READ, UPDATE])) {
@@ -122,6 +125,16 @@ function plugin_init_processmaker() {
// otherwise post-only users can't see cases and then can't act on a case task.
$PLUGIN_HOOKS['change_profile']['processmaker'] = 'plugin_processmaker_change_profile';
//if ($plugin->isActivated('processmaker')) {
// in order to manage the password encryption
$pmglpikey = new PluginProcessmakerGlpikey;
foreach ($pmglpikey->getFields() as $fld) {
$PLUGIN_HOOKS['secured_fields'][] = $fld;
}
//}
}
}
@@ -135,8 +148,8 @@ function plugin_version_processmaker() {
'homepage' => 'https://github.com/tomolimo/processmaker',
'requirements' => [
'glpi' => [
'min' => '9.4',
'max' => '9.5'
'min' => '9.5',
'max' => '9.6'
],
]
];
@@ -144,8 +157,8 @@ function plugin_version_processmaker() {
// Optional : check prerequisites before install : may print errors or add to message after redirect
function plugin_processmaker_check_prerequisites() {
if (version_compare(GLPI_VERSION, '9.4', 'lt') || version_compare(GLPI_VERSION, '9.5', 'ge')) {
echo "This plugin requires GLPI >= 9.4 and < 9.5";
if (version_compare(GLPI_VERSION, '9.5', 'lt') || version_compare(GLPI_VERSION, '9.6', 'ge')) {
echo "This plugin requires GLPI >= 9.5 and < 9.6";
return false;
}