From 47e7f8bfd71e9c56f676b9616e7fdb020dd4d578 Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Thu, 25 May 2017 11:51:38 -0400 Subject: [PATCH] HOR-2887 problem resolved in unassigned list --- workflow/engine/controllers/home.php | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/workflow/engine/controllers/home.php b/workflow/engine/controllers/home.php index be5a4be9f..c298b5a59 100644 --- a/workflow/engine/controllers/home.php +++ b/workflow/engine/controllers/home.php @@ -446,25 +446,15 @@ class Home extends Controller if (true) { //In enterprise version this block of code should always be executed //In community version this block of code is deleted and is executed the other - $list = new \ProcessMaker\BusinessModel\Lists(); - $listName = 'inbox'; - switch ($type) { - case 'draft': - case 'todo': - $listName = 'inbox'; - //The change is made because the method 'getList()' does not - //support 'USR_UID', this method uses the numeric field 'USR_ID'. - $userObject = Users::loadById($dataList['userId']); - $dataList['userId'] = $userObject->getUsrUid(); - $cases = $list->getList($listName, $dataList); - break; - case 'unassigned': - $case = new \ProcessMaker\BusinessModel\Cases(); - $cases = $case->getList($dataList); - foreach ($cases['data'] as &$value) { - $value = array_change_key_case($value, CASE_UPPER); - } - break; + $swType = $type === "todo" || $type === "draft"; + if ($swType || $type === "unassigned") { + //The change is made because the method 'getList()' does not + //support 'USR_UID', this method uses the numeric field 'USR_ID'. + $userObject = Users::loadById($dataList['userId']); + $dataList['userId'] = $userObject->getUsrUid(); + $listType = $swType ? "inbox" : $type; + $list = new \ProcessMaker\BusinessModel\Lists(); + $cases = $list->getList($listType, $dataList); } } else { /*----------------------------------********---------------------------------*/