Skip to content
Snippets Groups Projects
Unverified Commit 4178b3f9 authored by Peter Rotich's avatar Peter Rotich Committed by GitHub
Browse files

Merge pull request #4582 from protich/issue/status-column

Status Column: Fix display and sorting
parents 7fc0c971 43c5562b
No related branches found
No related tags found
No related merge requests found
......@@ -2377,7 +2377,7 @@ extends VerySimpleModel {
$reverse = $reverse ? '-' : '';
$query = $query->order_by("{$reverse}{$alias}");
} else {
} elseif($keys[0]) {
list($path, $field) = $keys[0];
$query = $field->applyOrderBy($query, $reverse, $path);
}
......
......@@ -1565,6 +1565,11 @@ class TicketStatusChoiceField extends SelectionField {
return parent::getSearchQ($method, $value, $name);
}
}
function applyOrderBy($query, $reverse=false, $name=false) {
$reverse = $reverse ? '-' : '';
return $query->order_by("{$reverse}status__name");
}
}
class TicketThreadCountField extends NumericField {
......
......@@ -69,8 +69,8 @@
conditions: "[]"
- id: 6
name: "Status Name"
primary: "status__name"
name: "Status"
primary: "status__id"
truncate: "wrap"
annotations: "[]"
conditions: "[]"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment