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;
}