Skip to content
Snippets Groups Projects
Verified Commit b694f436 authored by Damien's avatar Damien
Browse files

FEAT #13271 TIME 0:30 Search order by

parent 47c901c5
No related branches found
No related tags found
No related merge requests found
......@@ -114,9 +114,9 @@ class SearchController
if (!empty($queryParams['offset']) && is_numeric($queryParams['offset'])) {
$offset = (int)$queryParams['offset'];
}
$order = !in_array($queryParams['order'], ['asc', 'desc']) ? '' : $queryParams['order'];
$orderBy = str_replace(['chrono', 'typeLabel', 'creationDate', 'category'], ['order_alphanum(alt_identifier)', 'type_label', 'creation_date', 'category_id'], $queryParams['orderBy']);
$orderBy = !in_array($orderBy, ['order_alphanum(alt_identifier)', 'status', 'subject', 'type_label', 'creation_date', 'category_id']) ? ['creation_date'] : ["{$orderBy} {$order}"];
$order = !in_array($queryParams['orderDir'], ['ASC', 'DESC']) ? '' : $queryParams['orderDir'];
$orderBy = str_replace(['chrono', 'typeLabel', 'creationDate', 'category', 'destUser', 'processLimitDate', 'entityLabel'], ['order_alphanum(alt_identifier)', 'type_label', 'creation_date', 'category_id', 'dest_user', 'process_limit_date', 'entity_label'], $queryParams['order']);
$orderBy = !in_array($orderBy, ['order_alphanum(alt_identifier)', 'status', 'subject', 'type_label', 'creation_date', 'category_id', 'dest_user', 'process_limit_date', 'entity_label', 'priority']) ? ['creation_date'] : ["{$orderBy} {$order}"];
$allResources = ResModel::getOnView([
'select' => ['res_id as "resId"'],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment