From b9e38bd8573bc34e4e556985f7f02d67b7fe94dd Mon Sep 17 00:00:00 2001 From: Ronald Q Date: Fri, 29 Apr 2016 11:04:51 -0400 Subject: [PATCH 1/2] HOR-894 Crear 2 end points para grabar y recuperar las variables sin timezone --- .../src/ProcessMaker/Services/Api/Light.php | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/workflow/engine/src/ProcessMaker/Services/Api/Light.php b/workflow/engine/src/ProcessMaker/Services/Api/Light.php index f9b1aff49..3b0b00643 100644 --- a/workflow/engine/src/ProcessMaker/Services/Api/Light.php +++ b/workflow/engine/src/ProcessMaker/Services/Api/Light.php @@ -1478,6 +1478,47 @@ class Light extends Api return $response; } + /** + * Get Case Variables + * + * @param string $app_uid {@min 1}{@max 32} + * + * @url GET /:app_uid/variables + */ + public function doGetCaseVariables($app_uid) + { + try { + $usr_uid = $this->getUserId(); + $cases = new \ProcessMaker\BusinessModel\Cases(); + $response = $cases->getCaseVariables($app_uid, $usr_uid); + return DateTime::convertUtcToTimeZone($response); + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + + /** + * Put Case Variables + * + * @param string $app_uid {@min 1}{@max 32} + * @param array $request_data + * @param string $dyn_uid {@from path} + * @param string $del_index {@from path} + * + * @url PUT /:app_uid/variable + */ + public function doPutCaseVariables($app_uid, $request_data, $dyn_uid = '', $del_index = 0) + { + try { + $usr_uid = $this->getUserId(); + $cases = new \ProcessMaker\BusinessModel\Cases(); + $request_data = \ProcessMaker\Util\DateTime::convertDataToUtc($request_data); + $cases->setCaseVariables($app_uid, $request_data, $dyn_uid, $usr_uid, $del_index); + } catch (\Exception $e) { + throw (new RestException(Api::STAT_APP_EXCEPTION, $e->getMessage())); + } + } + /** * Get in base64 the image process (processmap) * From b86e43fa6f6bf3e06b3d03d464f88fc895bf33dd Mon Sep 17 00:00:00 2001 From: Ronald Q Date: Fri, 29 Apr 2016 14:06:05 -0400 Subject: [PATCH 2/2] HOR-896 (Change log) Controles mobile una vez editado ya no se muestran en el listado de cambios --- workflow/engine/classes/class.case.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/workflow/engine/classes/class.case.php b/workflow/engine/classes/class.case.php index 2c2a941da..5da912088 100755 --- a/workflow/engine/classes/class.case.php +++ b/workflow/engine/classes/class.case.php @@ -1007,8 +1007,16 @@ class Cases $fieldsOnBoth = @array_intersect_assoc($FieldsBefore['APP_DATA'], $aApplicationFields); //Add fields that weren't in previous version foreach ($aApplicationFields as $key => $value) { - if (!(isset($fieldsOnBoth[$key]))) { - $FieldsDifference[$key] = $value; + if (is_array($value) && is_array($fieldsOnBoth[$key])){ + $afieldDifference = $this->arrayRecursiveDiff($value,$fieldsOnBoth[$key]); + $dfieldDifference = $this->arrayRecursiveDiff($fieldsOnBoth[$key],$value); + if ($afieldDifference || $dfieldDifference){ + $FieldsDifference[$key] = $value; + } + } else { + if (!(isset($fieldsOnBoth[$key]))) { + $FieldsDifference[$key] = $value; + } } } if ((is_array($FieldsDifference)) && (count($FieldsDifference) > 0)) {