Added a filter on TASK_USER.TU_TYPE to be sure that it searches for normal assignment (not adhoc)

Added default groups_id_tech (set to 0) when clearing a task
Set new version to 3.6.5
This commit is contained in:
tomolimo
2019-09-03 08:40:12 +02:00
parent fbd0239e4e
commit eb50535338
4 changed files with 7 additions and 5 deletions

View File

@@ -918,6 +918,7 @@ class PluginProcessmakerCase extends CommonDBTM {
$res = $DB->update('glpi_'.$this->fields['itemtype'].'tasks', [
'state' => 0,
'users_id_tech' => 0,
'groups_id_tech' => 0,
'begin' => null,
'end' => null
], [

View File

@@ -1743,11 +1743,12 @@ class PluginProcessmakerProcessmaker extends CommonDBTM {
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]],
'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

View File

@@ -29,15 +29,15 @@
<compatibility>9.1</compatibility>
</version>
<version>
<num>3.4.13</num>
<num>3.4.14</num>
<compatibility>9.2</compatibility>
</version>
<version>
<num>3.5.4</num>
<num>3.5.5</num>
<compatibility>9.3</compatibility>
</version>
<version>
<num>3.6.4</num>
<num>3.6.5</num>
<compatibility>9.4</compatibility>
</version>
</versions>

View File

@@ -1,6 +1,6 @@
<?php
define('PROCESSMAKER_VERSION', '3.6.4');
define('PROCESSMAKER_VERSION', '3.6.5');
// used for case cancellation
define("CANCEL", 256);