aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-06-24 18:36:46 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-09-30 11:12:19 +0100
commit0344a2d41021f72f121e31590cbc76b9a85ecb75 (patch)
treedc9873447d2b1a386eb1e8284e531d982709fd44
parent66f879bbe6e8c58697dfd99ff8e24b1a0cbcf0fd (diff)
[Zurich] Sort categories in admin alphabetically.
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm6
1 files changed, 4 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 533d1fd17..27ea26605 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -525,11 +525,13 @@ sub category_options {
my $self = shift;
my $c = $self->{c};
my @categories = $c->model('DB::Contact')->not_deleted->all;
- $c->stash->{category_options} = [ map { {
+ @categories = map { {
category => $_->category,
category_display => $_->get_extra_metadata('admin_label') || $_->category,
abbreviation => $_->get_extra_metadata('abbreviation'),
- } } @categories ];
+ } } @categories;
+ @categories = sort { $a->{category_display} cmp $b->{category_display} } @categories;
+ $c->stash->{category_options} = \@categories;
}
sub admin_report_edit {