diff options
author | matthew <matthew> | 2008-09-19 10:24:55 +0000 |
---|---|---|
committer | matthew <matthew> | 2008-09-19 10:24:55 +0000 |
commit | 6708e7dd9b259207c613bb08b693d0ee5a1f2f0d (patch) | |
tree | 35d6c887c93a4a76e47400fa158dd35b58c32273 | |
parent | 2b7fa24af368a4b66893fa5a26ff849807f5d427 (diff) |
Nicer URLs for reports.
-rwxr-xr-x | bin/send-reports | 4 | ||||
-rw-r--r-- | db/alert_types.sql | 14 | ||||
-rw-r--r-- | perllib/Page.pm | 6 | ||||
-rw-r--r-- | perllib/Problems.pm | 4 | ||||
-rwxr-xr-x | web-admin/index.cgi | 6 | ||||
-rwxr-xr-x | web/ajax.cgi | 8 | ||||
-rwxr-xr-x | web/confirm.cgi | 10 | ||||
-rwxr-xr-x | web/contact.cgi | 4 | ||||
-rwxr-xr-x | web/fun.cgi | 10 | ||||
-rwxr-xr-x | web/index.cgi | 44 | ||||
-rw-r--r-- | web/js.js | 4 | ||||
-rwxr-xr-x | web/questionnaire.cgi | 4 | ||||
-rwxr-xr-x | web/reports.cgi | 8 | ||||
-rwxr-xr-x | web/rss.cgi | 4 |
14 files changed, 73 insertions, 57 deletions
diff --git a/bin/send-reports b/bin/send-reports index add88089a..05c63453f 100755 --- a/bin/send-reports +++ b/bin/send-reports @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: send-reports,v 1.55 2008-09-05 18:18:20 matthew Exp $ +# $Id: send-reports,v 1.56 2008-09-19 10:24:55 matthew Exp $ use strict; require 5.8.0; @@ -75,7 +75,7 @@ foreach my $row (@$unsent) { $h{phone} = "Phone: $h{phone}\n\n" if $h{phone}; $h{has_photo} = ''; $h{has_photo} = "This web page also contains a photo of the problem, provided by the user.\n\n" if $row->{has_photo}; - $h{url} = $base_url . '/?id=' . $row->{id}; + $h{url} = $base_url . '/report/' . $row->{id}; $h{fuzzy} = $row->{used_map} ? 'To view a map of the precise location of this issue' : 'The user could not locate the problem on a map, but to see the area around the location they entered'; $h{closest_address} = ''; diff --git a/db/alert_types.sql b/db/alert_types.sql index a512d7619..bcb42b4e9 100644 --- a/db/alert_types.sql +++ b/db/alert_types.sql @@ -7,7 +7,7 @@ insert into alert_type values ('new_updates', 'select * from problem where id=?', 'problem', 'Updates on {{title}}', '/', 'Updates on {{title}}', 'comment', 'comment.state=\'confirmed\'', 'created desc', - 'Update by {{name}}', '/?id={{problem_id}}#comment_{{id}}', '{{text}}', 'alert-update'); + 'Update by {{name}}', '/report/{{problem_id}}#comment_{{id}}', '{{text}}', 'alert-update'); -- New problems anywhere on the site insert into alert_type @@ -18,7 +18,7 @@ insert into alert_type values ('new_problems', '', '', 'New problems on FixMyStreet', '/', 'The latest problems reported by users', 'problem', 'problem.state in (\'confirmed\', \'fixed\')', 'created desc', - '{{title}}, {{confirmed}}', '/?id={{id}}', '{{detail}}', 'alert-problem'); + '{{title}}, {{confirmed}}', '/report/{{id}}', '{{detail}}', 'alert-problem'); -- New fixed problems anywhere on the site insert into alert_type @@ -29,7 +29,7 @@ insert into alert_type values ('new_fixed_problems', '', '', 'Problems recently reported fixed on FixMyStreet', '/', 'The latest problems reported fixed by users', 'problem', 'problem.state in (\'fixed\')', 'lastupdate desc', - '{{title}}, {{confirmed}}', '/?id={{id}}', '{{detail}}', 'alert-problem'); + '{{title}}, {{confirmed}}', '/report/{{id}}', '{{detail}}', 'alert-problem'); -- New problems around a location insert into alert_type @@ -40,7 +40,7 @@ insert into alert_type values ('local_problems', '', '', 'New local problems on FixMyStreet', '/', 'The latest local problems reported by users', 'problem_find_nearby(?, ?, ?) as nearby,problem', 'nearby.problem_id = problem.id and problem.state in (\'confirmed\', \'fixed\')', 'created desc', - '{{title}}, {{confirmed}}', '/?id={{id}}', '{{detail}}', 'alert-problem-nearby'); + '{{title}}, {{confirmed}}', '/report/{{id}}', '{{detail}}', 'alert-problem-nearby'); -- New problems sent to a particular council insert into alert_type @@ -52,7 +52,7 @@ 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', - '{{title}}, {{confirmed}}', '/?id={{id}}', '{{detail}}', 'alert-problem-council' + '{{title}}, {{confirmed}}', '/report/{{id}}', '{{detail}}', 'alert-problem-council' ); -- New problems within a particular ward sent to a particular council @@ -66,7 +66,7 @@ values ('ward_problems', '', '', 'The latest problems for {{COUNCIL}} within {{WARD}} ward reported by users', 'problem', 'problem.state in (\'confirmed\', \'fixed\') and (council like \'%\'||?||\'%\' or council is null) and areas like \'%,\'||?||\',%\'', 'created desc', - '{{title}}, {{confirmed}}', '/?id={{id}}', '{{detail}}', 'alert-problem-ward' + '{{title}}, {{confirmed}}', '/report/{{id}}', '{{detail}}', 'alert-problem-ward' ); -- New problems within a particular voting area (ward, constituency, whatever) @@ -79,6 +79,6 @@ values ('area_problems', '', '', 'New problems within {{NAME}}\'s boundary on FixMyStreet', '/reports', 'The latest problems within {{NAME}}\'s boundary reported by users', 'problem', 'problem.state in (\'confirmed\', \'fixed\') and areas like \'%,\'||?||\',%\'', 'created desc', - '{{title}}, {{confirmed}}', '/?id={{id}}', '{{detail}}', 'alert-problem-area' + '{{title}}, {{confirmed}}', '/report/{{id}}', '{{detail}}', 'alert-problem-area' ); diff --git a/perllib/Page.pm b/perllib/Page.pm index 7efab3896..587798630 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.113 2008-09-18 10:28:21 matthew Exp $ +# $Id: Page.pm,v 1.114 2008-09-19 10:24:55 matthew Exp $ # package Page; @@ -344,7 +344,7 @@ sub display_pin { . $num . '.gif" alt="' . _('Problem') . '" style="top:' . ($py-59) . 'px; left:' . ($px) . 'px; position: absolute;">'; return $out unless $_ && $_->{id} && $col ne 'blue'; - my $url = '/?id=' . $_->{id}; + my $url = '/report/' . $_->{id}; $out = '<a title="' . ent($_->{title}) . '" href="' . $url . '">' . $out . '</a>'; return $out; } @@ -417,7 +417,7 @@ sub compass ($$$) { $compass[$i][$j] = NewURL($q, x=>$i, y=>$j); } } - my $recentre = NewURL($q, x=>undef, y=>undef); + my $recentre = NewURL($q); return <<EOF; <table cellpadding="0" cellspacing="0" border="0" id="compass"> <tr valign="bottom"> diff --git a/perllib/Problems.pm b/perllib/Problems.pm index b1c81be94..2c01b456d 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.6 2008-09-17 21:40:44 matthew Exp $ +# $Id: Problems.pm,v 1.7 2008-09-19 10:24:55 matthew Exp $ # package Problems; @@ -104,7 +104,7 @@ sub recent_photos { my $out = ''; foreach (@$probs) { my $title = ent($_->{title}); - $out .= '<a href="/?id=' . $_->{id} . + $out .= '<a href="/report/' . $_->{id} . '"><img border="0" src="/photo?tn=1;id=' . $_->{id} . '" alt="' . $title . '" title="' . $title . '"></a>'; } diff --git a/web-admin/index.cgi b/web-admin/index.cgi index d6ef02513..25bf21653 100755 --- a/web-admin/index.cgi +++ b/web-admin/index.cgi @@ -7,10 +7,10 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: index.cgi,v 1.50 2008-09-05 10:47:11 matthew Exp $ +# $Id: index.cgi,v 1.51 2008-09-19 10:24:56 matthew Exp $ # -my $rcsid = ''; $rcsid .= '$Id: index.cgi,v 1.50 2008-09-05 10:47:11 matthew Exp $'; +my $rcsid = ''; $rcsid .= '$Id: index.cgi,v 1.51 2008-09-19 10:24:56 matthew Exp $'; use strict; @@ -30,7 +30,7 @@ use mySociety::Config; use mySociety::DBHandle qw(dbh select_all); use mySociety::MaPit; use mySociety::VotingArea; -use mySociety::Web qw(ent NewURL); +use mySociety::Web qw(ent); BEGIN { mySociety::Config::set_file("$FindBin::Bin/../conf/general"); diff --git a/web/ajax.cgi b/web/ajax.cgi index 0e971a36c..d5cda6d0d 100755 --- a/web/ajax.cgi +++ b/web/ajax.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: ajax.cgi,v 1.2 2008-09-17 14:55:48 matthew Exp $ +# $Id: ajax.cgi,v 1.3 2008-09-19 10:24:55 matthew Exp $ use strict; use Standard; @@ -35,7 +35,7 @@ sub main { my $list = ''; foreach (@$on_map) { - $list .= '<li><a href="/?id=' . $_->{id} . '">'; + $list .= '<li><a href="/report/' . $_->{id} . '">'; $list .= $_->{title}; $list .= '</a>'; $list .= ' <small>(fixed)</small>' if $_->{state} eq 'fixed'; @@ -45,7 +45,7 @@ sub main { $list = ''; foreach (@$around_map) { - $list .= '<li><a href="/?id=' . $_->{id} . '">'; + $list .= '<li><a href="/report/' . $_->{id} . '">'; $list .= $_->{title} . ' <small>(' . int($_->{distance}/100+.5)/10 . 'km)</small>'; $list .= '</a>'; $list .= ' <small>(fixed)</small>' if $_->{state} eq 'fixed'; @@ -55,7 +55,7 @@ sub main { #$list = ''; #foreach (@$fixed) { - # $list .= '<li><a href="' . NewURL($q, id=>$_->{id}, x=>undef, y=>undef) . '">'; + # $list .= '<li><a href="/report/' . $_->{id} . '">'; # $list .= $_->{title} . ' <small>(' . int($_->{distance}/100+.5)/10 . 'km)</small>'; # $list .= '</a></li>'; #} diff --git a/web/confirm.cgi b/web/confirm.cgi index 01270f1c1..606252967 100755 --- a/web/confirm.cgi +++ b/web/confirm.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: confirm.cgi,v 1.43 2008-09-19 08:43:36 matthew Exp $ +# $Id: confirm.cgi,v 1.44 2008-09-19 10:24:55 matthew Exp $ use strict; use Standard; @@ -85,7 +85,7 @@ sub confirm_update { if ($creator_fixed > 0 && $q->{site} ne 'emptyhomes') { $out = ask_questionnaire($q->param('token')); } else { - $out = $q->p(sprintf(_('You have successfully confirmed your update and you can now <a href="%s">view it on the site</a>.'), "/?id=$problem_id#update_$id")); + $out = $q->p(sprintf(_('You have successfully confirmed your update and you can now <a href="%s">view it on the site</a>.'), "/report/$problem_id#update_$id")); #if ($fixed) { $out .= CrossSell::display_advert($q, $email, $name); #} else { @@ -119,13 +119,13 @@ sub confirm_problem { if ($q->{site} eq 'scambs') { $out = $q->p($q->big( 'You have successfully confirmed your problem, and we will be in contact with you about it shortly. ' - . sprintf(' <a href="%s">View the problem on this site</a>.', "/?id=$id") + . sprintf(' <a href="%s">View the problem on this site</a>.', "/report/$id") )); } else { $out = $q->p( _('You have successfully confirmed your problem') . ($council ? _(' and <strong>we will now send it to the council</strong>') : '') - . sprintf(_('. You can <a href="%s">view the problem on this site</a>.'), "/?id=$id") + . sprintf(_('. You can <a href="%s">view the problem on this site</a>.'), "/report/$id") ); } @@ -193,7 +193,7 @@ sub add_questionnaire { ever_reported, old_state, new_state) values (?, ms_current_timestamp(), ms_current_timestamp(), ?, 'confirmed', 'fixed');", {}, $problem_id, $reported) unless $already; - my $out = $q->p(sprintf('Thank you — you can <a href="%s">view your updated problem</a> on the site.', "/?id=$problem_id")); + my $out = $q->p(sprintf('Thank you — you can <a href="%s">view your updated problem</a> on the site.', "/report/$problem_id")); $out .= CrossSell::display_advert($q, $email, $name); return $out; } diff --git a/web/contact.cgi b/web/contact.cgi index 005d63c52..600e0c163 100755 --- a/web/contact.cgi +++ b/web/contact.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: contact.cgi,v 1.31 2008-09-18 11:11:07 matthew Exp $ +# $Id: contact.cgi,v 1.32 2008-09-19 10:24:55 matthew Exp $ use strict; use Standard; @@ -50,7 +50,7 @@ sub contact_submit { (my $message = $input{message}) =~ s/\r\n/\n/g; (my $subject = $input{subject}) =~ s/\r|\n/ /g; $message .= "\n\n[ Complaint about report $input{id} - " - . mySociety::Config::get('BASE_URL') . "/?id=$input{id} ]" + . mySociety::Config::get('BASE_URL') . "/report/$input{id} ]" if $input{id}; my $postfix = '[ Sent by contact.cgi on ' . $ENV{'HTTP_HOST'} . '. ' . diff --git a/web/fun.cgi b/web/fun.cgi index 5b3b8d087..d93658dff 100755 --- a/web/fun.cgi +++ b/web/fun.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: fun.cgi,v 1.2 2008-01-28 15:27:00 matthew Exp $ +# $Id: fun.cgi,v 1.3 2008-09-19 10:24:55 matthew Exp $ use strict; use Standard -db; @@ -32,23 +32,23 @@ Do let us know if you find any more.'); $q->h2('Dumped Piano (right)'), $q->p('The reporter of this problem summed it up with their report, which consisted solely of the one character “!”. —', -$q->a({href=>'http://www.fixmystreet.com/?id=9468'}, 'Problem report')), +$q->a({href=>'http://www.fixmystreet.com/report/9468'}, 'Problem report')), ), $q->li( $q->h2('Mad Seagull'), $q->p('“A seagull is attacking various cars within this road. He starts at around 05:45 every morning and continues until around 19:30. This causes a lot of noisy banging and wakes up children.” —', -$q->a({href=>'http://www.fixmystreet.com/?id=2722'}, 'Problem report')), +$q->a({href=>'http://www.fixmystreet.com/report/2722'}, 'Problem report')), ), $q->li( $q->img({src=>'http://www.fixmystreet.com/photo?id=6553', align=>'right', hspace=>8}), $q->h2('Boxes full of cheese dumped (right)'), $q->p('“About a dozen boxes full of mozzarella cheese have been dumped opposite 3 rufford street. if it warms up we could have nasty road topping problem (seriously there is a lot of cheese)” —', -$q->a({href=>'http://www.fixmystreet.com/?id=6553'}, 'Problem report')), +$q->a({href=>'http://www.fixmystreet.com/report/6553'}, 'Problem report')), ), $q->li( $q->h2('Dangerous Nivea Billboard'), $q->p('“The Nivea \'Oxygen is a wonderful thing\' billboard here has a device on it releasing bubbles and foam. This is blowing into the road which is both distracting and dangerous to drivers. A large ball of foam hit my windscreen unexpectedly and nearly caused me to have an accident” —', -$q->a({href=>'http://www.fixmystreet.com/?id=7552'}, 'Problem report')), +$q->a({href=>'http://www.fixmystreet.com/report/7552'}, 'Problem report')), ), ); return $out; diff --git a/web/index.cgi b/web/index.cgi index ef515aae9..608eae07e 100755 --- a/web/index.cgi +++ b/web/index.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2006 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: index.cgi,v 1.209 2008-09-18 11:11:07 matthew Exp $ +# $Id: index.cgi,v 1.210 2008-09-19 10:24:55 matthew Exp $ use strict; use Standard; @@ -146,7 +146,7 @@ EOF my $probs = Problems::recent(); $out .= $q->h2(_('Recently reported problems')) . ' <ul>' if @$probs; foreach (@$probs) { - $out .= '<li><a href="/?id=' . $_->{id} . '">'. ent($_->{title}); + $out .= '<li><a href="/report/' . $_->{id} . '">'. ent($_->{title}); $out .= '</a>'; } $out .= '</ul>' if @$probs; @@ -337,7 +337,7 @@ sub submit_problem { $input{phone}, $input{council}, $input{anonymous} ? 'f' : 't', $input{category}, $id); dbh()->commit(); - $out = $q->p(sprintf(_('You have successfully confirmed your report and you can now <a href="%s">view it on the site</a>.'), "/?id=$id")); + $out = $q->p(sprintf(_('You have successfully confirmed your report and you can now <a href="%s">view it on the site</a>.'), "/report/$id")); } else { $out = $q->p(_('There appears to have been a problem.')); } @@ -691,7 +691,7 @@ EOF if (@errors) { $out .= '<ul id="error"><li>' . join('</li><li>', @errors) . '</li></ul>'; } - my $skipurl = NewURL($q, 'submit_map'=>1, skipped=>1); + my $skipurl = NewURL($q, -retain=>1, 'submit_map'=>1, skipped=>1); $out .= $q->p({-id=>'text_map'}, _('To report a problem, simply <strong>click on the map</strong> at the correct location.')); $out .= $q->p({-id=>'text_no_map'}, sprintf(_("<small>If you cannot see a map – if you have images turned off, or are using a text only browser, for example – and you @@ -701,7 +701,7 @@ to describe the location of the problem instead.</small>"), $skipurl)); $out .= '<div id="nearby_lists">' . $q->h2(_('Reports on and around the map')); my $list = ''; foreach (@$on_map) { - $list .= '<li><a href="' . NewURL($q, id=>$_->{id}, x=>undef, y=>undef) . '">'; + $list .= '<li><a href="/report/' . $_->{id} . '">'; $list .= $_->{title}; $list .= '</a>'; $list .= ' <small>(fixed)</small>' if $_->{state} eq 'fixed'; @@ -715,7 +715,7 @@ to describe the location of the problem instead.</small>"), $skipurl)); $out .= $q->h2({-id => 'closest_problems'}, sprintf(_('Other nearby problems <small>within %skm</small>'), $dist)); $list = ''; foreach (@$around_map) { - $list .= '<li><a href="' . NewURL($q, id=>$_->{id}, x=>undef, y=>undef) . '">'; + $list .= '<li><a href="/report/' . $_->{id} . '">'; $list .= $_->{title} . ' <small>(' . int($_->{distance}/100+.5)/10 . 'km)</small>'; $list .= '</a>'; $list .= ' <small>(fixed)</small>' if $_->{state} eq 'fixed'; @@ -731,7 +731,7 @@ to describe the location of the problem instead.</small>"), $skipurl)); #$out .= $q->h2(sprintf(_('Recently fixed problems within %skm'), $dist)); #$list = ''; #foreach (@$fixed) { - # $list .= '<li><a href="' . NewURL($q, id=>$_->{id}, x=>undef, y=>undef) . '">'; + # $list .= '<li><a href="' . NewURL($q, -retain=>1, id=>$_->{id}, x=>undef, y=>undef) . '">'; # $list .= $_->{title} . ' <small>(' . int($_->{distance}/100+.5)/10 . 'km)</small>'; # $list .= '</a></li>'; #} @@ -753,7 +753,7 @@ to describe the location of the problem instead.</small>"), $skipurl)); sub display_problem { my ($q, @errors) = @_; - my @vars = qw(id name email update fixed upload_fileid x y); + my @vars = qw(id name email update fixed add_alert upload_fileid x y submit_update); my %input = map { $_ => $q->param($_) || '' } @vars; my %input_h = map { $_ => $q->param($_) ? ent($q->param($_)) : '' } @vars; $input{x} ||= 0; $input{x} += 0; @@ -762,7 +762,15 @@ sub display_problem { # Some council with bad email software if ($input{id} =~ /^3D\d+$/) { $input{id} =~ s/^3D//; - print $q->redirect(-location => 'http://www.fixmystreet.com/?id=' . $input{id}, -status => 301); + my $base = mySociety::Config::get('BASE_URL'); + print $q->redirect(-location => $base . '/report/' . $input{id}, -status => 301); + return ''; + } + + # Redirect old /?id=NNN URLs to /report/NNN + if (!@errors && $q->url(-absolute=>1) eq '/') { + my $base = mySociety::Config::get('BASE_URL'); + print $q->redirect(-location => $base . '/report/' . $input{id}, -status => 301); return ''; } @@ -773,6 +781,16 @@ sub display_problem { return front_page($q, 'That problem has been hidden from public view as it contained inappropriate public details') if $problem->{state} eq 'hidden'; my ($x, $y, $x_tile, $y_tile, $px, $py) = Page::os_to_px_with_adjust($q, $problem->{easting}, $problem->{northing}, $input{x}, $input{y}); + # Try and have pin near centre of map + if (!$input{x} && $x - $x_tile < 0.5) { + $x_tile -= 1; + $px = Page::os_to_px($problem->{easting}, $x_tile); + } + if (!$input{y} && $y - $y_tile < 0.5) { + $y_tile -= 1; + $py = Page::os_to_px($problem->{northing}, $y_tile, 1); + } + my $out = ''; my $pins = Page::display_pin($q, $px, $py, 'blue'); @@ -790,10 +808,7 @@ sub display_problem { $q->small($q->a({href => '/contact?id=' . $input{id}}, 'Offensive? Unsuitable? Tell us')) ); - # Try and have pin near centre of map - $x_tile -= 1 if $x - $x_tile < 0.5; - $y_tile -= 1 if $y - $y_tile < 0.5; - my $back = NewURL($q, id=>undef, x=>$x_tile, y=>$y_tile, submit_update=>undef); + my $back = NewURL($q, -url=>'/', x=>$x_tile, y=>$y_tile); $out .= '<p style="padding-bottom: 0.5em; border-bottom: dotted 1px #999999;" align="right"><a href="' . $back . '">' . _('More problems nearby') . '</a></p>'; $out .= '<div id="alert_links">'; @@ -821,6 +836,7 @@ EOF } my $fixed = ($input{fixed}) ? ' checked' : ''; + my $add_alert_checked = ($input{add_alert} || !$input{submit_update}) ? ' checked' : ''; my $fixedline = $problem->{state} eq 'fixed' ? '' : qq{ <div class="checkbox"><input type="checkbox" name="fixed" id="form_fixed" value="1"$fixed> <label for="form_fixed">} . _('This problem has been fixed') . qq{</label></div> @@ -846,7 +862,7 @@ $fixedline <label for="form_photo">Photo:</label> <input type="file" name="photo" id="form_photo"> </div> -<div class="checkbox"><input type="checkbox" name="add_alert" id="form_add_alert" value="1"> +<div class="checkbox"><input type="checkbox" name="add_alert" id="form_add_alert" value="1"$add_alert_checked> <label for="form_add_alert">Alert me to future updates</label></div> <div class="checkbox"><input type="submit" id="update_post" value="Post"></div> </form> @@ -26,7 +26,7 @@ function compass_pan(e, a) { YAHOO.util.Event.onContentReady('compass', function() { var ua=navigator.userAgent.toLowerCase(); - if (document.getElementById('mapForm') && (/safari/.test(ua) || /Konqueror/.test(ua))) return; + // if (document.getElementById('mapForm') && (/safari/.test(ua) || /Konqueror/.test(ua))) return; if (document.getElementById('map').offsetWidth > 510) return; var points = this.getElementsByTagName('a'); @@ -43,7 +43,7 @@ YAHOO.util.Event.onContentReady('compass', function() { YAHOO.util.Event.onContentReady('map', function() { var ua=navigator.userAgent.toLowerCase(); - if (document.getElementById('mapForm') && (/safari/.test(ua) || /Konqueror/.test(ua))) return; + // if (document.getElementById('mapForm') && (/safari/.test(ua) || /Konqueror/.test(ua))) return; if (document.getElementById('map').offsetWidth > 510) return; new YAHOO.util.DDMap('map'); diff --git a/web/questionnaire.cgi b/web/questionnaire.cgi index 3b36216b8..aa79f1313 100755 --- a/web/questionnaire.cgi +++ b/web/questionnaire.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: questionnaire.cgi,v 1.30 2008-05-06 10:01:31 matthew Exp $ +# $Id: questionnaire.cgi,v 1.31 2008-09-19 10:24:55 matthew Exp $ use strict; use Standard; @@ -40,7 +40,7 @@ sub check_stuff { my $questionnaire = dbh()->selectrow_hashref( 'select id, problem_id, whenanswered from questionnaire where id=?', {}, $id); my $problem_id = $questionnaire->{problem_id}; - throw Error::Simple("You have already answered this questionnaire. If you have a question, please <a href=/contact>get in touch</a>, or <a href=/?id=$problem_id>view your problem</a>.\n") if $questionnaire->{whenanswered}; + throw Error::Simple("You have already answered this questionnaire. If you have a question, please <a href=/contact>get in touch</a>, or <a href=/report/$problem_id>view your problem</a>.\n") if $questionnaire->{whenanswered}; my $prev_questionnaire = dbh()->selectrow_hashref( 'select id from questionnaire where problem_id=? and whenanswered is not null', {}, $problem_id); diff --git a/web/reports.cgi b/web/reports.cgi index 503b85677..7a526c1e9 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.19 2008-07-09 12:02:38 matthew Exp $ +# $Id: reports.cgi,v 1.20 2008-09-19 10:24:55 matthew Exp $ use strict; use Standard; @@ -205,8 +205,8 @@ sub main { $q->a({ href => $rss_url }, '<img align="right" src="/i/feed.png" width="16" height="16" title="' . $rss_title . '" alt="' . sprintf($rss_alt, $thing) . '" border="0" hspace="4">'), 'This is a summary of all reports for one ' . $thing . '. You can ' . ($all ? - $q->a({href => NewURL($q, council=>undef, ward=>undef, all=>undef) }, 'see less detail') : - $q->a({href => NewURL($q, council=>undef, ward=>undef, all=>1) }, 'see more details')) . + $q->a({href => NewURL($q) }, 'see less detail') : + $q->a({href => NewURL($q, all=>1) }, 'see more details')) . ($q->{site} eq 'scambs' ? '' : ' or go back and ' . $q->a({href => '/reports' }, 'show all councils') ) . @@ -264,7 +264,7 @@ sub list_problems { return unless $problems; print "<h3>$title</h3>\n<ul>"; foreach (@$problems) { - print '<li><a href="/?id=' . $_->[0] . '">'; + print '<li><a href="/report/' . $_->[0] . '">'; print ent($_->[1]); print '</a>'; print ' <small>(sent to both)</small>' if $_->[3]>1; diff --git a/web/rss.cgi b/web/rss.cgi index 39c2c89cb..3cdbb0355 100755 --- a/web/rss.cgi +++ b/web/rss.cgi @@ -6,7 +6,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: matthew@mysociety.org. WWW: http://www.mysociety.org # -# $Id: rss.cgi,v 1.22 2008-09-01 17:17:58 matthew Exp $ +# $Id: rss.cgi,v 1.23 2008-09-19 10:24:55 matthew Exp $ use strict; use Standard; @@ -24,7 +24,7 @@ sub main { $out = rss_local_problems($q); } elsif ($type eq 'new_updates') { my $id = $q->param('id'); - my $qs = '?id='.$id; + my $qs = 'report/' . $id; $out = mySociety::Alert::generate_rss($type, $qs, [$id]); } elsif ($type eq 'new_problems' || $type eq 'new_fixed_problems') { $out = mySociety::Alert::generate_rss($type, ''); |