diff --git a/workflow/engine/controllers/pmTablesProxy.php b/workflow/engine/controllers/pmTablesProxy.php index 33e2112ec..eee2579f8 100755 --- a/workflow/engine/controllers/pmTablesProxy.php +++ b/workflow/engine/controllers/pmTablesProxy.php @@ -414,39 +414,19 @@ class pmTablesProxy extends HttpProxyController } } - $index = array_search($row->id, $tableCasesList); - if ($index != null) { - global $action; - global $conf; - global $confCasesList; - switch ($index) { - case 'draft': - $confCasesList = $confCasesListDraft; - break; - case 'paused': - $confCasesList = $confCasesListPaused; - break; - case 'sent': - $confCasesList = $confCasesListSent; - break; - case 'todo': - $confCasesList = $confCasesListTodo; - break; - case 'unassigned': - $confCasesList = $confCasesListUnassigned; - break; + foreach ($tableCasesList as $action => $idTable) { + if ($idTable == $row->id) { + $arrayField = $this->getDefaultFields($action, 0); + $arrayConfig = $this->getDefaultConfig($action, 0); + + $resultJson = $this->genericJsonResponse("", array(), $arrayField, $arrayConfig["rowsperpage"], $arrayConfig["dateformat"]); + + $conf = new Configurations(); + $conf->saveObject($resultJson, "casesList", $action, "", "", ""); + } } - $action = $index; - $arrayField = $this->getDefaultFields($action, 0); - $arrayConfig = $this->getDefaultConfig($action, 0); - - $result = $this->genericJsonResponse("", array(), $arrayField, $arrayConfig["rowsperpage"], $arrayConfig["dateformat"]); - - $conf = new Configurations(); - $conf->saveObject($result, "casesList", $action, "", "", ""); - } - if ($row->type == 'CLASSIC') { + if ($row->type == 'CLASSIC') { G::LoadClass( 'reportTables' ); $rp = new reportTables(); $rp->deleteReportTable( $row->id ); diff --git a/workflow/engine/methods/cases/casesListExtJs.php b/workflow/engine/methods/cases/casesListExtJs.php index ce5165ac2..73128d423 100755 --- a/workflow/engine/methods/cases/casesListExtJs.php +++ b/workflow/engine/methods/cases/casesListExtJs.php @@ -23,8 +23,9 @@ $conf = new Configurations(); try { // the setup for search is the same as the Sent (participated) $confCasesList = $conf->getConfiguration( 'casesList', ($action == 'search' || $action == 'simple_search') ? 'search' : $action ); - $table = AdditionalTables::load($confCasesList['PMTable']); - $confCasesList = ($table != null) ? $table : array (); + $aditionalTable = new AdditionalTables(); + $table = $aditionalTable->load($confCasesList['PMTable']); + $confCasesList = ($table != null) ? $confCasesList : array (); $generalConfCasesList = $conf->getConfiguration( 'ENVIRONMENT_SETTINGS', '' ); } catch (Exception $e) { $confCasesList = array ();