diff options
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/App.pm | 7 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Zurich.pm | 14 | ||||
-rw-r--r-- | perllib/FixMyStreet/Map/Zurich.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/SendReport/Zurich.pm | 15 |
4 files changed, 28 insertions, 10 deletions
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm index 4469ad1c9..ee5b11876 100644 --- a/perllib/FixMyStreet/App.pm +++ b/perllib/FixMyStreet/App.pm @@ -86,6 +86,13 @@ __PACKAGE__->config( # Start the application __PACKAGE__->setup(); +# Due to some current issues with proxyings, need to manually +# tell the code we're secure if we are. +after 'prepare_headers' => sub { + my $self = shift; + $self->req->secure( 1 ) if $self->config->{BASE_URL} eq 'https://www.zueriwieneu.ch'; +}; + # set up DB handle for old code FixMyStreet->configure_mysociety_dbhandle; diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm index 7ac776df2..806fc8391 100644 --- a/perllib/FixMyStreet/Cobrand/Zurich.pm +++ b/perllib/FixMyStreet/Cobrand/Zurich.pm @@ -63,6 +63,7 @@ sub problem_as_hashref { delete $hashref->{ $var }; } $hashref->{detail} = _('This report is awaiting moderation.'); + $hashref->{title} = _('This report is awaiting moderation.'); $hashref->{state} = 'submitted'; $hashref->{state_t} = _('Submitted'); } else { @@ -92,7 +93,7 @@ sub updates_as_hashref { $hashref->{update_pp} = $self->prettify_dt( $problem->lastupdate ); if ( $problem->state eq 'fixed - council' ) { - $hashref->{details} = FixMyStreet::App::View::Web->add_links( $ctx, $problem->extra->{public_response} ); + $hashref->{details} = FixMyStreet::App::View::Web->add_links( $ctx, $problem->extra ? $problem->extra->{public_response} : '' ); } elsif ( $problem->state eq 'closed' ) { $hashref->{details} = sprintf( _('Assigned to %s'), $problem->body($ctx)->name ); } @@ -220,16 +221,13 @@ sub admin_type { my $body = $c->user->from_body; $c->stash->{body} = $body; - my $parent = $body->parent; - my $children = $body->bodies->count; - my $type; + my $parent = $body->parent; if (!$parent) { $type = 'super'; - } elsif ($parent && $children) { - $type = 'dm'; - } elsif ($parent) { - $type = 'sdm'; + } else { + my $grandparent = $parent->parent; + $type = $grandparent ? 'sdm' : 'dm'; } $c->stash->{admin_type} = $type; diff --git a/perllib/FixMyStreet/Map/Zurich.pm b/perllib/FixMyStreet/Map/Zurich.pm index 73ebc5608..e09f8c90f 100644 --- a/perllib/FixMyStreet/Map/Zurich.pm +++ b/perllib/FixMyStreet/Map/Zurich.pm @@ -31,7 +31,7 @@ sub map_tiles { } sub base_tile_url { - return 'http://www.wmts.stadt-zuerich.ch/Hybrid/MapServer/WMTS/tile/1.0.0/Hybrid/default/nativeTileMatrixSet'; + return '/maps/Hybrid/1.0.0/Hybrid/default/nativeTileMatrixSet'; } sub copyright { diff --git a/perllib/FixMyStreet/SendReport/Zurich.pm b/perllib/FixMyStreet/SendReport/Zurich.pm index 4930ff61e..d46561e9e 100644 --- a/perllib/FixMyStreet/SendReport/Zurich.pm +++ b/perllib/FixMyStreet/SendReport/Zurich.pm @@ -51,9 +51,22 @@ sub get_template { return $template; } -# Zurich emails come from the site itself +# Zurich emails come from the site itself, unless it's to an external body, +# in which case it's from the category/body sub send_from { my ( $self, $row ) = @_; + + if ( $row->external_body ) { + my $body = @{ $self->bodies }[0]; + my $body_email = $body->endpoint; + my $contact = FixMyStreet::App->model("DB::Contact")->find( { + body_id => $body->id, + category => $row->category + } ); + $body_email = $contact->email if $contact && $contact->email; + return [ $body_email, FixMyStreet->config('CONTACT_NAME') ]; + } + return [ FixMyStreet->config('CONTACT_EMAIL'), FixMyStreet->config('CONTACT_NAME') ]; } |