Commit 18134539 authored by Guillaume Heurtier's avatar Guillaume Heurtier

FIX #11750 TIME 0:30 added filter on doctypes in getResourcesList

parent c5525720
......@@ -271,14 +271,20 @@ class ResourceListController
$queryData[] = $entitiesChildren;
}
}
if (!empty($args['data']['doctypes'])) {
$table[] = 'doctypes';
$leftJoin[] = 'doctypes.description=res_view_letterbox.type_label';
$where[] = 'doctypes.type_id in (?)';
$queryData[] = explode(',', $args['data']['doctypes']);
}
if (!empty($args['data']['order']) && strpos($args['data']['order'], 'alt_identifier') !== false) {
$order = 'order_alphanum(alt_identifier) ' . explode(' ', $args['data']['order'])[1];
}
if (!empty($args['data']['order']) && strpos($args['data']['order'], 'priority') !== false) {
$order = 'priorities.order ' . explode(' ', $args['data']['order'])[1];
$table = ['priorities'];
$leftJoin = ['res_view_letterbox.priority = priorities.id'];
$table[] = 'priorities';
$leftJoin[] = 'res_view_letterbox.priority = priorities.id';
}
return ['table' => $table, 'leftJoin' => $leftJoin, 'where' => $where, 'queryData' => $queryData, 'order' => $order];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment