Cherry pick fix for generic user from 3.5.11
Set version 3.6.17
This commit is contained in:
@@ -405,15 +405,11 @@ class PluginProcessmakerTask extends CommonITILTask
|
||||
$used_users = [];
|
||||
$used_users[] = $current_assigned_user;
|
||||
if (array_key_exists($currentUser->taskId, $prevent_assign)) {
|
||||
if (is_array($prevent_assign[$currentUser->taskId])) {
|
||||
foreach ($prevent_assign[$currentUser->taskId] as $pmuser) {
|
||||
$usr_id = PluginProcessmakerUser::getGlpiIdFromAny($pmuser);
|
||||
if ($usr_id) {
|
||||
$used_users[] = $usr_id;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$usr_id = PluginProcessmakerUser::getGlpiIdFromAny($prevent_assign[$currentUser->taskId]);
|
||||
if (!is_array($prevent_assign[$currentUser->taskId])) {
|
||||
$prevent_assign[$currentUser->taskId] = [$prevent_assign[$currentUser->taskId]];
|
||||
}
|
||||
foreach ($prevent_assign[$currentUser->taskId] as $pmuser) {
|
||||
$usr_id = PluginProcessmakerUser::getGlpiIdFromAny($pmuser);
|
||||
if ($usr_id) {
|
||||
$used_users[] = $usr_id;
|
||||
}
|
||||
|
||||
@@ -303,9 +303,11 @@ class PluginProcessmakerUser extends CommonDBTM {
|
||||
* @return string which is the uid of user in Processmaker database, or false if not found
|
||||
*/
|
||||
public static function getPMUserId($glpiUserId) {
|
||||
$obj = new self;
|
||||
if ($obj->getFromDB( Toolbox::cleanInteger($glpiUserId) )) {
|
||||
return $obj->fields['pm_users_id'];
|
||||
if (is_numeric($glpiUserId)) {
|
||||
$obj = new self;
|
||||
if ($obj->getFromDB($glpiUserId)) {
|
||||
return $obj->fields['pm_users_id'];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -316,7 +318,7 @@ class PluginProcessmakerUser extends CommonDBTM {
|
||||
* Returns the GLPI id of the user or false if not found
|
||||
* Accept either PM GUID, GLPI logon, or GLPI ID
|
||||
* @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) {
|
||||
$ret = self::getGLPIUserId($any);
|
||||
|
||||
@@ -29,15 +29,15 @@
|
||||
<compatibility>9.1</compatibility>
|
||||
</version>
|
||||
<version>
|
||||
<num>3.4.25</num>
|
||||
<num>3.4.26</num>
|
||||
<compatibility>9.2</compatibility>
|
||||
</version>
|
||||
<version>
|
||||
<num>3.5.10</num>
|
||||
<num>3.5.11</num>
|
||||
<compatibility>9.3</compatibility>
|
||||
</version>
|
||||
<version>
|
||||
<num>3.6.16</num>
|
||||
<num>3.6.17</num>
|
||||
<compatibility>9.4</compatibility>
|
||||
</version>
|
||||
</versions>
|
||||
|
||||
Reference in New Issue
Block a user