aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatthew <matthew>2007-08-27 20:29:33 +0000
committermatthew <matthew>2007-08-27 20:29:33 +0000
commitc0808959a627c17af9f99b23e572392b63aac670 (patch)
treecfe7c1821d6d14d52697266f0a031052c5eb4b3b
parentd5096b4f393d2f8a18515b7808bd064dc71567ac (diff)
Improve SQL; correct footer on email alert; layout tweak.
-rw-r--r--db/alert_types.sql2
-rw-r--r--templates/emails/alert-problem2
-rwxr-xr-xweb/reports.cgi11
3 files changed, 8 insertions, 7 deletions
diff --git a/db/alert_types.sql b/db/alert_types.sql
index d909450c1..356f339d1 100644
--- a/db/alert_types.sql
+++ b/db/alert_types.sql
@@ -40,7 +40,7 @@ insert into alert_type
values ('council_problems', '', '',
'New problems to {{COUNCIL}} on FixMyStreet', '/reports', 'The latest problems for {{COUNCIL}} reported by users',
'problem', 'problem.state in (\'confirmed\', \'fixed\') and (council like \'%\'||?||\'%\'
- or (council is null and areas like \'%,\'||?||\',%\'))', 'created desc',
+ or council is null) and areas like \'%,\'||?||\',%\'', 'created desc',
'{{title}}, {{confirmed}}', '/?id={{id}}', '{{detail}}', 'alert-problem'
);
diff --git a/templates/emails/alert-problem b/templates/emails/alert-problem
index 9cae68232..3d389a99b 100644
--- a/templates/emails/alert-problem
+++ b/templates/emails/alert-problem
@@ -7,5 +7,5 @@ The following new problems have been added:
--
The FixMyStreet team
-To stop receiving emails when there are new comments on this problem,
+To stop receiving emails when there are new problems,
please follow this link: <?=$values['unsubscribe_url']?>
diff --git a/web/reports.cgi b/web/reports.cgi
index 63ccd64bd..e4f8a7a65 100755
--- a/web/reports.cgi
+++ b/web/reports.cgi
@@ -7,7 +7,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: reports.cgi,v 1.9 2007-08-25 00:17:30 matthew Exp $
+# $Id: reports.cgi,v 1.10 2007-08-27 20:29:34 matthew Exp $
use strict;
require 5.8.0;
@@ -83,9 +83,11 @@ sub main {
# RSS - reports for sent reports, area for all problems in area
if ($rss && $one_council) {
+ my $url = short_name($q_council);
+ $url .= '/' . short_name($q_ward) if $ward;
if ($rss eq 'area' && $area_type ne 'DIS' && $area_type ne 'CTY') {
# Two possibilites are the same for one-tier councils, so redirect one to the other
- print $q->redirect('/rss/reports/' . short_name($q_council) . ($ward ? '/' . short_name($q_ward) : ''));
+ print $q->redirect('/rss/reports/' . $url);
return;
}
my $type = 'council_problems'; # Problems sent to a council
@@ -100,8 +102,6 @@ sub main {
$title_params{NAME} = $ward ? $q_ward : $q_council;
$type = 'area_problems'; # Problems within an area
}
- my $url = short_name($q_council);
- $url .= '/' . short_name($q_ward) if $ward;
mySociety::Alert::generate_rss($type, "/$url", \@params, \%title_params);
return;
}
@@ -237,7 +237,8 @@ sub add_row {
sub summary_cell {
my $c = shift;
- print $c ? '<td>' . scalar @$c . '</td>' : '<td>0</td>';
+ $c ||= [];
+ print '<td>' . scalar @$c . '</td>';
}
sub list_problems {