aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/Zurich.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-08-29 12:27:58 +0100
committerStruan Donald <struan@exo.org.uk>2018-09-12 14:21:49 +0100
commit57c79ad84cbc72d1683d6082a4605b52fccf314a (patch)
tree256c5931f852212374b041485558fb302c7f7b14 /perllib/FixMyStreet/Cobrand/Zurich.pm
parent07afa1a459646d91cd3ceb0c60dd26f252edf479 (diff)
[Zurich] use report_page_data cobrand hook
remove hard coded report page behaviour
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Zurich.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm25
1 files changed, 25 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 817fc48a1..fd0201f02 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -316,6 +316,31 @@ sub get_or_check_overdue {
return $self->overdue($problem);
}
+sub report_page_data {
+ my $self = shift;
+ my $c = $self->{c};
+
+ $c->stash->{page} = 'reports';
+ $c->forward( 'stash_report_filter_status' );
+ $c->forward( 'load_and_group_problems' );
+ $c->stash->{body} = { id => 0 }; # So template can fetch the list
+
+ if ($c->get_param('ajax')) {
+ $c->detach('ajax', [ 'reports/_problem-list.html' ]);
+ }
+
+ my $pins = $c->stash->{pins};
+ FixMyStreet::Map::display_map(
+ $c,
+ latitude => @$pins ? $pins->[0]{latitude} : 0,
+ longitude => @$pins ? $pins->[0]{longitude} : 0,
+ area => 274456,
+ pins => $pins,
+ any_zoom => 1,
+ );
+ return 1;
+}
+
=head1 C<set_problem_state>
If the state has changed, sets the state and calls C::Admin's C<log_edit> action.