aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--db/schema.sql3
-rw-r--r--perllib/Page.pm3
-rw-r--r--perllib/Problems.pm4
-rwxr-xr-xweb/import.cgi8
4 files changed, 10 insertions, 8 deletions
diff --git a/db/schema.sql b/db/schema.sql
index 28d347989..d80fb5a7b 100644
--- a/db/schema.sql
+++ b/db/schema.sql
@@ -4,7 +4,7 @@
-- Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved.
-- Email: matthew@mysociety.org; WWW: http://www.mysociety.org/
--
--- $Id: schema.sql,v 1.41 2008-10-09 14:20:53 matthew Exp $
+-- $Id: schema.sql,v 1.42 2008-10-24 09:52:42 matthew Exp $
--
-- secret
@@ -147,6 +147,7 @@ create table problem (
or state = 'hidden'
or state = 'partial'
),
+ service text not null default '',
lastupdate timestamp not null default ms_current_timestamp(),
whensent timestamp,
send_questionnaire boolean not null default 't'
diff --git a/perllib/Page.pm b/perllib/Page.pm
index af7c81ab9..70eee3455 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.124 2008-10-17 20:23:07 matthew Exp $
+# $Id: Page.pm,v 1.125 2008-10-24 09:52:42 matthew Exp $
#
package Page;
@@ -571,6 +571,7 @@ sub display_problem_text {
$out .= ent($problem->{category}) . ', reported ';
} else {
$out .= 'Reported ';
+ $out .= 'by ' . ent($problem->{service}) . ' ' if $problem->{service};
$out .= 'in the ' . ent($problem->{category}) . ' category '
if $problem->{category} && $problem->{category} ne 'Other';
}
diff --git a/perllib/Problems.pm b/perllib/Problems.pm
index 6c29a256e..e96c7f73b 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.8 2008-10-17 18:55:16 matthew Exp $
+# $Id: Problems.pm,v 1.9 2008-10-24 09:52:42 matthew Exp $
#
package Problems;
@@ -167,7 +167,7 @@ sub fetch_problem {
"select id, easting, northing, council, category, title, detail, (photo is not null) as 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
+ extract(epoch from ms_current_timestamp()-lastupdate) as duration, service
from problem where id=? and state in ('confirmed','fixed', 'hidden')
$site_restriction", {}, $id
);
diff --git a/web/import.cgi b/web/import.cgi
index 1ce80c7eb..b7f554d62 100755
--- a/web/import.cgi
+++ b/web/import.cgi
@@ -6,7 +6,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: matthew@mysociety.org. WWW: http://www.mysociety.org
#
-# $Id: import.cgi,v 1.5 2008-10-23 12:51:42 matthew Exp $
+# $Id: import.cgi,v 1.6 2008-10-24 09:52:42 matthew Exp $
use strict;
use Error qw(:try);
@@ -88,12 +88,12 @@ sub main {
# Store what we have so far in the database
my $id = dbh()->selectrow_array("select nextval('problem_id_seq')");
Utils::workaround_pg_bytea("insert into problem
- (id, postcode, easting, northing, title, detail, name,
+ (id, postcode, easting, northing, title, detail, name, service,
email, phone, photo, state, used_map, anonymous, category, areas)
values
- (?, '', ?, ?, ?, ?, ?, ?, ?, ?, 'partial', 't', 'f', '', '')", 9,
+ (?, '', ?, ?, ?, ?, ?, ?, ?, ?, ?, 'partial', 't', 'f', '', '')", 9,
$id, $input{easting}, $input{northing}, $input{subject},
- $input{detail}, $input{name}, $input{email}, $input{phone}, $photo);
+ $input{detail}, $input{name}, $input{service}, $input{email}, $input{phone}, $photo);
# Send checking email
my $template = File::Slurp::read_file("$FindBin::Bin/../templates/emails/partial");