diff --git a/workflow/engine/methods/cases/casesListExtJs.php b/workflow/engine/methods/cases/casesListExtJs.php index 09b192b47..18d36ee1a 100755 --- a/workflow/engine/methods/cases/casesListExtJs.php +++ b/workflow/engine/methods/cases/casesListExtJs.php @@ -104,11 +104,17 @@ try { $generalConfCasesList = array (); } +$caseListBuilder = (count($confCasesList)) ? 1 : 0; +if ($caseListBuilder) { + $urlProxy = 'proxyCasesList'; +} + // reassign header configuration $confReassignList = getReassignList(); // evaluates an action and the configuration for the list that will be rendered $config = getAdditionalFields( $action, $confCasesList ); + $columns = $config['caseColumns']; $readerFields = $config['caseReaderFields']; $reassignColumns = $confReassignList['caseColumns']; @@ -188,6 +194,7 @@ $oHeadPublisher->assign( 'readerFields', $readerFields ); //sending the fields t $oHeadPublisher->assign( 'reassignColumns', $reassignColumns ); //sending the columns to display in grid $oHeadPublisher->assign( 'action', $action ); //sending the action to make $oHeadPublisher->assign( 'urlProxy', $urlProxy ); //sending the urlProxy to make +$oHeadPublisher->assign( 'caseListBuilder', $caseListBuilder ); //sending the caseListBuilder /*----------------------------------********---------------------------------*/ $oHeadPublisher->assign( 'credentials', $clientToken ); //sending the SYS_SYS to make /*----------------------------------********---------------------------------*/ @@ -486,7 +493,6 @@ function getAdditionalFields($action, $confCasesList = array()) $caseReaderFieldsAux[] = $arrayField["name"]; } } - foreach ($arrayConfig["caseReaderFields"] as $index => $value) { if (!in_array($value["name"], $caseReaderFieldsAux)) { $caseReaderFields[] = $value; diff --git a/workflow/engine/templates/cases/casesList.js b/workflow/engine/templates/cases/casesList.js index 59f73908b..6f73784da 100755 --- a/workflow/engine/templates/cases/casesList.js +++ b/workflow/engine/templates/cases/casesList.js @@ -736,18 +736,26 @@ Ext.onReady ( function() { // Create HttpProxy instance, all CRUD requests will be directed to single proxy url. - var proxyCasesList = new Ext.data.HttpProxy({ - api: { - read : urlProxy - } - /*----------------------------------********---------------------------------*/ - ,method: 'GET' - ,headers: { - 'Content-Type': 'application/json', - 'Authorization': 'Bearer ' + credentials.access_token - } - /*----------------------------------********---------------------------------*/ - }); + if (caseListBuilder) { + var proxyCasesList = new Ext.data.HttpProxy({ + api: { + read : urlProxy + } + }); + } else { + var proxyCasesList = new Ext.data.HttpProxy({ + api: { + read : urlProxy + } + /*----------------------------------********---------------------------------*/ + ,method: 'GET' + ,headers: { + 'Content-Type': 'application/json', + 'Authorization': 'Bearer ' + credentials.access_token + } + /*----------------------------------********---------------------------------*/ + }); + } // Typical JsonReader with additional meta-data params for defining the core attributes of your json-response // the readerFields is defined in PHP server side