From 342436d82f87651ff193356b634e75307c99a1f4 Mon Sep 17 00:00:00 2001 From: jennylee Date: Thu, 29 May 2014 16:49:33 -0400 Subject: [PATCH] BUG-15068 PMFPauseCase dosen`t pause the case whrn using the trigger wizzard. The validation for the not required parameter "unpauseDate" was wrong. When this parameter was empty the validation was taking this like this has a date, so it was trying to check the date format, and this was giving an error. The validation was changed to only let strings of 10 or more characters go into the next validation where the format of the date is checked. --- workflow/engine/classes/class.pmFunctions.php | 7 ++++--- workflow/engine/classes/class.wsBase.php | 8 +++----- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/workflow/engine/classes/class.pmFunctions.php b/workflow/engine/classes/class.pmFunctions.php index 1c769798a..b7d3c486d 100755 --- a/workflow/engine/classes/class.pmFunctions.php +++ b/workflow/engine/classes/class.pmFunctions.php @@ -2843,8 +2843,9 @@ function PMFAddAttachmentToArray($arrayData, $index, $value, $suffix = " Copy({i * * It delete the mask a field. * - * @name PMFAddAttachmentToArray - * + * @name PMFRemoveMask + * @label PMF Remove Mask + * * @param string | $field | Value the field * @param string | $separator | Separator of thousands (, or .) * @param string | $currency | symbol of currency @@ -2852,7 +2853,7 @@ function PMFAddAttachmentToArray($arrayData, $index, $value, $suffix = " Copy({i * */ -function PMRemoveMask ($field, $separator = '.', $currency = '') +function PMFRemoveMask ($field, $separator = '.', $currency = '') { $sep = array(); if ( trim($currency) != '') { diff --git a/workflow/engine/classes/class.wsBase.php b/workflow/engine/classes/class.wsBase.php index 9a965b85e..7f00851e3 100755 --- a/workflow/engine/classes/class.wsBase.php +++ b/workflow/engine/classes/class.wsBase.php @@ -3079,7 +3079,6 @@ class wsBase return $result; } - if (empty( $userUid )) { $result = new wsResponse( 100, G::LoadTranslation( "ID_REQUIRED_FIELD" ) . " userUid" ); @@ -3087,8 +3086,7 @@ class wsBase return $result; } - - if (! empty( $unpauseDate )) { + if( strlen($unpauseDate) >=10 ){ if (! preg_match( "/^\d{4}-\d{2}-\d{2}| \d{2}:\d{2}:\d{2}$/", $unpauseDate )) { $result = new wsResponse( 100, G::LoadTranslation( "ID_INVALID_DATA" ) . " $unpauseDate" ); @@ -3096,8 +3094,9 @@ class wsBase return $result; } + } else { + $unpauseDate = null; } - $case = new Cases(); $case->pauseCase( $caseUid, $delIndex, $userUid, $unpauseDate ); @@ -3108,7 +3107,6 @@ class wsBase ); $g->sessionVarRestore(); - return $result; } catch (Exception $e) { $result = new wsResponse(100, $e->getMessage());