aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/My.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/My.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/My.pm20
1 files changed, 19 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/My.pm b/perllib/FixMyStreet/App/Controller/My.pm
index bbef1f8d8..b3d341a68 100644
--- a/perllib/FixMyStreet/App/Controller/My.pm
+++ b/perllib/FixMyStreet/App/Controller/My.pm
@@ -28,17 +28,26 @@ sub my : Path : Args(0) {
my $p_page = $c->req->params->{p} || 1;
my $u_page = $c->req->params->{u} || 1;
+ $c->forward( '/reports/stash_report_filter_status' );
+
my $pins = [];
my $problems = {};
+ my $states = $c->stash->{filter_problem_states};
my $params = {
- state => [ FixMyStreet::DB::Result::Problem->visible_states() ],
+ state => [ keys %$states ],
};
$params = {
%{ $c->cobrand->problems_clause },
%$params
} if $c->cobrand->problems_clause;
+ my $category = $c->req->param('filter_category');
+ if ( $category ) {
+ $params->{category} = $category;
+ $c->stash->{filter_category} = $category;
+ }
+
my $rs = $c->user->problems->search( $params, {
order_by => { -desc => 'confirmed' },
rows => 50
@@ -55,6 +64,7 @@ sub my : Path : Args(0) {
};
my $state = $problem->is_fixed ? 'fixed' : $problem->is_closed ? 'closed' : 'confirmed';
push @{ $problems->{$state} }, $problem;
+ push @{ $problems->{all} }, $problem;
}
$c->stash->{problems_pager} = $rs->pager;
$c->stash->{problems} = $problems;
@@ -71,6 +81,14 @@ sub my : Path : Args(0) {
$c->stash->{updates} = \@updates;
$c->stash->{updates_pager} = $rs->pager;
+ my @categories = $c->user->problems->search( undef, {
+ columns => [ 'category' ],
+ distinct => 1,
+ order_by => [ 'category' ],
+ } )->all;
+ @categories = map { $_->category } @categories;
+ $c->stash->{filter_categories} = \@categories;
+
$c->stash->{page} = 'my';
FixMyStreet::Map::display_map(
$c,