Merged in bugfix/HOR-2680 (pull request #5433)

HOR-2680

Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
Paula Quispe
2017-02-21 19:19:50 +00:00
committed by Julio Cesar Laura Avendaño
3 changed files with 17 additions and 15 deletions

View File

@@ -127,8 +127,15 @@ class Applications
//Filters
if (!empty($sort)) {
if ($sort === 'APP_NUMBER' || $sort === 'APPLICATION.APP_NUMBER') {
$sort = 'APP_DELEGATION.APP_NUMBER';
switch ($sort) {
case 'APP_NUMBER':
//The order by APP_DELEGATION.APP_NUMBER is must be fast than APPLICATION.APP_NUMBER
$sort = 'APP_DELEGATION.APP_NUMBER';
break;
case 'APP_CURRENT_USER':
//The column APP_CURRENT_USER is concat those fields
$sort = 'USR_LASTNAME, USR_FIRSTNAME';
break;
}
$sqlWhere .= " ORDER BY " . $sort;
}

View File

@@ -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,10 +109,6 @@ try {
$sort,
$category
);
$data['data'] = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($data['data']);
$result = G::json_encode($data);
} else {
G::LoadClass("applications");
@@ -123,17 +121,14 @@ try {
$process,
$filterStatus,
$dir,
(strpos($sort, ".") !== false)? $sort : "APPLICATION." . $sort,
$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());

View File

@@ -843,7 +843,7 @@ Ext.onReady ( function() {
reader: readerCasesList,
writer: writerCasesList, // <-- plug a DataWriter into the store just as you would a Reader
autoSave: true, // <-- false would delay executing create, update, destroy requests until specifically told to do so with some [save] buton.
sortInfo:{field: 'APPLICATION.APP_NUMBER', direction: "DESC"},
sortInfo:{field: 'APP_NUMBER', direction: "DESC"},
listeners: {
beforeload: function (store, options)
{