From 82db9c21eece9e849c1b0f58198b5618030a8c6b Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Wed, 2 Apr 2014 09:43:58 -0400 Subject: [PATCH 1/2] Arreglo de limit segun config de PM en CASES LIST --- .../src/Services/Api/ProcessMaker/Cases.php | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php index da69a2552..d97610d01 100644 --- a/workflow/engine/src/Services/Api/ProcessMaker/Cases.php +++ b/workflow/engine/src/Services/Api/ProcessMaker/Cases.php @@ -34,7 +34,7 @@ class Cases extends Api */ public function doGetCasesListToDo( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -81,7 +81,7 @@ class Cases extends Api */ public function doGetCasesListToDoPaged( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -128,7 +128,7 @@ class Cases extends Api */ public function doGetCasesListDraft( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -175,7 +175,7 @@ class Cases extends Api */ public function doGetCasesListDraftPaged( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -222,7 +222,7 @@ class Cases extends Api */ public function doGetCasesListParticipated( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -269,7 +269,7 @@ class Cases extends Api */ public function doGetCasesListParticipatedPaged( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -316,7 +316,7 @@ class Cases extends Api */ public function doGetCasesListUnassigned( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -363,7 +363,7 @@ class Cases extends Api */ public function doGetCasesListUnassignedPaged( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -410,7 +410,7 @@ class Cases extends Api */ public function doGetCasesListPaused( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -457,7 +457,7 @@ class Cases extends Api */ public function doGetCasesListPausedPaged( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', @@ -508,7 +508,7 @@ class Cases extends Api */ public function doGetCasesListAdvancedSearch( $start = 0, - $limit = 25, + $limit = 'config', $sort = 'APP_CACHE_VIEW.APP_NUMBER', $dir = 'DESC', $cat_uid = '', From 10059e5ec0a9f5e1adbe0302316952253a7a5282 Mon Sep 17 00:00:00 2001 From: Brayan Osmar Pereyra Suxo Date: Wed, 2 Apr 2014 10:16:21 -0400 Subject: [PATCH 2/2] Correcion de limit y clase G --- framework/src/Maveriks/Extension/Restler.php | 2 +- framework/src/Maveriks/WebApplication.php | 6 +++--- workflow/engine/src/BusinessModel/Cases.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/framework/src/Maveriks/Extension/Restler.php b/framework/src/Maveriks/Extension/Restler.php index e13402ecc..e4f043839 100644 --- a/framework/src/Maveriks/Extension/Restler.php +++ b/framework/src/Maveriks/Extension/Restler.php @@ -52,7 +52,7 @@ class Restler extends \Luracast\Restler\Restler } if ($this->flagMultipart === true) { $responseTemp['status'] = $this->responseCode; - $responseTemp['response'] = \G::json_decode($this->responseData); + $responseTemp['response'] = json_decode($this->responseData); $this->responseMultipart = $responseTemp; } else { echo $this->responseData; diff --git a/framework/src/Maveriks/WebApplication.php b/framework/src/Maveriks/WebApplication.php index 04c8070e5..5add6bd21 100644 --- a/framework/src/Maveriks/WebApplication.php +++ b/framework/src/Maveriks/WebApplication.php @@ -79,7 +79,7 @@ class WebApplication $this->loadEnvironment($request["workspace"]); Util\Logger::log("API::Dispatching ".$_SERVER["REQUEST_METHOD"]." ".$request["uri"]); - if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && \G::toUpper($_SERVER["HTTP_X_REQUESTED_WITH"]) == 'MULTYPART') { + if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtoupper($_SERVER["HTTP_X_REQUESTED_WITH"]) == 'MULTYPART') { $this->multipart($request["uri"], $request["version"]); } else { $this->dispatchApiRequest($request["uri"], $request["version"]); @@ -112,10 +112,10 @@ class WebApplication foreach($input->calls as $value) { $_SERVER["REQUEST_METHOD"] = (empty($value->method)) ? 'GET' : $value->method; $uriTemp = trim($baseUrl) . trim($value->url); - $inputExecute = (empty($value->data)) ? '' : \G::json_encode($value->data); + $inputExecute = (empty($value->data)) ? '' : json_encode($value->data); $this->responseMultipart[] = $this->dispatchApiRequest($uriTemp, $version, true, $inputExecute); } - echo \G::json_encode($this->responseMultipart); + echo json_encode($this->responseMultipart); } /** diff --git a/workflow/engine/src/BusinessModel/Cases.php b/workflow/engine/src/BusinessModel/Cases.php index 70575d64c..87fd0e813 100644 --- a/workflow/engine/src/BusinessModel/Cases.php +++ b/workflow/engine/src/BusinessModel/Cases.php @@ -61,7 +61,7 @@ class Cases if ($start != 0) { $start--; } - if ($limit == 'config') { + if ($limit == 'config' || (abs((int)$limit)) == 0) { G::LoadClass("configuration"); $conf = new \Configurations(); $generalConfCasesList = $conf->getConfiguration('ENVIRONMENT_SETTINGS', '');