Merged in feature/HOR-2440 (pull request #5485)
Feature/HOR-2440 Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
@@ -47,10 +47,10 @@ switch ($action) {
|
||||
$urlProxy .= '?list=unassigned';
|
||||
break;
|
||||
case 'to_revise':
|
||||
$urlProxy = 'proxyCasesList';
|
||||
$urlProxy .= '?list=inbox';
|
||||
break;
|
||||
case 'to_reassign':
|
||||
$urlProxy = 'proxyCasesList';
|
||||
$urlProxy .= '?list=inbox';
|
||||
break;
|
||||
}
|
||||
/*----------------------------------********---------------------------------*/
|
||||
@@ -139,8 +139,6 @@ if ($action == "todo" || $action == "draft" || $action == "sent" || $action == "
|
||||
$processes[] = array ('',G::LoadTranslation( 'ID_ALL_PROCESS' ));
|
||||
$status = getStatusArray( $action, $userUid );
|
||||
$category = getCategoryArray();
|
||||
$users = getUserArray( $action, $userUid );
|
||||
$allUsers = getAllUsersArray( $action );
|
||||
|
||||
$oHeadPublisher->assign( 'reassignReaderFields', $reassignReaderFields ); //sending the fields to get from proxy
|
||||
$oHeadPublisher->addExtJsScript( 'cases/reassignList', false );
|
||||
@@ -160,8 +158,6 @@ $oHeadPublisher->assign( 'PMDateFormat', $dateFormat ); //sending the fields to
|
||||
$oHeadPublisher->assign( 'statusValues', $status ); //Sending the listing of status
|
||||
$oHeadPublisher->assign( 'processValues', $processes ); //Sending the listing of processes
|
||||
$oHeadPublisher->assign( 'categoryValues', $category ); //Sending the listing of categories
|
||||
$oHeadPublisher->assign( 'userValues', $users ); //Sending the listing of users
|
||||
$oHeadPublisher->assign( 'allUsersValues', $allUsers ); //Sending the listing of all users
|
||||
$oHeadPublisher->assign( 'solrEnabled', $solrEnabled ); //Sending the status of solar
|
||||
$oHeadPublisher->assign( 'enableEnterprise', $enableEnterprise ); //sending the page size
|
||||
|
||||
@@ -221,38 +217,6 @@ $oHeadPublisher->assign( 'openReassignCallback', $jsFunction );
|
||||
|
||||
G::RenderPage( 'publish', 'extJs' );
|
||||
|
||||
function getUserArray ($action, $userUid)
|
||||
{
|
||||
global $oAppCache;
|
||||
$status = array ();
|
||||
|
||||
$users[] = array ("",G::LoadTranslation( "ID_ALL_USERS" ));
|
||||
$users[] = array ("CURRENT_USER",G::LoadTranslation( "ID_CURRENT_USER" ));
|
||||
|
||||
//now get users, just for the Search action
|
||||
switch ($action) {
|
||||
case 'search_simple':
|
||||
case 'search':
|
||||
$cUsers = new Criteria( 'workflow' );
|
||||
$cUsers->clearSelectColumns();
|
||||
$cUsers->addSelectColumn( UsersPeer::USR_UID );
|
||||
$cUsers->addSelectColumn( UsersPeer::USR_FIRSTNAME );
|
||||
$cUsers->addSelectColumn( UsersPeer::USR_LASTNAME );
|
||||
$oDataset = UsersPeer::doSelectRS( $cUsers );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$users[] = array ($aRow['USR_UID'],$aRow['USR_LASTNAME'] . ' ' . $aRow['USR_FIRSTNAME']);
|
||||
$oDataset->next();
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return $users;
|
||||
break;
|
||||
}
|
||||
return $users;
|
||||
}
|
||||
|
||||
function getCategoryArray ()
|
||||
{
|
||||
global $oAppCache;
|
||||
@@ -276,45 +240,18 @@ function getCategoryArray ()
|
||||
return $category;
|
||||
}
|
||||
|
||||
function getAllUsersArray ($action)
|
||||
{
|
||||
global $oAppCache;
|
||||
$status = array ();
|
||||
$users[] = array ("CURRENT_USER",G::LoadTranslation( "ID_CURRENT_USER" )
|
||||
);
|
||||
$users[] = array ("",G::LoadTranslation( "ID_ALL_USERS" )
|
||||
);
|
||||
|
||||
if ($action == 'to_reassign') {
|
||||
//now get users, just for the Search action
|
||||
$cUsers = $oAppCache->getToReassignListCriteria(null);
|
||||
$cUsers->addSelectColumn( AppCacheViewPeer::USR_UID );
|
||||
|
||||
if (g::MySQLSintaxis()) {
|
||||
$cUsers->addGroupByColumn( AppCacheViewPeer::USR_UID );
|
||||
}
|
||||
|
||||
$cUsers->addAscendingOrderByColumn( AppCacheViewPeer::APP_CURRENT_USER );
|
||||
$oDataset = AppCacheViewPeer::doSelectRS( $cUsers , Propel::getDbConnection('workflow_ro') );
|
||||
$oDataset->setFetchmode( ResultSet::FETCHMODE_ASSOC );
|
||||
$oDataset->next();
|
||||
while ($aRow = $oDataset->getRow()) {
|
||||
$users[] = array ($aRow['USR_UID'],$aRow['APP_CURRENT_USER']);
|
||||
$oDataset->next();
|
||||
}
|
||||
}
|
||||
return $users;
|
||||
}
|
||||
|
||||
function getStatusArray($action, $userUid)
|
||||
{
|
||||
$status = array();
|
||||
$aStatus = Application::$app_status_values;
|
||||
$status[] = array('', G::LoadTranslation('ID_ALL_STATUS'));
|
||||
$status[] = array('COMPLETED', G::LoadTranslation('ID_CASES_STATUS_COMPLETED'));
|
||||
$status[] = array('DRAFT', G::LoadTranslation('ID_CASES_STATUS_DRAFT'));
|
||||
$status[] = array('TO_DO', G::LoadTranslation('ID_CASES_STATUS_TO_DO'));
|
||||
$status[] = array('CANCELLED', G::LoadTranslation('ID_CASES_STATUS_CANCELLED'));
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,16 +28,6 @@ if (!isset($_SESSION['USER_LOGGED'])) {
|
||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
||||
*/
|
||||
/*require_once 'classes/model/Application.php';
|
||||
require_once 'classes/model/Users.php';
|
||||
require_once 'classes/model/AppThread.php';
|
||||
require_once 'classes/model/AppDelay.php';
|
||||
require_once 'classes/model/Process.php';
|
||||
require_once 'classes/model/Task.php';
|
||||
require_once ("classes/model/AppCacheView.php");
|
||||
require_once ("classes/model/AppDelegation.php");
|
||||
require_once ("classes/model/AdditionalTables.php");
|
||||
require_once ("classes/model/AppDelay.php");*/
|
||||
G::LoadClass( 'case' );
|
||||
|
||||
$actionAjax = isset($_REQUEST['actionAjax']) ? $_REQUEST['actionAjax'] : null;
|
||||
@@ -53,85 +43,51 @@ function filterUserListArray($users = array(), $filter = '')
|
||||
return $filteredUsers;
|
||||
}
|
||||
|
||||
//Load the suggest list of users
|
||||
if ($actionAjax == "userValues") {
|
||||
//global $oAppCache;
|
||||
$oAppCache = new AppCacheView();
|
||||
$action = isset( $_REQUEST['action'] ) ? $_REQUEST['action'] : null;
|
||||
$query = isset( $_REQUEST['query'] ) ? $_REQUEST['query'] : null;
|
||||
|
||||
G::LoadClass("configuration");
|
||||
$conf = new Configurations();
|
||||
$confEnvSetting = $conf->getFormats();
|
||||
$users = array();
|
||||
$users[] = array ("USR_UID" => "", "USR_FULLNAME" => G::LoadTranslation( "ID_ALL_USERS" ));
|
||||
$users[] = array ("USR_UID" => "CURRENT_USER", "USR_FULLNAME" => G::LoadTranslation( "ID_CURRENT_USER" ));
|
||||
$users = filterUserListArray($users, $query);
|
||||
//now get users, just for the Search action
|
||||
$cUsers = new Criteria('workflow');
|
||||
$cUsers->clearSelectColumns();
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
switch ($action) {
|
||||
case 'to_reassign':
|
||||
G::LoadClass("configuration");
|
||||
$conf = new Configurations();
|
||||
$confEnvSetting = $conf->getFormats();
|
||||
$cUsers = new Criteria('workflow');
|
||||
$cUsers->clearSelectColumns();
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_UID);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$cUsers->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||
if (!is_null($query)) {
|
||||
$filters = $cUsers->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $query . '%', Criteria::LIKE)->addOr(
|
||||
$cUsers->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $query . '%', Criteria::LIKE)->addOr(
|
||||
$cUsers->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $query . '%', Criteria::LIKE)));
|
||||
$cUsers->addOr($filters);
|
||||
}
|
||||
$cUsers->setLimit(20);
|
||||
$cUsers->addAscendingOrderByColumn(UsersPeer::TABLE_NAME . "." . $conf->userNameFormatGetFirstFieldByUsersTable());
|
||||
$oDataset = UsersPeer::doSelectRS($cUsers);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
$usrFullName = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $row["USR_USERNAME"], $row["USR_FIRSTNAME"], $row["USR_LASTNAME"]);
|
||||
$users[] = array("USR_UID" => $row["USR_UID"], "USR_FULLNAME" => $usrFullName);
|
||||
}
|
||||
break;
|
||||
case 'search_simple':
|
||||
case 'search':
|
||||
G::LoadClass("configuration");
|
||||
|
||||
$conf = new Configurations();
|
||||
|
||||
$confEnvSetting = $conf->getFormats();
|
||||
|
||||
$cUsers = new Criteria('workflow');
|
||||
$cUsers->clearSelectColumns();
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_UID);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_USERNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_FIRSTNAME);
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_LASTNAME);
|
||||
$cUsers->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||
|
||||
if (!is_null($query)) {
|
||||
$filters = $cUsers->getNewCriterion( UsersPeer::USR_FIRSTNAME, '%'.$query.'%', Criteria::LIKE )->addOr(
|
||||
$cUsers->getNewCriterion( UsersPeer::USR_LASTNAME, '%'.$query.'%', Criteria::LIKE )->addOr(
|
||||
$cUsers->getNewCriterion( UsersPeer::USR_USERNAME, '%'.$query.'%', Criteria::LIKE )));
|
||||
$cUsers->addOr( $filters );
|
||||
}
|
||||
$cUsers->setLimit(20);
|
||||
$cUsers->addAscendingOrderByColumn(UsersPeer::TABLE_NAME . "." . $conf->userNameFormatGetFirstFieldByUsersTable());
|
||||
$oDataset = UsersPeer::doSelectRS($cUsers);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
|
||||
$usrFullName = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $row["USR_USERNAME"], $row["USR_FIRSTNAME"], $row["USR_LASTNAME"]);
|
||||
|
||||
$users[] = array("USR_UID" => $row["USR_UID"], "USR_FULLNAME" => $usrFullName);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return $users;
|
||||
$cUsers->addSelectColumn(UsersPeer::USR_ID);
|
||||
break;
|
||||
}
|
||||
//return $users;
|
||||
$cUsers->add(UsersPeer::USR_STATUS, 'CLOSED', Criteria::NOT_EQUAL);
|
||||
if (!is_null($query)) {
|
||||
$filters = $cUsers->getNewCriterion(UsersPeer::USR_FIRSTNAME, '%' . $query . '%', Criteria::LIKE)->addOr(
|
||||
$cUsers->getNewCriterion(UsersPeer::USR_LASTNAME, '%' . $query . '%', Criteria::LIKE)->addOr(
|
||||
$cUsers->getNewCriterion(UsersPeer::USR_USERNAME, '%' . $query . '%', Criteria::LIKE)));
|
||||
$cUsers->addOr($filters);
|
||||
}
|
||||
$cUsers->setLimit(20);
|
||||
$cUsers->addAscendingOrderByColumn(UsersPeer::TABLE_NAME . "." . $conf->userNameFormatGetFirstFieldByUsersTable());
|
||||
$oDataset = UsersPeer::doSelectRS($cUsers);
|
||||
$oDataset->setFetchmode(ResultSet::FETCHMODE_ASSOC);
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$row = $oDataset->getRow();
|
||||
$usrFullName = $conf->usersNameFormatBySetParameters($confEnvSetting["format"], $row["USR_USERNAME"], $row["USR_FIRSTNAME"], $row["USR_LASTNAME"]);
|
||||
if ($action === 'search') {
|
||||
//Only for the advanced search we used the USR_ID column
|
||||
$users[] = array("USR_UID" => $row["USR_ID"], "USR_FULLNAME" => $usrFullName);
|
||||
} else {
|
||||
$users[] = array("USR_UID" => $row["USR_UID"], "USR_FULLNAME" => $usrFullName);
|
||||
}
|
||||
}
|
||||
return print G::json_encode($users);
|
||||
}
|
||||
|
||||
@@ -152,7 +108,12 @@ if ($actionAjax == "processListExtJs") {
|
||||
$cProcess = new Criteria('workflow');
|
||||
//get the processes for this user in this action
|
||||
$cProcess->clearSelectColumns();
|
||||
$cProcess->addSelectColumn(ProcessPeer::PRO_UID);
|
||||
if ($action == 'search') {
|
||||
$cProcess->addSelectColumn(ProcessPeer::PRO_ID);
|
||||
} else {
|
||||
$cProcess->addSelectColumn(ProcessPeer::PRO_UID);
|
||||
}
|
||||
|
||||
$cProcess->addSelectColumn(ProcessPeer::PRO_TITLE);
|
||||
if ($categoryUid) {
|
||||
$cProcess->add(ProcessPeer::PRO_CATEGORY, $categoryUid);
|
||||
@@ -166,15 +127,15 @@ if ($actionAjax == "processListExtJs") {
|
||||
$cProcess->addAnd($filters);
|
||||
}
|
||||
|
||||
if($action==='to_revise') {
|
||||
if ($action==='to_revise') {
|
||||
$oAppCache = new AppCacheView();
|
||||
$aProcesses = $oAppCache->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
$cProcess->add(ProcessPeer::PRO_UID, $aProcesses, Criteria::IN);
|
||||
}
|
||||
|
||||
if($action==='to_reassign') {
|
||||
if($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
|
||||
} elseif($RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1) {
|
||||
if ($action==='to_reassign') {
|
||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
|
||||
} elseif ($RBAC->userCanAccess('PM_REASSIGNCASE_SUPERVISOR') == 1) {
|
||||
$oAppCache = new AppCacheView();
|
||||
$aProcesses = $oAppCache->getProUidSupervisor($_SESSION['USER_LOGGED']);
|
||||
$cProcess->add(ProcessPeer::PRO_UID, $aProcesses, Criteria::IN);
|
||||
@@ -188,6 +149,9 @@ if ($actionAjax == "processListExtJs") {
|
||||
|
||||
while ($oDataset->next()) {
|
||||
$aRow = $oDataset->getRow();
|
||||
if (!isset($aRow['PRO_UID'])) {
|
||||
$aRow['PRO_UID'] = $aRow['PRO_ID'];
|
||||
}
|
||||
$processes[] = $aRow;
|
||||
}
|
||||
return print G::json_encode($processes);
|
||||
@@ -204,7 +168,7 @@ if ($actionAjax == "verifySession") {
|
||||
$response = new stdclass();
|
||||
GLOBAL $RBAC;
|
||||
//Check if the user is a supervisor to this Process
|
||||
if($RBAC->userCanAccess('PM_REASSIGNCASE') == 1){
|
||||
if ($RBAC->userCanAccess('PM_REASSIGNCASE') == 1) {
|
||||
$response->reassigncase = true;
|
||||
$response->message = '';
|
||||
$response->processeslist = '';
|
||||
@@ -249,6 +213,7 @@ if ($actionAjax == "getUsersToReassign") {
|
||||
|
||||
echo G::json_encode($response);
|
||||
}
|
||||
|
||||
if ($actionAjax == 'reassignCase') {
|
||||
|
||||
$APP_UID = $_REQUEST["APP_UID"];
|
||||
@@ -283,16 +248,15 @@ if ($actionAjax == 'reassignCase') {
|
||||
if($flagReassign){
|
||||
$cases->reassignCase($_SESSION['APPLICATION'], $_SESSION['INDEX'], $_SESSION['USER_LOGGED'], $TO_USR_UID);
|
||||
}
|
||||
|
||||
|
||||
$caseData = $app->load($_SESSION['APPLICATION']);
|
||||
$userData = $user->load($TO_USR_UID);
|
||||
//print_r($caseData);
|
||||
$data['APP_NUMBER'] = $caseData['APP_NUMBER'];
|
||||
$data['USER'] = $userData['USR_LASTNAME'] . ' ' . $userData['USR_FIRSTNAME']; //TODO change with the farmated username from environment conf
|
||||
$result = new stdClass();
|
||||
$result->status = 0;
|
||||
$result->msg = G::LoadTranslation('ID_REASSIGNMENT_SUCCESS', SYS_LANG, $data);
|
||||
|
||||
|
||||
// Save the note reassign reason
|
||||
if (isset($_POST['NOTE_REASON']) && $_POST['NOTE_REASON'] !== '') {
|
||||
require_once ("classes/model/AppNotes.php");
|
||||
|
||||
@@ -16,8 +16,10 @@ $_SESSION['USER_LOGGED'] = $filter->xssFilterHard($_SESSION['USER_LOGGED']);
|
||||
|
||||
//Getting the extJs parameters
|
||||
$callback = isset( $_REQUEST["callback"] ) ? $_REQUEST["callback"] : "stcCallback1001";
|
||||
//This default value was defined in casesList.js
|
||||
$dir = isset( $_REQUEST["dir"] ) ? $_REQUEST["dir"] : "DESC";
|
||||
$sort = isset( $_REQUEST["sort"] ) ? $_REQUEST["sort"] : "";
|
||||
//This default value was defined in casesList.js
|
||||
$sort = isset( $_REQUEST["sort"] ) ? $_REQUEST["sort"] : "APP_NUMBER";
|
||||
$start = isset( $_REQUEST["start"] ) ? $_REQUEST["start"] : "0";
|
||||
$limit = isset( $_REQUEST["limit"] ) ? $_REQUEST["limit"] : "25";
|
||||
$filter = isset( $_REQUEST["filter"] ) ? $_REQUEST["filter"] : "";
|
||||
@@ -31,7 +33,7 @@ $action = isset( $_GET["action"] ) ? $_GET["action"] : (isset( $_REQUEST["action
|
||||
$type = isset( $_GET["type"] ) ? $_GET["type"] : (isset( $_REQUEST["type"] ) ? $_REQUEST["type"] : "extjs");
|
||||
$dateFrom = isset( $_REQUEST["dateFrom"] ) ? substr( $_REQUEST["dateFrom"], 0, 10 ) : "";
|
||||
$dateTo = isset( $_REQUEST["dateTo"] ) ? substr( $_REQUEST["dateTo"], 0, 10 ) : "";
|
||||
$first = isset( $_REQUEST["first"] ) ? true :false;
|
||||
$first = isset( $_REQUEST["first"] ) ? true : false;
|
||||
$openApplicationUid = (isset($_REQUEST['openApplicationUid']) && $_REQUEST['openApplicationUid'] != '')?
|
||||
$_REQUEST['openApplicationUid'] : null;
|
||||
|
||||
@@ -107,37 +109,26 @@ try {
|
||||
$sort,
|
||||
$category
|
||||
);
|
||||
|
||||
$data['data'] = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($data['data']);
|
||||
|
||||
$result = G::json_encode($data);
|
||||
} else {
|
||||
G::LoadClass("applications");
|
||||
|
||||
$apps = new Applications();
|
||||
$data = $apps->getAll(
|
||||
$data = $apps->searchAll(
|
||||
$userUid,
|
||||
$start,
|
||||
$limit,
|
||||
$action,
|
||||
$filter,
|
||||
$search,
|
||||
$process,
|
||||
$filterStatus,
|
||||
$type,
|
||||
$dateFrom,
|
||||
$dateTo,
|
||||
$callback,
|
||||
$dir,
|
||||
(strpos($sort, ".") !== false)? $sort : "APP_CACHE_VIEW." . $sort,
|
||||
$category
|
||||
$sort,
|
||||
$category,
|
||||
$dateFrom,
|
||||
$dateTo
|
||||
);
|
||||
|
||||
$data['data'] = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($data['data']);
|
||||
|
||||
$result = G::json_encode($data);
|
||||
}
|
||||
|
||||
$data['data'] = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($data['data']);
|
||||
$result = G::json_encode($data);
|
||||
echo $result;
|
||||
} catch (Exception $e) {
|
||||
$msg = array("error" => $e->getMessage());
|
||||
|
||||
@@ -13,25 +13,33 @@ $filter = new InputFilter();
|
||||
|
||||
try {
|
||||
$userUid = $_SESSION['USER_LOGGED'];
|
||||
$filters['paged'] = isset( $_REQUEST["paged"] ) ? $filter->sanitizeInputValue($_REQUEST["paged"], 'nosql') : true;
|
||||
$filters['count'] = isset( $_REQUEST['count'] ) ? $filter->sanitizeInputValue($_REQUEST["count"], 'nosql') : true;
|
||||
$filters['category'] = isset( $_REQUEST["category"] ) ? $filter->sanitizeInputValue($_REQUEST["category"], 'nosql') : "";
|
||||
$filters['process'] = isset( $_REQUEST["process"] ) ? $filter->sanitizeInputValue($_REQUEST["process"], 'nosql') : "";
|
||||
$filters['search'] = isset( $_REQUEST["search"] ) ? $filter->sanitizeInputValue($_REQUEST["search"], 'nosql') : "";
|
||||
$filters['filter'] = isset( $_REQUEST["filter"] ) ? $filter->sanitizeInputValue($_REQUEST["filter"], 'nosql') : "";
|
||||
$filters['dateFrom'] = (!empty( $_REQUEST["dateFrom"] )) ? substr( $_REQUEST["dateFrom"], 0, 10 ) : "";
|
||||
$filters['dateTo'] = (!empty( $_REQUEST["dateTo"] )) ? substr( $_REQUEST["dateTo"], 0, 10 ) : "";
|
||||
$filters['paged'] = isset($_REQUEST["paged"]) ? $filter->sanitizeInputValue($_REQUEST["paged"], 'nosql') : true;
|
||||
$filters['count'] = isset($_REQUEST['count']) ? $filter->sanitizeInputValue($_REQUEST["count"], 'nosql') : true;
|
||||
$filters['category'] = isset($_REQUEST["category"]) ? $filter->sanitizeInputValue($_REQUEST["category"], 'nosql') : "";
|
||||
$filters['process'] = isset($_REQUEST["process"]) ? $filter->sanitizeInputValue($_REQUEST["process"], 'nosql') : "";
|
||||
$filters['search'] = isset($_REQUEST["search"]) ? $filter->sanitizeInputValue($_REQUEST["search"], 'nosql') : "";
|
||||
$filters['filter'] = isset($_REQUEST["filter"]) ? $filter->sanitizeInputValue($_REQUEST["filter"], 'nosql') : "";
|
||||
$filters['dateFrom'] = (!empty($_REQUEST["dateFrom"])) ? substr( $_REQUEST["dateFrom"], 0, 10 ) : "";
|
||||
$filters['dateTo'] = (!empty($_REQUEST["dateTo"])) ? substr( $_REQUEST["dateTo"], 0, 10 ) : "";
|
||||
$filters['start'] = isset($_REQUEST["start"]) ? $filter->sanitizeInputValue($_REQUEST["start"], 'nosql') : "0";
|
||||
$filters['limit'] = isset($_REQUEST["limit"]) ? $filter->sanitizeInputValue($_REQUEST["limit"], 'nosql') : "25";
|
||||
$filters['sort'] = (isset($_REQUEST['sort']))? (($_REQUEST['sort'] == 'APP_STATUS_LABEL')? 'APP_STATUS' : $filter->sanitizeInputValue($_REQUEST["sort"], 'nosql')) : '';
|
||||
$filters['dir'] = isset($_REQUEST["dir"]) ? $filter->sanitizeInputValue($_REQUEST["dir"], 'nosql') : "DESC";
|
||||
$filters['action'] = isset($_REQUEST["action"]) ? $filter->sanitizeInputValue($_REQUEST["action"], 'nosql') : "";
|
||||
$filters['user'] = isset($_REQUEST["user"]) ? $filter->sanitizeInputValue($_REQUEST["user"], 'nosql') : "";
|
||||
$listName = isset($_REQUEST["list"]) ? $filter->sanitizeInputValue($_REQUEST["list"], 'nosql') : "inbox";
|
||||
$filters['filterStatus'] = isset($_REQUEST["filterStatus"]) ? $filter->sanitizeInputValue($_REQUEST["filterStatus"], 'nosql') : "";
|
||||
$openApplicationUid = (isset($_REQUEST['openApplicationUid']) && $_REQUEST['openApplicationUid'] != '') ? $_REQUEST['openApplicationUid'] : null;
|
||||
|
||||
$filters['start'] = isset( $_REQUEST["start"] ) ? $filter->sanitizeInputValue($_REQUEST["start"], 'nosql') : "0";
|
||||
$filters['limit'] = isset( $_REQUEST["limit"] ) ? $filter->sanitizeInputValue($_REQUEST["limit"], 'nosql') : "25";
|
||||
$filters['sort'] = (isset($_REQUEST['sort']))? (($_REQUEST['sort'] == 'APP_STATUS_LABEL')? 'APP_STATUS' : $filter->sanitizeInputValue($_REQUEST["sort"], 'nosql')) : '';
|
||||
$filters['dir'] = isset( $_REQUEST["dir"] ) ? $filter->sanitizeInputValue($_REQUEST["dir"], 'nosql') : "DESC";
|
||||
|
||||
$filters['action'] = isset( $_REQUEST["action"] ) ? $filter->sanitizeInputValue($_REQUEST["action"], 'nosql') : "";
|
||||
$listName = isset( $_REQUEST["list"] ) ? $filter->sanitizeInputValue($_REQUEST["list"], 'nosql') : "inbox";
|
||||
$filters['filterStatus'] = isset( $_REQUEST["filterStatus"] ) ? $filter->sanitizeInputValue($_REQUEST["filterStatus"], 'nosql') : "";
|
||||
$openApplicationUid = (isset($_REQUEST['openApplicationUid']) && $_REQUEST['openApplicationUid'] != '')?
|
||||
$_REQUEST['openApplicationUid'] : null;
|
||||
//Define user when is reassign
|
||||
if ($filters['action'] == 'to_reassign') {
|
||||
if ($filters['user'] == '' ) {
|
||||
$userUid = '';
|
||||
}
|
||||
if ($filters['user'] !== '' && $filters['user'] !== 'CURRENT_USER') {
|
||||
$userUid = $filters['user'];
|
||||
}
|
||||
}
|
||||
|
||||
// Select list
|
||||
switch ($listName) {
|
||||
@@ -175,25 +183,12 @@ try {
|
||||
}
|
||||
);
|
||||
|
||||
$filtersData = array();
|
||||
$filtersData['start'] = $filters['start'];
|
||||
$filtersData['limit'] = $filters['limit'];
|
||||
$filtersData['sort'] = G::toLower($filters['sort']);
|
||||
$filtersData['dir'] = G::toLower($filters['dir']);
|
||||
$filtersData['cat_uid'] = $filters['category'];
|
||||
$filtersData['pro_uid'] = $filters['process'];
|
||||
$filtersData['search'] = $filters['search'];
|
||||
$filtersData['date_from'] = $filters['dateFrom'];
|
||||
$filtersData['date_to'] = $filters['dateTo'];
|
||||
$filtersData["action"] = $filters["action"];
|
||||
$filtersData["filterStatus"] = $filters['filterStatus'];
|
||||
|
||||
$response = array();
|
||||
$response['filters'] = $filtersData;
|
||||
$response['totalCount'] = $list->countTotal($userUid, $filtersData);
|
||||
|
||||
$response['filters'] = $filters;
|
||||
$response['totalCount'] = $list->getCountList($userUid, $filters);
|
||||
$response = $filter->xssFilterHard($response);
|
||||
$response['data'] = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($result);
|
||||
|
||||
echo G::json_encode($response);
|
||||
} catch (Exception $e) {
|
||||
$msg = array("error" => $e->getMessage());
|
||||
|
||||
Reference in New Issue
Block a user