aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/Problems.pm7
-rwxr-xr-xweb/index.cgi9
2 files changed, 10 insertions, 6 deletions
diff --git a/perllib/Problems.pm b/perllib/Problems.pm
index 788074e37..1556b7724 100644
--- a/perllib/Problems.pm
+++ b/perllib/Problems.pm
@@ -176,7 +176,9 @@ sub around_map {
$limit_clause = " limit $limit";
}
mySociety::Locale::in_gb_locale { select_all(
- "select id,title,easting,northing,state from problem
+ "select id,title,easting,northing,state,
+ extract(epoch from confirmed) as time
+ from problem
where state in ('confirmed', 'fixed')
and easting>=? and easting<? and northing>=? and northing<? " .
($interval ? " and ms_current_timestamp()-lastupdate < '$interval'::interval" : '') .
@@ -189,7 +191,8 @@ sub around_map {
sub nearby {
my ($dist, $ids, $limit, $mid_e, $mid_n, $interval) = @_;
mySociety::Locale::in_gb_locale { select_all(
- "select id, title, easting, northing, distance, state
+ "select id, title, easting, northing, distance, state,
+ extract(epoch from confirmed) as time
from problem_find_nearby(?, ?, $dist) as nearby, problem
where nearby.problem_id = problem.id " .
($interval ? " and ms_current_timestamp()-lastupdate < '$interval'::interval" : '') .
diff --git a/web/index.cgi b/web/index.cgi
index 83b3b421c..5785a30bd 100755
--- a/web/index.cgi
+++ b/web/index.cgi
@@ -820,8 +820,8 @@ sub display_location {
my $report_url = NewURL($q, -retain => 1, -url => '/report/' . $_->{id}, pc => undef, x => undef, 'y' => undef);
$report_url = Cobrand::url($cobrand, $report_url, $q);
$on_list .= '<li><a href="' . $report_url . '">';
- $on_list .= ent($_->{title});
- $on_list .= '</a>';
+ $on_list .= ent($_->{title}) . '</a> <small>(';
+ $on_list .= Page::prettify_epoch($_->{time}) . ')</small>';
$on_list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$on_list .= '</li>';
}
@@ -834,8 +834,9 @@ sub display_location {
$around_list .= '<li><a href="' . $report_url . '">';
my $dist = int($_->{distance}/100+0.5);
$dist = $dist / 10;
- $around_list .= ent($_->{title}) . ' <small>(' . $dist . 'km)</small>';
- $around_list .= '</a>';
+ $around_list .= ent($_->{title}) . '</a> <small>(';
+ $around_list .= Page::prettify_epoch($_->{time}) . ', ';
+ $around_list .= $dist . 'km)</small>';
$around_list .= ' <small>' . _('(fixed)') . '</small>' if $_->{state} eq 'fixed';
$around_list .= '</li>';
push @pins, [ $_->{easting}, $_->{northing}, $_->{state} eq 'fixed' ? 'green' : 'red' ];