Merged in develop (pull request #5780)
Develop Approved-by: Paula Quispe <paula.quispe@processmaker.com>
This commit is contained in:
@@ -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')
|
||||
@@ -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')
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
/**
|
||||
* Home controller
|
||||
*
|
||||
* @author Erik Amaru Ortiz <erik@colosa.com, aortiz.erik@gmail.com>
|
||||
* @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();
|
||||
|
||||
@@ -40,7 +45,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 +305,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 +397,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 +466,34 @@ 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;
|
||||
}
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
@@ -532,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;
|
||||
|
||||
@@ -557,7 +597,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 +613,25 @@ 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->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);
|
||||
$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 +695,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 +710,7 @@ class Home extends Controller
|
||||
|
||||
/**
|
||||
* Get the list of active processes
|
||||
*
|
||||
*
|
||||
* @global type $oAppCache
|
||||
* @param type $action
|
||||
* @param type $userUid
|
||||
|
||||
@@ -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 : '',
|
||||
|
||||
Reference in New Issue
Block a user