diff options
author | louise <louise> | 2010-01-06 12:33:25 +0000 |
---|---|---|
committer | louise <louise> | 2010-01-06 12:33:25 +0000 |
commit | f6fc89e70b1565d40f375fdf3b779dffefd9622d (patch) | |
tree | 85285a388c48391923ac3b1713fd7da9f202e345 /perllib | |
parent | 6ca540c27da31ff2c67388e5bc21ca2c99d233d6 (diff) |
If using a cobranded version of the admin interface, all urls should be cobranded ones, even for generic problems
Diffstat (limited to 'perllib')
-rw-r--r-- | perllib/Cobrand.pm | 6 | ||||
-rw-r--r-- | perllib/Problems.pm | 10 |
2 files changed, 11 insertions, 5 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm index c195ee6d7..4433858bb 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.57 2009-12-22 14:22:09 matthew Exp $ +# $Id: Cobrand.pm,v 1.58 2010-01-06 12:33:25 louise Exp $ package Cobrand; use strict; @@ -60,6 +60,10 @@ my %fns = ( 'prettify_epoch' => { default => '0' }, # Parameters are FORM_NAME, QUERY. Return HTML for any extra needed elements for FORM_NAME 'form_elements' => { default => "''" }, + # Parameter is UPDATE_DATA, a reference to a hash of non-cobranded update data. Return cobrand extra data for the update + 'cobrand_data_for_generic_update' => { default => "''" }, + # Parameter is PROBLEM_DATA, a reference to a hash of non-cobranded problem data. Return cobrand extra data for the problem + 'cobrand_data_for_generic_problem' => { default => "''" }, # Parameter is QUERY. Return a string of extra data to be stored with a problem 'extra_problem_data' => { default => "''" }, # Parameter is QUERY. Return a string of extra data to be stored with an update diff --git a/perllib/Problems.pm b/perllib/Problems.pm index e3ec5dcee..baf4304c2 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.31 2009-11-19 16:41:57 louise Exp $ +# $Id: Problems.pm,v 1.32 2010-01-06 12:33:25 louise Exp $ # package Problems; @@ -348,13 +348,14 @@ sub update_search { my ($search) = @_; my $search_n = 0; $search_n = int($search) if $search =~ /^\d+$/; - my $updates = select_all("select comment.* from comment, problem where problem.id = comment.problem_id + my $updates = select_all("select comment.*, problem.council from comment, problem where problem.id = comment.problem_id and (comment.id=? or problem_id=? or comment.email ilike '%'||?||'%' or comment.name ilike '%'||?||'%' or comment.text ilike '%'||?||'%' or comment.cobrand_data ilike '%'||?||'%') $site_restriction order by created", $search_n, $search_n, $search, $search, $search, $search); + return $updates; } =item update_counts @@ -456,7 +457,7 @@ Uses any site_restriction defined by a cobrand. =cut sub admin_fetch_update { my ($id) = @_; - my $update = dbh()->selectall_arrayref("select comment.* from comment, problem + my $update = dbh()->selectall_arrayref("select comment.*, problem.council from comment, problem where comment.id=? and problem.id = comment.problem_id $site_restriction", { Slice=>{} }, $id); @@ -491,7 +492,8 @@ Uses any site_restriction defined by a cobrand. sub timeline_updates { my $updates = select_all("select comment.*, - extract(epoch from comment.created) as created + extract(epoch from comment.created) as created, + problem.council from comment, problem where comment.problem_id = problem.id and comment.state='confirmed' |