aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rwxr-xr-xperllib/CronFns.pm9
-rw-r--r--perllib/CrossSell.pm2
-rw-r--r--perllib/FixMyStreet/App.pm8
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm3
-rw-r--r--perllib/FixMyStreet/App/Controller/Reports.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm8
-rw-r--r--perllib/FixMyStreet/Cobrand/FixMindelo.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/FixaMinGata.pm5
-rw-r--r--perllib/FixMyStreet/Cobrand/MakeMyIsland.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/SeeSomething.pm2
-rw-r--r--perllib/FixMyStreet/Cobrand/ZeroTB.pm2
-rw-r--r--perllib/FixMyStreet/DB/Result/Token.pm5
-rw-r--r--perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm2
-rw-r--r--perllib/FixMyStreet/Geocode.pm2
-rw-r--r--perllib/FixMyStreet/Geocode/Bing.pm2
-rw-r--r--perllib/FixMyStreet/Geocode/FixaMinGata.pm2
-rw-r--r--perllib/FixMyStreet/Geocode/Google.pm4
-rw-r--r--perllib/FixMyStreet/Geocode/OSM.pm2
-rw-r--r--perllib/FixMyStreet/Geocode/Zurich.pm2
-rw-r--r--perllib/FixMyStreet/Map.pm2
-rw-r--r--perllib/FixMyStreet/Map/Bing.pm2
-rw-r--r--perllib/FixMyStreet/Map/Bromley.pm2
-rw-r--r--perllib/FixMyStreet/Map/FMS.pm2
-rw-r--r--perllib/FixMyStreet/Map/Google.pm2
-rw-r--r--perllib/FixMyStreet/Map/GoogleOL.pm2
-rw-r--r--perllib/FixMyStreet/Map/OSM.pm2
-rw-r--r--perllib/FixMyStreet/Map/OSM/CycleMap.pm2
-rw-r--r--perllib/FixMyStreet/Map/OSM/MapQuest.pm2
-rw-r--r--perllib/FixMyStreet/Map/OSM/StreetView.pm2
-rw-r--r--perllib/FixMyStreet/Map/Zurich.pm2
-rw-r--r--perllib/FixMyStreet/SendReport/London.pm1
-rw-r--r--perllib/FixMyStreet/TestAppProve.pm2
-rw-r--r--perllib/Geo/Coordinates/CH1903.pm2
-rw-r--r--perllib/PoChange.pm1
-rw-r--r--perllib/Utils.pm3
35 files changed, 10 insertions, 87 deletions
diff --git a/perllib/CronFns.pm b/perllib/CronFns.pm
index ac7f85596..545526c8e 100755
--- a/perllib/CronFns.pm
+++ b/perllib/CronFns.pm
@@ -1,23 +1,14 @@
-#!/usr/bin/perl -w
-
# CronFns.pm:
# Shared functions for cron-run scripts
#
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
-#
-# $Id: CronFns.pm,v 1.1 2009-07-10 15:17:29 matthew Exp $
package CronFns;
use strict;
require 5.8.0;
-# Horrible boilerplate to set up appropriate library paths.
-use FindBin;
-use lib "$FindBin::Bin/../perllib";
-use lib "$FindBin::Bin/../commonlib/perllib";
-
use mySociety::Locale;
sub options {
diff --git a/perllib/CrossSell.pm b/perllib/CrossSell.pm
index 0c621e9d0..9567c2b38 100644
--- a/perllib/CrossSell.pm
+++ b/perllib/CrossSell.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl -w
-#
# CrossSell.pm:
# Adverts from FixMyStreet to another site.
#
diff --git a/perllib/FixMyStreet/App.pm b/perllib/FixMyStreet/App.pm
index fd70ffda8..769a6bb8f 100644
--- a/perllib/FixMyStreet/App.pm
+++ b/perllib/FixMyStreet/App.pm
@@ -12,6 +12,7 @@ use Memcached;
use mySociety::Email;
use mySociety::Random qw(random_bytes);
use FixMyStreet::Map;
+use Utils;
use Path::Class;
use URI;
@@ -388,10 +389,9 @@ sub send_email_cron {
$sig = Encode::decode('utf8', $sig);
$params->{_parameters_}->{signature} = $sig;
- $tt->process( 'site_name.txt', $params, \$site_name );
- $site_name = Encode::decode('utf8', $site_name);
- my $site_title = $cobrand ? $cobrand->site_title : '';
- $params->{_parameters_}->{site_name} = $site_name || $site_title;
+ $tt->process( 'site-name.txt', $params, \$site_name );
+ $site_name = Utils::trim_text(Encode::decode('utf8', $site_name));
+ $params->{_parameters_}->{site_name} = $site_name;
$params->{_line_indent} = '';
my $email = mySociety::Locale::in_gb_locale { mySociety::Email::construct_email($params) };
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index c20a6754a..88a49f6c9 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -112,9 +112,10 @@ sub load_problem_or_display_error : Private {
);
} elsif ( $problem->non_public ) {
if ( !$c->user || $c->user->id != $problem->user->id ) {
+ my $site_name = Utils::trim_text($c->render_fragment('site-name.html'));
$c->detach(
'/page_error_403_access_denied',
- [ sprintf(_('That report cannot be viewed on %s.'), $c->cobrand->site_title) ] #
+ [ sprintf(_('That report cannot be viewed on %s.'), $site_name) ] #
);
}
}
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm
index 10ef30c90..352c47da8 100644
--- a/perllib/FixMyStreet/App/Controller/Reports.pm
+++ b/perllib/FixMyStreet/App/Controller/Reports.pm
@@ -74,7 +74,7 @@ sub index : Path : Args(0) {
if ($@) {
$c->stash->{message} = _("There was a problem showing the All Reports page. Please try again later.");
if ($c->config->{STAGING_SITE}) {
- $c->stash->{message} .= '</p><p>Perhaps the bin/update-all-reports script needs running. Use: bin/cron-wrapper bin/update-all-reports</p><p>'
+ $c->stash->{message} .= '</p><p>Perhaps the bin/update-all-reports script needs running. Use: bin/update-all-reports</p><p>'
. sprintf(_('The error was: %s'), $@);
}
$c->stash->{template} = 'errors/generic.html';
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index ec7a8a81d..7f1fba67a 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -146,14 +146,6 @@ Can be specified in template.
sub enter_postcode_text { }
-=head2 site_title
-
-The name of the site
-
-=cut
-
-sub site_title { return 'FixMyStreet'; }
-
=head2 set_lang_and_domain
my $set_lang = $cobrand->set_lang_and_domain( $lang, $unicode, $dir )
diff --git a/perllib/FixMyStreet/Cobrand/FixMindelo.pm b/perllib/FixMyStreet/Cobrand/FixMindelo.pm
index fd3a55c6c..59debf157 100644
--- a/perllib/FixMyStreet/Cobrand/FixMindelo.pm
+++ b/perllib/FixMyStreet/Cobrand/FixMindelo.pm
@@ -4,8 +4,6 @@ use base 'FixMyStreet::Cobrand::Default';
use strict;
use warnings;
-sub site_title { return 'FixMindelo'; }
-
sub country {
return 'CV';
}
diff --git a/perllib/FixMyStreet/Cobrand/FixaMinGata.pm b/perllib/FixMyStreet/Cobrand/FixaMinGata.pm
index 98c157aef..60f98dd47 100644
--- a/perllib/FixMyStreet/Cobrand/FixaMinGata.pm
+++ b/perllib/FixMyStreet/Cobrand/FixaMinGata.pm
@@ -9,11 +9,6 @@ use mySociety::MaPit;
use FixMyStreet::Geocode::FixaMinGata;
use DateTime;
-sub site_title {
- my ($self) = @_;
- return 'FixaMinGata';
-}
-
sub country {
return 'SE';
}
diff --git a/perllib/FixMyStreet/Cobrand/MakeMyIsland.pm b/perllib/FixMyStreet/Cobrand/MakeMyIsland.pm
index ebeb15fbb..f263df4cc 100644
--- a/perllib/FixMyStreet/Cobrand/MakeMyIsland.pm
+++ b/perllib/FixMyStreet/Cobrand/MakeMyIsland.pm
@@ -4,8 +4,6 @@ use base 'FixMyStreet::Cobrand::Default';
use strict;
use warnings;
-sub site_title { return 'MakeMyIsland'; }
-
sub country {
return 'MV';
}
diff --git a/perllib/FixMyStreet/Cobrand/SeeSomething.pm b/perllib/FixMyStreet/Cobrand/SeeSomething.pm
index 5e6d3a8cd..775ba770b 100644
--- a/perllib/FixMyStreet/Cobrand/SeeSomething.pm
+++ b/perllib/FixMyStreet/Cobrand/SeeSomething.pm
@@ -9,8 +9,6 @@ sub council_area { return 'West Midlands'; }
sub council_name { return 'See Something Say Something'; }
sub council_url { return 'seesomething'; }
sub area_types { [ 'MTD' ] }
-sub site_title { return 'See Something, Say Something'; }
-
sub site_restriction {
my $self = shift;
diff --git a/perllib/FixMyStreet/Cobrand/ZeroTB.pm b/perllib/FixMyStreet/Cobrand/ZeroTB.pm
index 087bf0912..cdf4e5ad4 100644
--- a/perllib/FixMyStreet/Cobrand/ZeroTB.pm
+++ b/perllib/FixMyStreet/Cobrand/ZeroTB.pm
@@ -4,8 +4,6 @@ use base 'FixMyStreet::Cobrand::Default';
use strict;
use warnings;
-sub site_title { return 'ZeroTB'; }
-
sub enter_postcode_text { return _ ('Enter a nearby street name and area, postal code or district in Delhi'); }
sub country {
diff --git a/perllib/FixMyStreet/DB/Result/Token.pm b/perllib/FixMyStreet/DB/Result/Token.pm
index 5525fe7a5..0156af137 100644
--- a/perllib/FixMyStreet/DB/Result/Token.pm
+++ b/perllib/FixMyStreet/DB/Result/Token.pm
@@ -30,9 +30,6 @@ __PACKAGE__->set_primary_key("scope", "token");
# Created by DBIx::Class::Schema::Loader v0.07017 @ 2012-03-08 17:19:55
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:+LLZ8P5GXqPetuGyrra2vw
-# Trying not to use this
-# use mySociety::DBHandle qw(dbh);
-
use mySociety::AuthToken;
=head1 NAME
@@ -43,8 +40,6 @@ FixMyStreet::DB::Result::Token
Representation of mySociety::AuthToken in the DBIx::Class world.
-Mostly done so that we don't need to use mySociety::DBHandle.
-
The 'data' value is automatically inflated and deflated in the same way that the
AuthToken would do it. 'token' is set to a new random value by default and the
'created' timestamp is achieved using the database function
diff --git a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
index 646967bfc..63a91697d 100644
--- a/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
+++ b/perllib/FixMyStreet/DB/ResultSet/Questionnaire.pm
@@ -92,8 +92,6 @@ sub send_questionnaires_period {
. $row->user->email . "\n"
if $params->{verbose};
- $h{site_name} = $cobrand->site_title();
-
my $result = FixMyStreet::App->send_email_cron(
{
_template_ => $template,
diff --git a/perllib/FixMyStreet/Geocode.pm b/perllib/FixMyStreet/Geocode.pm
index 2a318ea5a..b5be152a8 100644
--- a/perllib/FixMyStreet/Geocode.pm
+++ b/perllib/FixMyStreet/Geocode.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet::Geocode
# The geocoding functions for FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Geocode/Bing.pm b/perllib/FixMyStreet/Geocode/Bing.pm
index 85eef3d0f..702e19814 100644
--- a/perllib/FixMyStreet/Geocode/Bing.pm
+++ b/perllib/FixMyStreet/Geocode/Bing.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet::Geocode::Bing
# Geocoding with Bing for FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Geocode/FixaMinGata.pm b/perllib/FixMyStreet/Geocode/FixaMinGata.pm
index 2db25f504..2ea92c422 100644
--- a/perllib/FixMyStreet/Geocode/FixaMinGata.pm
+++ b/perllib/FixMyStreet/Geocode/FixaMinGata.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Geocode::FixaMinGata
# OpenStreetmap forward and reverse geocoding for FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Geocode/Google.pm b/perllib/FixMyStreet/Geocode/Google.pm
index fd65b89b1..11ff8ef80 100644
--- a/perllib/FixMyStreet/Geocode/Google.pm
+++ b/perllib/FixMyStreet/Geocode/Google.pm
@@ -1,6 +1,4 @@
-#!/usr/bin/perl
-#
-# FixMyStreet::Geocode
+# FixMyStreet::Geocode::Google
# The geocoding functions for FixMyStreet.
#
# Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved.
diff --git a/perllib/FixMyStreet/Geocode/OSM.pm b/perllib/FixMyStreet/Geocode/OSM.pm
index fd14b0acc..919940f78 100644
--- a/perllib/FixMyStreet/Geocode/OSM.pm
+++ b/perllib/FixMyStreet/Geocode/OSM.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Geocode::OSM
# OpenStreetmap forward and reverse geocoding for FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Geocode/Zurich.pm b/perllib/FixMyStreet/Geocode/Zurich.pm
index 84fd83fc7..1f0b4fc16 100644
--- a/perllib/FixMyStreet/Geocode/Zurich.pm
+++ b/perllib/FixMyStreet/Geocode/Zurich.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet::Geocode::Zurich
# Geocoding with Zurich web service.
#
diff --git a/perllib/FixMyStreet/Map.pm b/perllib/FixMyStreet/Map.pm
index f2dd0da6d..7d490fde3 100644
--- a/perllib/FixMyStreet/Map.pm
+++ b/perllib/FixMyStreet/Map.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map
# Adding the ability to have different maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/Bing.pm b/perllib/FixMyStreet/Map/Bing.pm
index 676e70bf6..09c951a5f 100644
--- a/perllib/FixMyStreet/Map/Bing.pm
+++ b/perllib/FixMyStreet/Map/Bing.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::Bing
# Bing maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/Bromley.pm b/perllib/FixMyStreet/Map/Bromley.pm
index 20821236f..fc8726b34 100644
--- a/perllib/FixMyStreet/Map/Bromley.pm
+++ b/perllib/FixMyStreet/Map/Bromley.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::Bromley
# Bromley have slightly different tiles, with trees etc.
#
diff --git a/perllib/FixMyStreet/Map/FMS.pm b/perllib/FixMyStreet/Map/FMS.pm
index 62849a157..96e265a4d 100644
--- a/perllib/FixMyStreet/Map/FMS.pm
+++ b/perllib/FixMyStreet/Map/FMS.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::FMS
# Bing and OS StreetView maps on FixMyStreet, using OpenLayers.
#
diff --git a/perllib/FixMyStreet/Map/Google.pm b/perllib/FixMyStreet/Map/Google.pm
index 9deefc033..172d2d60e 100644
--- a/perllib/FixMyStreet/Map/Google.pm
+++ b/perllib/FixMyStreet/Map/Google.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::Google
# Google maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/GoogleOL.pm b/perllib/FixMyStreet/Map/GoogleOL.pm
index 64baf8d36..2dfb697e5 100644
--- a/perllib/FixMyStreet/Map/GoogleOL.pm
+++ b/perllib/FixMyStreet/Map/GoogleOL.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::GoogleOL
# Google maps on FixMyStreet, using OpenLayers.
#
diff --git a/perllib/FixMyStreet/Map/OSM.pm b/perllib/FixMyStreet/Map/OSM.pm
index 82ddd293b..df2d16b82 100644
--- a/perllib/FixMyStreet/Map/OSM.pm
+++ b/perllib/FixMyStreet/Map/OSM.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::OSM
# OSM maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/OSM/CycleMap.pm b/perllib/FixMyStreet/Map/OSM/CycleMap.pm
index 71b86de8f..8f1de39d2 100644
--- a/perllib/FixMyStreet/Map/OSM/CycleMap.pm
+++ b/perllib/FixMyStreet/Map/OSM/CycleMap.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::OSM::CycleMap
# OSM CycleMap maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/OSM/MapQuest.pm b/perllib/FixMyStreet/Map/OSM/MapQuest.pm
index a7f1b334e..2c3cbaf00 100644
--- a/perllib/FixMyStreet/Map/OSM/MapQuest.pm
+++ b/perllib/FixMyStreet/Map/OSM/MapQuest.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::OSM::CycleMap
# OSM CycleMap maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/OSM/StreetView.pm b/perllib/FixMyStreet/Map/OSM/StreetView.pm
index 8fe4744a4..c70dd93aa 100644
--- a/perllib/FixMyStreet/Map/OSM/StreetView.pm
+++ b/perllib/FixMyStreet/Map/OSM/StreetView.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::OSM::StreetView
# OSM StreetView maps on FixMyStreet.
#
diff --git a/perllib/FixMyStreet/Map/Zurich.pm b/perllib/FixMyStreet/Map/Zurich.pm
index e09f8c90f..d667a4701 100644
--- a/perllib/FixMyStreet/Map/Zurich.pm
+++ b/perllib/FixMyStreet/Map/Zurich.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# FixMyStreet:Map::Zurich
# Zurich have their own tileserver.
#
diff --git a/perllib/FixMyStreet/SendReport/London.pm b/perllib/FixMyStreet/SendReport/London.pm
index 2c48a091c..2a1ebc1c3 100644
--- a/perllib/FixMyStreet/SendReport/London.pm
+++ b/perllib/FixMyStreet/SendReport/London.pm
@@ -5,6 +5,7 @@ use Moose;
BEGIN { extends 'FixMyStreet::SendReport'; }
use Digest::MD5;
+use FindBin;
use LWP::UserAgent;
use LWP::Simple;
diff --git a/perllib/FixMyStreet/TestAppProve.pm b/perllib/FixMyStreet/TestAppProve.pm
index 4d8cdaccb..75e9fe0a4 100644
--- a/perllib/FixMyStreet/TestAppProve.pm
+++ b/perllib/FixMyStreet/TestAppProve.pm
@@ -14,7 +14,7 @@ FixMyStreet::TestAppProve - spin up a clean database and configuration for tests
=head1 USAGE
-see bin/test-wrapper for usage
+see bin/run-tests for usage
=cut
diff --git a/perllib/Geo/Coordinates/CH1903.pm b/perllib/Geo/Coordinates/CH1903.pm
index 612182152..6611af9f2 100644
--- a/perllib/Geo/Coordinates/CH1903.pm
+++ b/perllib/Geo/Coordinates/CH1903.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# Geo::Coordinates::CH1903
# Conversion between WGS84 and Swiss CH1903.
#
diff --git a/perllib/PoChange.pm b/perllib/PoChange.pm
index f26161889..1e00c1426 100644
--- a/perllib/PoChange.pm
+++ b/perllib/PoChange.pm
@@ -1,4 +1,3 @@
-#!/usr/bin/perl -w
use strict;
package PoChange;
diff --git a/perllib/Utils.pm b/perllib/Utils.pm
index 8f0ac1820..7f95d1f5a 100644
--- a/perllib/Utils.pm
+++ b/perllib/Utils.pm
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-#
# Utils.pm:
# Various generic utilities for FixMyStreet.
#
@@ -15,7 +13,6 @@ use strict;
use DateTime;
use Encode;
use File::Slurp qw();
-use mySociety::DBHandle qw(dbh);
use mySociety::GeoUtil;
use mySociety::Locale;