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.
This commit is contained in:
jennylee
2014-05-29 16:49:33 -04:00
parent acb7b34880
commit 342436d82f
2 changed files with 7 additions and 8 deletions

View File

@@ -2843,7 +2843,8 @@ 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 .)
@@ -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) != '') {

View File

@@ -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());