aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm21
-rw-r--r--perllib/FixMyStreet/Map/OSM/MapQuest.pm33
-rw-r--r--perllib/Utils.pm2
3 files changed, 53 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index 59e3a4410..afe180c29 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -51,7 +51,7 @@ sub display : Path('') : Args(1) {
return $c->res->redirect( $c->uri_for($1), 301 );
}
- $c->forward('load_problem_or_display_error', [ $id ] );
+ $c->forward( 'load_problem_or_display_error', [ $id ] );
$c->forward( 'load_updates' );
$c->forward( 'format_problem_for_display' );
}
@@ -88,7 +88,24 @@ sub load_updates : Private {
{ order_by => 'confirmed' }
);
- $c->stash->{updates} = $updates;
+ my $questionnaires = $c->model('DB::Questionnaire')->search(
+ {
+ problem_id => $c->stash->{problem}->id,
+ whenanswered => { '!=', undef },
+ old_state => 'confirmed', new_state => 'confirmed',
+ },
+ { order_by => 'whenanswered' }
+ );
+
+ my @combined;
+ while (my $update = $updates->next) {
+ push @combined, [ $update->confirmed, $update ];
+ }
+ while (my $update = $questionnaires->next) {
+ push @combined, [ $update->whenanswered, $update ];
+ }
+ @combined = map { $_->[1] } sort { $a->[0] <=> $b->[0] } @combined;
+ $c->stash->{updates} = \@combined;
return 1;
}
diff --git a/perllib/FixMyStreet/Map/OSM/MapQuest.pm b/perllib/FixMyStreet/Map/OSM/MapQuest.pm
new file mode 100644
index 000000000..9cf6de01f
--- /dev/null
+++ b/perllib/FixMyStreet/Map/OSM/MapQuest.pm
@@ -0,0 +1,33 @@
+#!/usr/bin/perl
+#
+# FixMyStreet:Map::OSM::CycleMap
+# OSM CycleMap maps on FixMyStreet.
+#
+# Copyright (c) 2010 UK Citizens Online Democracy. All rights reserved.
+# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
+
+package FixMyStreet::Map::OSM::MapQuest;
+use base 'FixMyStreet::Map::OSM';
+
+use strict;
+
+sub map_type {
+ return 'OpenLayers.Layer.OSM.MapQuestOpen';
+}
+
+sub map_tiles {
+ my ($self, $x, $y, $z) = @_;
+ my $tile_url = $self->base_tile_url();
+ return [
+ "http://otile1.$tile_url/$z/" . ($x - 1) . "/" . ($y - 1) . ".png",
+ "http://otile2.$tile_url/$z/$x/" . ($y - 1) . ".png",
+ "http://otile3.$tile_url/$z/" . ($x - 1) . "/$y.png",
+ "http://otile4.$tile_url/$z/$x/$y.png",
+ ];
+}
+
+sub base_tile_url {
+ return 'mqcdn.com/tiles/1.0.0/osm/';
+}
+
+1;
diff --git a/perllib/Utils.pm b/perllib/Utils.pm
index 954561a08..4e64836c6 100644
--- a/perllib/Utils.pm
+++ b/perllib/Utils.pm
@@ -190,7 +190,7 @@ sub cleanup_text {
for ($input) {
# shit -> poo
- s{\bdog\s*shit\b}{dog poo}ig;
+ s{\bdog\s*shite*?\b}{dog poo}ig;
# 'portakabin' to '[portable cabin]' (and variations)
s{\b(porta)\s*([ck]abin|loo)\b}{[$1ble $2]}ig;