aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/Page.pm15
-rw-r--r--perllib/Problems.pm2
-rw-r--r--perllib/Utils.pm29
3 files changed, 40 insertions, 6 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index 24c52885a..e659c0af5 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -578,12 +578,17 @@ sub display_problem_meta_line($$) {
$out .= '; ' . _('the map was not used so pin location may be inaccurate') unless ($problem->{used_map});
if ($problem->{council}) {
if ($problem->{whensent}) {
- $problem->{council} =~ s/\|.*//g;
- my @councils = split /,/, $problem->{council};
- my $areas_info = mySociety::MaPit::call('areas', \@councils);
- my $council = join(' and ', map { $areas_info->{$_}->{name} } @councils);
+ my $body;
+ if ($problem->{external_body}) {
+ $body = $problem->{external_body};
+ } else {
+ $problem->{council} =~ s/\|.*//g;
+ my @councils = split /,/, $problem->{council};
+ my $areas_info = mySociety::MaPit::call('areas', \@councils);
+ $body = join(' and ', map { $areas_info->{$_}->{name} } @councils);
+ }
$out .= '<small class="council_sent_info">';
- $out .= $q->br() . sprintf(_('Sent to %s %s later'), $council, prettify_duration($problem->{whensent}, 'minute'));
+ $out .= $q->br() . sprintf(_('Sent to %s %s later'), $body, prettify_duration($problem->{whensent}, 'minute'));
$out .= '</small>';
}
} else {
diff --git a/perllib/Problems.pm b/perllib/Problems.pm
index 3710c3a95..7155aa485 100644
--- a/perllib/Problems.pm
+++ b/perllib/Problems.pm
@@ -226,7 +226,7 @@ sub fetch_problem {
used_map, name, anonymous, extract(epoch from confirmed) as time,
state, extract(epoch from whensent-confirmed) as whensent,
extract(epoch from ms_current_timestamp()-lastupdate) as duration,
- service, cobrand, cobrand_data
+ service, cobrand, cobrand_data, external_body
from problem where id=? and state in ('confirmed','fixed', 'hidden')
$site_restriction", {}, $id
);
diff --git a/perllib/Utils.pm b/perllib/Utils.pm
index 21994d20b..c16a02cd4 100644
--- a/perllib/Utils.pm
+++ b/perllib/Utils.pm
@@ -107,4 +107,33 @@ sub truncate_coordinate {
return $out;
}
+sub london_categories {
+ return {
+ 'Abandoned vehicle' => 'AbandonedVehicle',
+ 'Car parking' => 'Parking',
+ 'Dangerous structure' => 'DangerousStructure',
+ 'Dead animal' => 'DeadAnimal',
+ 'Dumped cylinder' => 'DumpedCylinder',
+ 'Dumped rubbish' => 'DumpedRubbish',
+ 'Flyposting' => 'FlyPosting',
+ 'Graffiti' => 'Graffiti',
+ 'Litter bin' => 'LitterBin',
+ 'Public toilet' => 'PublicToilet',
+ 'Refuse collection' => 'RefuseCollection',
+ 'Road or pavement defect' => 'Road',
+ 'Road or pavement obstruction' => 'Obstruction',
+ 'Skip problem' => 'Skip',
+ 'Street cleaning' => 'StreetCleaning',
+ 'Street drainage' => 'StreetDrainage',
+ 'Street furniture' => 'StreetFurniture',
+ 'Street needs gritting' => 'StreetGritting',
+ 'Street lighting' => 'StreetLighting',
+ 'Street sign' => 'StreetSign',
+ 'Traffic light' => 'TrafficLight',
+ 'Tree (dangerous)' => 'DangerousTree',
+ 'Tree (fallen branches)' => 'FallenTree',
+ 'Untaxed vehicle' => 'UntaxedVehicle',
+ };
+}
+
1;