aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/Cobrand.pm22
-rwxr-xr-xweb/questionnaire.cgi7
2 files changed, 26 insertions, 3 deletions
diff --git a/perllib/Cobrand.pm b/perllib/Cobrand.pm
index 410fec969..d225fdb8e 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.48 2009-12-08 11:13:30 louise Exp $
+# $Id: Cobrand.pm,v 1.49 2009-12-08 17:43:13 louise Exp $
package Cobrand;
use strict;
@@ -785,6 +785,26 @@ sub all_councils_report {
}
}
+=item ask_ever_reported
+
+Return a boolean indicating whether people should be asked whether this
+is the first time they've reported a problem.
+
+=cut
+
+sub ask_ever_reported {
+ my ($cobrand) = @_;
+ my $handle;
+ if ($cobrand){
+ $handle = cobrand_handle($cobrand);
+ }
+ if ( !$cobrand || !$handle || !$handle->can('ask_ever_reported')){
+ return 1;
+ } else{
+ return $handle->ask_ever_reported();
+ }
+}
+
=item admin_pages COBRAND
List of names of pages to display on the admin interface
diff --git a/web/questionnaire.cgi b/web/questionnaire.cgi
index 19457570d..60a4be188 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.52 2009-12-07 15:35:06 louise Exp $
+# $Id: questionnaire.cgi,v 1.53 2009-12-08 17:43:13 louise Exp $
use strict;
use Standard;
@@ -87,7 +87,10 @@ sub submit_questionnaire {
my @errors;
push @errors, _('Please state whether or not the problem has been fixed') unless $input{been_fixed};
- push @errors, _('Please say whether you\'ve ever reported a problem to your council before') unless $input{reported} || $answered_ever_reported;
+ my $ask_ever_reported = Cobrand::ask_ever_reported($cobrand);
+ if ($ask_ever_reported) {
+ push @errors, _('Please say whether you\'ve ever reported a problem to your council before') unless $input{reported} || $answered_ever_reported;
+ }
push @errors, _('Please indicate whether you\'d like to receive another questionnaire')
if ($input{been_fixed} eq 'No' || $input{been_fixed} eq 'Unknown') && !$input{another};
push @errors, _('Please provide some explanation as to why you\'re reopening this report')