aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm10
-rwxr-xr-xperllib/FixMyStreet/App/Controller/FakeMapit.pm4
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm5
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm12
-rw-r--r--perllib/FixMyStreet/Map/GoogleOL.pm22
5 files changed, 41 insertions, 12 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 424f68ba3..6264d1a73 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -961,6 +961,11 @@ sub user_add : Path('user_edit') : Args(0) {
$c->forward('check_token');
+ if ( $c->cobrand->moniker eq 'zurich' and $c->req->param('email') eq '' ) {
+ $c->stash->{field_errors}->{email} = _('The email field is required');
+ return 1;
+ }
+
return unless $c->req->param('name') && $c->req->param('email');
my $user = $c->model('DB::User')->find_or_create( {
@@ -1008,6 +1013,11 @@ sub user_edit : Path('user_edit') : Args(1) {
$user->email( $c->req->param('email') );
$user->from_body( $c->req->param('body') || undef );
$user->flagged( $c->req->param('flagged') || 0 );
+
+ if ( $c->cobrand->moniker eq 'zurich' and $user->email eq '' ) {
+ $c->stash->{field_errors}->{email} = _('The email field is required');
+ return 1;
+ }
$user->update;
if ($edited) {
diff --git a/perllib/FixMyStreet/App/Controller/FakeMapit.pm b/perllib/FixMyStreet/App/Controller/FakeMapit.pm
index bc46df712..253c75ba4 100755
--- a/perllib/FixMyStreet/App/Controller/FakeMapit.pm
+++ b/perllib/FixMyStreet/App/Controller/FakeMapit.pm
@@ -12,13 +12,13 @@ FixMyStreet::App::Controller::FakeMapit - Catalyst Controller
A controller to fake mapit when we don't have it. If you set MAPIT_URL to
.../fakemapit/ it should all just work, with a mapit that assumes the whole
-world is one area, with ID 161 and name "Default Area".
+world is one area, with ID 161 and name "Everywhere".
=head1 METHODS
=cut
-my $area = { "name" => "Default Area", "type" => "ZZZ", "id" => 161 };
+my $area = { "name" => "Everywhere", "type" => "ZZZ", "id" => 161 };
sub output : Private {
my ( $self, $c, $data ) = @_;
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
index 5531ed048..2c18d4e22 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -84,10 +84,7 @@ sub all_reports_single_body {
sub reports_body_check {
my ( $self, $c, $code ) = @_;
- # First, the normal UK checks
- $self->SUPER::find_closest( $c, $code );
-
- # Now we want to make sure we're only on our page.
+ # We want to make sure we're only on our page.
unless ( $self->council_name =~ /^\Q$code\E/ ) {
$c->res->redirect( 'http://www.fixmystreet.com' . $c->req->uri->path_query, 301 );
$c->detach();
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 4fa442608..a61649d0d 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -390,11 +390,11 @@ sub check_for_errors {
if ( $self->bodies_str && $self->detail ) {
if ( $self->bodies_str eq '2482' && length($self->detail) > 2000 ) {
- $errors{detail} = _('Reports are limited to 2000 characters in length. Please shorten your report');
+ $errors{detail} = sprintf( _('Reports are limited to %s characters in length. Please shorten your report'), 2000 );
}
if ( $self->bodies_str eq '2237' && length($self->detail) > 1700 ) {
- $errors{detail} = _('Reports are limited to 1700 characters in length. Please shorten your report');
+ $errors{detail} = sprintf( _('Reports are limited to %s characters in length. Please shorten your report'), 1700 );
}
}
@@ -544,11 +544,11 @@ sub meta_line {
and $problem->category && $problem->category ne _('Other') )
{
$meta =
- sprintf( _('Reported by %s in the %s category anonymously at %s'),
+ sprintf( _('Reported via %s in the %s category anonymously at %s'),
$problem->service, $problem->category, $date_time );
}
elsif ( $problem->service ) {
- $meta = sprintf( _('Reported by %s anonymously at %s'),
+ $meta = sprintf( _('Reported via %s anonymously at %s'),
$problem->service, $date_time );
}
elsif ( $problem->category and $problem->category ne _('Other') ) {
@@ -564,13 +564,13 @@ sub meta_line {
and $problem->category && $problem->category ne _('Other') )
{
$meta = sprintf(
- _('Reported by %s in the %s category by %s at %s'),
+ _('Reported via %s in the %s category by %s at %s'),
$problem->service, $problem->category,
$problem->name, $date_time
);
}
elsif ( $problem->service ) {
- $meta = sprintf( _('Reported by %s by %s at %s'),
+ $meta = sprintf( _('Reported via %s by %s at %s'),
$problem->service, $problem->name, $date_time );
}
elsif ( $problem->category and $problem->category ne _('Other') ) {
diff --git a/perllib/FixMyStreet/Map/GoogleOL.pm b/perllib/FixMyStreet/Map/GoogleOL.pm
new file mode 100644
index 000000000..64baf8d36
--- /dev/null
+++ b/perllib/FixMyStreet/Map/GoogleOL.pm
@@ -0,0 +1,22 @@
+#!/usr/bin/perl
+#
+# FixMyStreet:Map::GoogleOL
+# Google maps on FixMyStreet, using OpenLayers.
+#
+# Copyright (c) 2013 UK Citizens Online Democracy. All rights reserved.
+# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
+
+package FixMyStreet::Map::GoogleOL;
+use parent 'FixMyStreet::Map::OSM';
+
+use strict;
+
+sub map_type {
+ return '""';
+}
+
+sub map_template {
+ return 'google-ol';
+}
+
+1;