From 1004759c40a5af914fc0a4902644f7b24ab085bd Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Mon, 12 Jun 2017 18:00:57 -0400 Subject: [PATCH 1/6] HOR-3306 --- workflow/engine/controllers/home.php | 140 +++++++++++++-------------- 1 file changed, 67 insertions(+), 73 deletions(-) diff --git a/workflow/engine/controllers/home.php b/workflow/engine/controllers/home.php index c298b5a59..20f138a0d 100644 --- a/workflow/engine/controllers/home.php +++ b/workflow/engine/controllers/home.php @@ -40,7 +40,7 @@ class Home extends Controller $this->userName = isset( $_SESSION['USR_USERNAME'] ) ? $_SESSION['USR_USERNAME'] : ''; $this->userFullName = isset( $_SESSION['USR_FULLNAME'] ) ? $_SESSION['USR_FULLNAME'] : ''; $this->userRolName = isset( $_SESSION['USR_ROLENAME'] ) ? $_SESSION['USR_ROLENAME'] : ''; - + $users = new Users(); $users = $users->load($this->userID); $this->usrId = $users["USR_ID"]; @@ -300,8 +300,23 @@ class Home extends Controller $userObject = Users::loadById($user); $userName = $userObject->getUsrLastname() . " " . $userObject->getUsrFirstname(); } - - $cases = $this->getAppsData( $httpData->t, null, null, $user, null, $search, $process, $status, $dateFrom, $dateTo, null, null, 'APP_CACHE_VIEW.APP_NUMBER', $category); + + $cases = $this->getAppsData( + $httpData->t, + null, + null, + $user, + null, + $search, + $process, + $status, + $dateFrom, + $dateTo, + null, + null, + 'APP_CACHE_VIEW.APP_NUMBER', + $category + ); $arraySearch = array($process, $status, $search, $category, $user, $dateFrom, $dateTo ); // settings vars and rendering @@ -377,7 +392,11 @@ class Home extends Controller $user = null; break; case null: - $user = $this->usrId; + if ($type === 'search') { + $user = null; + } else { + $user = $this->usrId; + } break; default: //$user = $this->userID; @@ -442,17 +461,35 @@ class Home extends Controller $dataList['sort'] = $sort; $dataList['category'] = $category; $dataList['action'] = $type; + $dataList['dir'] = 'DESC'; /*----------------------------------********---------------------------------*/ 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 - $swType = $type === "todo" || $type === "draft"; - if ($swType || $type === "unassigned") { - //The change is made because the method 'getList()' does not + $listType = ''; + if (!empty($type)) { + switch ($type) { + case 'todo': + $listType = 'inbox'; + break; + case 'draft': + $listType = 'inbox'; + break; + case 'unassigned': + $listType = 'unassigned'; + break; + case 'search': + $dataList['filterStatus'] = $status; + break; + } + } + + //$swType = $type === "todo" || $type === "draft"; + if (!empty($listType)) { + //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); } @@ -557,7 +594,9 @@ class Home extends Controller function getUserArray($action, $userUid, $search = null) { - global $oAppCache; + G::LoadClass("configuration"); + $conf = new Configurations(); + $confEnvSetting = $conf->getFormats(); $status = array(); $users[] = array("CURRENT_USER", G::LoadTranslation("ID_CURRENT_USER")); $users[] = array("ALL", G::LoadTranslation("ID_ALL_USERS")); @@ -571,16 +610,23 @@ class Home extends Controller $cUsers->addSelectColumn(UsersPeer::USR_UID); $cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME); $cUsers->addSelectColumn(UsersPeer::USR_LASTNAME); + $cUsers->addSelectColumn(UsersPeer::USR_USERNAME); $cUsers->addSelectColumn(UsersPeer::USR_ID); if (!empty($search)) { - $cUsers->addOr(UsersPeer::USR_FIRSTNAME, "%$search%", Criteria::LIKE); - $cUsers->addOr(UsersPeer::USR_LASTNAME, "%$search%", Criteria::LIKE); + $cUsers->addOr(UsersPeer::USR_FIRSTNAME, '%' . $search . '%', Criteria::LIKE); + $cUsers->addOr(UsersPeer::USR_LASTNAME, '%' . $search . '%', Criteria::LIKE); } $oDataset = UsersPeer::doSelectRS($cUsers); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); $oDataset->next(); while ($aRow = $oDataset->getRow()) { - $users[] = array($aRow['USR_ID'], htmlentities($aRow['USR_LASTNAME'] . ' ' . $aRow['USR_FIRSTNAME'], ENT_QUOTES, "UTF-8")); + $usrFullName = $conf->usersNameFormatBySetParameters( + $confEnvSetting["format"], + $aRow["USR_USERNAME"], + $aRow["USR_FIRSTNAME"], + $aRow["USR_LASTNAME"] + ); + $users[] = array($aRow['USR_ID'], htmlentities($usrFullName, ENT_QUOTES, "UTF-8")); $oDataset->next(); } break; @@ -644,66 +690,14 @@ class Home extends Controller function getStatusArray ($action, $userUid) { - global $oAppCache; - $status = array (); - $status[] = array ('',G::LoadTranslation( 'ID_ALL_STATUS' )); - //get the list based in the action provided - switch ($action) { - case 'sent': - $cStatus = $oAppCache->getSentListProcessCriteria( $userUid ); // a little slow - break; - case 'simple_search': - case 'search': - $cStatus = new Criteria( 'workflow' ); - $cStatus->clearSelectColumns(); - $cStatus->setDistinct(); - $cStatus->addSelectColumn( ApplicationPeer::APP_STATUS ); - $oDataset = ApplicationPeer::doSelectRS( $cStatus ); - $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); - $oDataset->next(); - while ($aRow = $oDataset->getRow()) { - $status[] = array ($aRow['APP_STATUS'],G::LoadTranslation( 'ID_CASES_STATUS_' . $aRow['APP_STATUS'] ) - ); //here we can have a translation for the status ( the second param) - $oDataset->next(); - } - return $status; - break; - case 'selfservice': - $cStatus = $oAppCache->getUnassignedListCriteria( $userUid ); - break; - case 'paused': - $cStatus = $oAppCache->getPausedListCriteria( $userUid ); - break; - case 'to_revise': - $cStatus = $oAppCache->getToReviseListCriteria( $userUid ); - // $cStatus = $oAppCache->getPausedListCriteria($userUid); - break; - case 'to_reassign': - $cStatus = $oAppCache->getToReassignListCriteria($userUid); - break; - case 'todo': - case 'draft': - case 'gral': - // case 'to_revise' : - default: - return $status; - break; - } - - //get the status for this user in this action only for participated, unassigned, paused - // if ( $action != 'todo' && $action != 'draft' && $action != 'to_revise') { - if ($action != 'todo' && $action != 'draft') { - //$cStatus = new Criteria('workflow'); - $cStatus->clearSelectColumns(); - $cStatus->setDistinct(); - $cStatus->addSelectColumn( AppCacheViewPeer::APP_STATUS ); - $oDataset = AppCacheViewPeer::doSelectRS( $cStatus ); - $oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC ); - $oDataset->next(); - while ($aRow = $oDataset->getRow()) { - $status[] = array ($aRow['APP_STATUS'],G::LoadTranslation( 'ID_CASES_STATUS_' . $aRow['APP_STATUS'] )); - //here we can have a translation for the status ( the second param) - $oDataset->next(); + $status = array(); + $aStatus = Application::$app_status_values; + $status[] = array('', G::LoadTranslation('ID_ALL_STATUS')); + foreach ($aStatus as $key => $value) { + if ($action == 'search') { + $status[] = array ($value, G::LoadTranslation( 'ID_CASES_STATUS_' . $key )); + } else { + $status[] = array ($key, G::LoadTranslation( 'ID_CASES_STATUS_' . $key )); } } return $status; @@ -711,7 +705,7 @@ class Home extends Controller /** * Get the list of active processes - * + * * @global type $oAppCache * @param type $action * @param type $userUid From 54193f04923969e91b593c6ed75344f2fa00fc7f Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Tue, 20 Jun 2017 16:10:44 -0400 Subject: [PATCH 2/6] HOR-3390 --- gulliver/system/class.rbac.php | 16 ++++++++++++++++ workflow/engine/controllers/home.php | 11 +++++++---- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/gulliver/system/class.rbac.php b/gulliver/system/class.rbac.php index b24f0104f..070a0b113 100644 --- a/gulliver/system/class.rbac.php +++ b/gulliver/system/class.rbac.php @@ -127,6 +127,22 @@ class RBAC 'getCaledarList' => array(), 'getPMVariables' => array(), 'generateBpmn' => array() + ), + 'home.php' => array( + 'login' => array('PM_LOGIN'), + 'index' => array('PM_CASES'), + 'indexSingle' => array('PM_CASES'), + 'appList' => array('PM_CASES'), + 'appAdvancedSearch' => array('PM_ALLCASES'), + 'getApps' => array('PM_ALLCASES'), + 'getAppsData' => array('PM_ALLCASES'), + 'startCase' => array('PM_CASES'), + 'error' => array(), + 'getUserArray' => array('PM_ALLCASES'), + 'getCategoryArray' => array('PM_ALLCASES'), + 'getAllUsersArray' => array('PM_ALLCASES'), + 'getStatusArray' => array('PM_ALLCASES'), + 'getProcessArray' => array('PM_ALLCASES') ) ); diff --git a/workflow/engine/controllers/home.php b/workflow/engine/controllers/home.php index 20f138a0d..42f32e571 100644 --- a/workflow/engine/controllers/home.php +++ b/workflow/engine/controllers/home.php @@ -3,7 +3,6 @@ /** * Home controller * - * @author Erik Amaru Ortiz * @inherits Controller * @access public */ @@ -24,9 +23,15 @@ class Home extends Controller private $lastSkin; private $usrId; + public function call ($name) + { + global $RBAC; + $RBAC->allows(basename(__FILE__), $name); + parent::call($name); + } + public function __construct () { - //die($_SESSION['user_experience']); // setting client browser information $this->clientBrowser = G::getBrowser(); @@ -484,7 +489,6 @@ class Home extends Controller } } - //$swType = $type === "todo" || $type === "draft"; if (!empty($listType)) { //The change is made because the method 'getList()' does not //support 'USR_UID', this method uses the numeric field 'USR_ID'. @@ -569,7 +573,6 @@ class Home extends Controller $oCase = new Cases(); $aNextStep = $oCase->getNextStep( $_SESSION['PROCESS'], $_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['STEP_POSITION'] ); - //../cases/cases_Open?APP_UID={$APP.APP_UID}&DEL_INDEX={$APP.DEL_INDEX}&action=todo $aNextStep['PAGE'] = '../cases/cases_Open?APP_UID=' . $aData['APPLICATION'] . '&DEL_INDEX=' . $aData['INDEX'] . '&action=draft'; $_SESSION['BREAKSTEP']['NEXT_STEP'] = $aNextStep; From 1ec4a9ba4b28bac4eb6069e8f2f250b7a9cc95d4 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Thu, 22 Jun 2017 13:43:11 -0400 Subject: [PATCH 3/6] Suggest user --- workflow/engine/controllers/home.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/workflow/engine/controllers/home.php b/workflow/engine/controllers/home.php index 20f138a0d..2ad3a0060 100644 --- a/workflow/engine/controllers/home.php +++ b/workflow/engine/controllers/home.php @@ -484,7 +484,6 @@ class Home extends Controller } } - //$swType = $type === "todo" || $type === "draft"; if (!empty($listType)) { //The change is made because the method 'getList()' does not //support 'USR_UID', this method uses the numeric field 'USR_ID'. @@ -613,8 +612,10 @@ class Home extends Controller $cUsers->addSelectColumn(UsersPeer::USR_USERNAME); $cUsers->addSelectColumn(UsersPeer::USR_ID); if (!empty($search)) { - $cUsers->addOr(UsersPeer::USR_FIRSTNAME, '%' . $search . '%', Criteria::LIKE); - $cUsers->addOr(UsersPeer::USR_LASTNAME, '%' . $search . '%', Criteria::LIKE); + $cUsers->add( + $cUsers->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $search . '%', Criteria::LIKE)->addOr( + $cUsers->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $search . '%', Criteria::LIKE)) + ); } $oDataset = UsersPeer::doSelectRS($cUsers); $oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC); From 04502f58fab46cfe7cc996b4b9fabc8a79a896b6 Mon Sep 17 00:00:00 2001 From: Rodrigo Quelca Date: Mon, 26 Jun 2017 15:40:21 -0400 Subject: [PATCH 4/6] FBI-1914: Some of the options in designer like show debug mode,etc are not showing in the UI rollback to FBI-1901 and fix the contextmenu problems code style --- workflow/engine/templates/processes/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/workflow/engine/templates/processes/main.js b/workflow/engine/templates/processes/main.js index 741a51c7b..16e30d51c 100644 --- a/workflow/engine/templates/processes/main.js +++ b/workflow/engine/templates/processes/main.js @@ -408,7 +408,7 @@ Ext.onReady(function(){ processesGrid = new Ext.grid.GridPanel( { region: 'center', layout: 'fit', - id: 'granularGridPanel', + id: 'processesGrid', height: 500, width:'', title : '', @@ -1207,7 +1207,7 @@ function exportImportProcessObjects(typeAction) gridProcessObjects = new Ext.grid.EditorGridPanel( { region: 'center', layout: 'fit', - id: 'processesGrid', + id: 'gridProcessObjects', height:365, width:355, title : '', From debbeb7785c30cf220335eb639582aafc3d0566c Mon Sep 17 00:00:00 2001 From: Roly Rudy Gutierrez Pinto Date: Thu, 29 Jun 2017 14:11:40 -0400 Subject: [PATCH 5/6] HOR-3436 --- workflow/engine/classes/class.AppSolr.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/workflow/engine/classes/class.AppSolr.php b/workflow/engine/classes/class.AppSolr.php index 37312e958..ba53d3143 100644 --- a/workflow/engine/classes/class.AppSolr.php +++ b/workflow/engine/classes/class.AppSolr.php @@ -1980,6 +1980,12 @@ class AppSolr } else { foreach ($UnSerializedCaseData as $k => $value) { + //This validation is only for the 'checkbox' control for the BPMN forms, + //the request is not made to the database to obtain the control + //associated with the variable so as not to decrease the performance. + if (is_array($value) && count($value) === 1 && isset($value[0]) && !is_object($value[0]) && !is_array($value[0])) { + $value = $value[0]; + } if (! is_array ($value) && ! is_object ($value) && $value != '' && $k != 'SYS_LANG' && $k != 'SYS_SKIN' && $k != 'SYS_SYS') { // search the field type in array of dynaform fields if (! empty ($dynaformFieldTypes) && array_key_exists (trim ($k), $dynaformFieldTypes)) { From eb123d1729f47f3034b532070f11c8484308ce79 Mon Sep 17 00:00:00 2001 From: Paula Quispe Date: Fri, 30 Jun 2017 10:13:18 -0400 Subject: [PATCH 6/6] HOR-3462 --- gulliver/system/class.rbac.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulliver/system/class.rbac.php b/gulliver/system/class.rbac.php index b24f0104f..6fcf14e05 100644 --- a/gulliver/system/class.rbac.php +++ b/gulliver/system/class.rbac.php @@ -103,9 +103,9 @@ class RBAC 'importSkin' => array('PM_SETUP_SKIN'), 'exportSkin' => array('PM_SETUP_SKIN'), 'deleteSkin' => array('PM_SETUP_SKIN'), + 'streamSkin' => array('PM_SETUP_SKIN'), 'addTarFolder' => array('PM_SETUP_SKIN'), - 'copy_skin_folder' => array('PM_SETUP_SKIN'), - 'deleteSkin' => array('PM_SETUP_SKIN') + 'copy_skin_folder' => array('PM_SETUP_SKIN') ), 'processes_DownloadFile.php' => array( 'downloadFileHash' => array('PM_FACTORY')