aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/My.pm
diff options
context:
space:
mode:
authorZarino Zappia <mail@zarino.co.uk>2016-09-30 16:34:00 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-10-13 19:22:11 +0100
commita5ef113e2cc3105da41cf5449b505db6fa336c59 (patch)
treec60d906c0b5dd6fc974a35f8e921ae728dab080c /perllib/FixMyStreet/App/Controller/My.pm
parent3872c39f5426165c3abfe397d15dd2a63f731e26 (diff)
Allow multiple selections in report list filter.
This lets people filter by multiple categories or states. It uses our jQuery multi-select plugin to turn the <select multiple>s into little overlay lists of checkboxes. HTML5 history is also supported.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/My.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/My.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm
index b7fabcf4c..573c41446 100644
--- a/perllib/FixMyStreet/App/Controller/My.pm
+++ b/perllib/FixMyStreet/App/Controller/My.pm
@@ -63,10 +63,10 @@ sub get_problems : Private {
state => [ keys %$states ],
};
- my $category = $c->get_param('filter_category');
- if ( $category ) {
- $params->{category} = $category;
- $c->stash->{filter_category} = $category;
+ my $categories = [ $c->get_param_list('filter_category', 1) ];
+ if ( @$categories ) {
+ $params->{category} = $categories;
+ $c->stash->{filter_category} = $categories;
}
my $rs = $c->stash->{problems_rs}->search( $params, {