diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 10 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 7 |
2 files changed, 12 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 85a6e7c4d..477d2dc0f 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -383,13 +383,13 @@ sub load_and_group_problems : Private { $c->log->debug( $problem->cobrand . ', cobrand is ' . $c->cobrand->moniker ); if ( !$c->stash->{body}->id ) { # An external_body entry - add_row( $problem, 0, \%problems, \@pins ); + add_row( $c, $problem, 0, \%problems, \@pins ); next; } if ( !$problem->bodies_str ) { # Problem was not sent to any body, add to all possible areas XXX while ($problem->areas =~ /,(\d+)(?=,)/g) { - add_row( $problem, $1, \%problems, \@pins ); + add_row( $c, $problem, $1, \%problems, \@pins ); } } else { # Add to bodies it was sent to @@ -397,7 +397,7 @@ sub load_and_group_problems : Private { my $bodies = $problem->bodies_str_ids; foreach ( @$bodies ) { next if $_ != $c->stash->{body}->id; - add_row( $problem, $_, \%problems, \@pins ); + add_row( $c, $problem, $_, \%problems, \@pins ); } } } @@ -428,12 +428,12 @@ sub redirect_body : Private { } sub add_row { - my ( $problem, $body, $problems, $pins ) = @_; + my ( $c, $problem, $body, $problems, $pins ) = @_; push @{$problems->{$body}}, $problem; push @$pins, { latitude => $problem->latitude, longitude => $problem->longitude, - colour => 'yellow', # FixMyStreet::DB::Result::Problem->fixed_states()->{$problem->state} ? 'green' : 'red', + colour => $c->cobrand->pin_colour( $problem, 'reports' ), id => $problem->id, title => $problem->title, }; diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 47f6d7d06..e39966181 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -7,6 +7,13 @@ use POSIX qw(strcoll); use strict; use warnings; +sub pin_colour { + my ( $self, $p, $context ) = @_; + return 'green' if $p->is_fixed || $p->is_closed; + return 'red' if $p->state eq 'unconfirmed' || $p->state eq 'confirmed'; + return 'yellow'; +} + sub enter_postcode_text { my ( $self ) = @_; return _('Enter a Zürich street name'); |