Cherry pick fix for generic user from 3.5.11

Set version 3.6.17
This commit is contained in:
tomolimo
2020-10-12 15:38:17 +02:00
parent ca197c9f43
commit c895643c5c
4 changed files with 15 additions and 17 deletions

View File

@@ -405,15 +405,11 @@ class PluginProcessmakerTask extends CommonITILTask
$used_users = []; $used_users = [];
$used_users[] = $current_assigned_user; $used_users[] = $current_assigned_user;
if (array_key_exists($currentUser->taskId, $prevent_assign)) { if (array_key_exists($currentUser->taskId, $prevent_assign)) {
if (is_array($prevent_assign[$currentUser->taskId])) { if (!is_array($prevent_assign[$currentUser->taskId])) {
foreach ($prevent_assign[$currentUser->taskId] as $pmuser) { $prevent_assign[$currentUser->taskId] = [$prevent_assign[$currentUser->taskId]];
$usr_id = PluginProcessmakerUser::getGlpiIdFromAny($pmuser); }
if ($usr_id) { foreach ($prevent_assign[$currentUser->taskId] as $pmuser) {
$used_users[] = $usr_id; $usr_id = PluginProcessmakerUser::getGlpiIdFromAny($pmuser);
}
}
} else {
$usr_id = PluginProcessmakerUser::getGlpiIdFromAny($prevent_assign[$currentUser->taskId]);
if ($usr_id) { if ($usr_id) {
$used_users[] = $usr_id; $used_users[] = $usr_id;
} }

View File

@@ -303,9 +303,11 @@ class PluginProcessmakerUser extends CommonDBTM {
* @return string which is the uid of user in Processmaker database, or false if not found * @return string which is the uid of user in Processmaker database, or false if not found
*/ */
public static function getPMUserId($glpiUserId) { public static function getPMUserId($glpiUserId) {
$obj = new self; if (is_numeric($glpiUserId)) {
if ($obj->getFromDB( Toolbox::cleanInteger($glpiUserId) )) { $obj = new self;
return $obj->fields['pm_users_id']; if ($obj->getFromDB($glpiUserId)) {
return $obj->fields['pm_users_id'];
}
} }
return false; return false;
} }
@@ -316,7 +318,7 @@ class PluginProcessmakerUser extends CommonDBTM {
* Returns the GLPI id of the user or false if not found * Returns the GLPI id of the user or false if not found
* Accept either PM GUID, GLPI logon, or GLPI ID * Accept either PM GUID, GLPI logon, or GLPI ID
* @param $any * @param $any
* @return mixed GLPI ID of the user or fasle if not found * @return mixed GLPI ID of the user or false if not found
*/ */
public static function getGlpiIdFromAny($any) { public static function getGlpiIdFromAny($any) {
$ret = self::getGLPIUserId($any); $ret = self::getGLPIUserId($any);

View File

@@ -29,15 +29,15 @@
<compatibility>9.1</compatibility> <compatibility>9.1</compatibility>
</version> </version>
<version> <version>
<num>3.4.25</num> <num>3.4.26</num>
<compatibility>9.2</compatibility> <compatibility>9.2</compatibility>
</version> </version>
<version> <version>
<num>3.5.10</num> <num>3.5.11</num>
<compatibility>9.3</compatibility> <compatibility>9.3</compatibility>
</version> </version>
<version> <version>
<num>3.6.16</num> <num>3.6.17</num>
<compatibility>9.4</compatibility> <compatibility>9.4</compatibility>
</version> </version>
</versions> </versions>

View File

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