Merged in bugfix/HOR-2680 (pull request #5433)
HOR-2680 Approved-by: Julio Cesar Laura Avendaño
This commit is contained in:
@@ -127,8 +127,15 @@ class Applications
|
|||||||
|
|
||||||
//Filters
|
//Filters
|
||||||
if (!empty($sort)) {
|
if (!empty($sort)) {
|
||||||
if ($sort === 'APP_NUMBER' || $sort === 'APPLICATION.APP_NUMBER') {
|
switch ($sort) {
|
||||||
$sort = 'APP_DELEGATION.APP_NUMBER';
|
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;
|
$sqlWhere .= " ORDER BY " . $sort;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,8 +16,10 @@ $_SESSION['USER_LOGGED'] = $filter->xssFilterHard($_SESSION['USER_LOGGED']);
|
|||||||
|
|
||||||
//Getting the extJs parameters
|
//Getting the extJs parameters
|
||||||
$callback = isset( $_REQUEST["callback"] ) ? $_REQUEST["callback"] : "stcCallback1001";
|
$callback = isset( $_REQUEST["callback"] ) ? $_REQUEST["callback"] : "stcCallback1001";
|
||||||
|
//This default value was defined in casesList.js
|
||||||
$dir = isset( $_REQUEST["dir"] ) ? $_REQUEST["dir"] : "DESC";
|
$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";
|
$start = isset( $_REQUEST["start"] ) ? $_REQUEST["start"] : "0";
|
||||||
$limit = isset( $_REQUEST["limit"] ) ? $_REQUEST["limit"] : "25";
|
$limit = isset( $_REQUEST["limit"] ) ? $_REQUEST["limit"] : "25";
|
||||||
$filter = isset( $_REQUEST["filter"] ) ? $_REQUEST["filter"] : "";
|
$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");
|
$type = isset( $_GET["type"] ) ? $_GET["type"] : (isset( $_REQUEST["type"] ) ? $_REQUEST["type"] : "extjs");
|
||||||
$dateFrom = isset( $_REQUEST["dateFrom"] ) ? substr( $_REQUEST["dateFrom"], 0, 10 ) : "";
|
$dateFrom = isset( $_REQUEST["dateFrom"] ) ? substr( $_REQUEST["dateFrom"], 0, 10 ) : "";
|
||||||
$dateTo = isset( $_REQUEST["dateTo"] ) ? substr( $_REQUEST["dateTo"], 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'] != '')?
|
$openApplicationUid = (isset($_REQUEST['openApplicationUid']) && $_REQUEST['openApplicationUid'] != '')?
|
||||||
$_REQUEST['openApplicationUid'] : null;
|
$_REQUEST['openApplicationUid'] : null;
|
||||||
|
|
||||||
@@ -107,10 +109,6 @@ try {
|
|||||||
$sort,
|
$sort,
|
||||||
$category
|
$category
|
||||||
);
|
);
|
||||||
|
|
||||||
$data['data'] = \ProcessMaker\Util\DateTime::convertUtcToTimeZone($data['data']);
|
|
||||||
|
|
||||||
$result = G::json_encode($data);
|
|
||||||
} else {
|
} else {
|
||||||
G::LoadClass("applications");
|
G::LoadClass("applications");
|
||||||
|
|
||||||
@@ -123,17 +121,14 @@ try {
|
|||||||
$process,
|
$process,
|
||||||
$filterStatus,
|
$filterStatus,
|
||||||
$dir,
|
$dir,
|
||||||
(strpos($sort, ".") !== false)? $sort : "APPLICATION." . $sort,
|
$sort,
|
||||||
$category,
|
$category,
|
||||||
$dateFrom,
|
$dateFrom,
|
||||||
$dateTo
|
$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;
|
echo $result;
|
||||||
} catch (Exception $e) {
|
} catch (Exception $e) {
|
||||||
$msg = array("error" => $e->getMessage());
|
$msg = array("error" => $e->getMessage());
|
||||||
|
|||||||
@@ -843,7 +843,7 @@ Ext.onReady ( function() {
|
|||||||
reader: readerCasesList,
|
reader: readerCasesList,
|
||||||
writer: writerCasesList, // <-- plug a DataWriter into the store just as you would a Reader
|
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.
|
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: {
|
listeners: {
|
||||||
beforeload: function (store, options)
|
beforeload: function (store, options)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user