Skip to content

Commit

Permalink
Merge pull request #111 from tomolimo/3.6/bugfixes
Browse files Browse the repository at this point in the history
Cherry pick fix for generic user from 3.5.11
  • Loading branch information
tomolimo authored Oct 12, 2020
2 parents b37f6f6 + c895643 commit 6ada191
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 17 deletions.
14 changes: 5 additions & 9 deletions inc/task.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,15 +405,11 @@ static function displayTabContentForItem(CommonGLPI $case, $tabnum = 1, $withtem
$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;
}
Expand Down
10 changes: 6 additions & 4 deletions inc/user.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,11 @@ public static function getGLPIUserId($pmUserId) {
* @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;
}
Expand All @@ -316,7 +318,7 @@ public static function getPMUserId($glpiUserId) {
* 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);
Expand Down
6 changes: 3 additions & 3 deletions processmaker.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion setup.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

define('PROCESSMAKER_VERSION', '3.6.16');
define('PROCESSMAKER_VERSION', '3.6.17');

// used for case cancellation
define("CANCEL", 256);
Expand Down

0 comments on commit 6ada191

Please sign in to comment.