aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/Cobrand.pm19
-rw-r--r--perllib/Page.pm4
-rw-r--r--perllib/Problems.pm5
3 files changed, 24 insertions, 4 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm
index fbfbfbe9a..99b46ee23 100644
--- a/perllib/Cobrand.pm
+++ b/perllib/Cobrand.pm
@@ -7,7 +7,7 @@
# Copyright (c) 2009 UK Citizens Online Democracy. All rights reserved.
# Email: louise@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: Cobrand.pm,v 1.42 2009-11-19 15:10:28 louise Exp $
+# $Id: Cobrand.pm,v 1.43 2009-11-19 16:41:57 louise Exp $
package Cobrand;
use strict;
@@ -446,6 +446,23 @@ sub show_watermark {
}
}
+=item extra_problem_meta_text COBRAND PROBLEM
+
+Returns any extra text to be displayed with a problem.
+
+=cut
+sub extra_problem_meta_text {
+ my ($cobrand, $problem) = @_;
+ my $handle;
+ if ($cobrand){
+ $handle = cobrand_handle($cobrand);
+ }
+ if ( !$cobrand || !$handle || !$handle->can('extra_problem_meta_text')){
+ return '';
+ } else{
+ return $handle->extra_problem_meta_text($problem);
+ }
+}
=item url
Given a URL, return a URL with any extra params needed appended to it.
diff --git a/perllib/Page.pm b/perllib/Page.pm
index 3d2d416c9..657ddfa68 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Page.pm,v 1.210 2009-11-19 15:11:52 louise Exp $
+# $Id: Page.pm,v 1.211 2009-11-19 16:41:57 louise Exp $
#
package Page;
@@ -780,6 +780,8 @@ sub display_problem_meta_line($$) {
$out .= sprintf(_('Reported by %s at %s'), ent($problem->{name}), prettify_epoch($problem->{time}));
}
}
+ my $cobrand = get_cobrand($q);
+ $out .= Cobrand::extra_problem_meta_text($cobrand, $problem);
$out .= '; ' . _('the map was not used so pin location may be inaccurate') unless ($problem->{used_map});
if ($problem->{council}) {
if ($problem->{whensent}) {
diff --git a/perllib/Problems.pm b/perllib/Problems.pm
index 4d5a32fbd..e3ec5dcee 100644
--- a/perllib/Problems.pm
+++ b/perllib/Problems.pm
@@ -6,7 +6,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: Problems.pm,v 1.30 2009-11-19 09:56:12 louise Exp $
+# $Id: Problems.pm,v 1.31 2009-11-19 16:41:57 louise Exp $
#
package Problems;
@@ -213,7 +213,8 @@ sub fetch_problem {
"select id, easting, northing, council, category, title, detail, photo,
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
+ extract(epoch from ms_current_timestamp()-lastupdate) as duration,
+ service, cobrand, cobrand_data
from problem where id=? and state in ('confirmed','fixed', 'hidden')
$site_restriction", {}, $id
);