aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-08-17 18:43:04 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-08-17 18:43:04 +0100
commite020fe9e36b96b447d992f0d4a5ff2eaea34fcf3 (patch)
treecb508c0cbe59776aacfe3ccf5dcda8f737ec6370 /perllib/FixMyStreet/App/Controller
parent9e7d7e358d098ff91f8585fe97b53a4b58bad46e (diff)
parent1c15d23b6950618d3518197352a3330390bd9c3e (diff)
Merge branch 'issues/forcouncils/187-all-reports-filter-by-substates'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm13
1 files changed, 13 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index ec18e33d0..2b5777773 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -542,6 +542,19 @@ sub stash_report_filter_status : Private {
$filter_status{unshortlisted} = 1;
}
+ if ($c->user and ($c->user->is_superuser or (
+ $c->stash->{body} and $c->user->belongs_to_body($c->stash->{body}->id)
+ ))) {
+ foreach my $state (FixMyStreet::DB::Result::Problem->visible_states()) {
+ if ($status{$state}) {
+ %filter_problem_states = (%filter_problem_states, ($state => 1));
+ my $pretty_state = $state;
+ $pretty_state =~ tr/ /_/;
+ $filter_status{$pretty_state} = 1;
+ }
+ }
+ }
+
if (keys %filter_problem_states == 0) {
my $s = FixMyStreet::DB::Result::Problem->open_states();
%filter_problem_states = (%filter_problem_states, %$s);