aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand
diff options
context:
space:
mode:
authorJon Kristensen <info@jonkri.com>2014-05-15 17:41:07 +0200
committerJon Kristensen <info@jonkri.com>2014-05-15 17:41:07 +0200
commitd6ab834a8e1fb67800785eb781e4f9ecc2e39a5c (patch)
tree57330eaed413dd8a200e2d49b1deb91b69dad79f /perllib/FixMyStreet/Cobrand
parent87b7c87e1cf83ba043a0254008248595363906c1 (diff)
parent966a1a754d7f4f055944212c5523798a7795402f (diff)
Merge branch 'master' of git://github.com/mysociety/fixmystreet into jonkri-master
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm8
-rw-r--r--perllib/FixMyStreet/Cobrand/FixMyStreet.pm18
2 files changed, 26 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index d2af4949e..c8bae90e6 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -854,6 +854,14 @@ sub prettify_dt {
return Utils::prettify_dt( $dt, 1 );
}
+=head2 extra_contact_validation
+
+Perform any extra validation on the contact form.
+
+=cut
+
+sub extra_contact_validation { (); }
+
sub problem_as_hashref {
my $self = shift;
my $problem = shift;
diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
index c3a1f9d9d..ce62e206e 100644
--- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
+++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
@@ -21,5 +21,23 @@ sub title_list {
return undef;
}
+sub extra_contact_validation {
+ my $self = shift;
+ my $c = shift;
+
+ my %errors;
+
+ $c->stash->{dest} = $c->req->param('dest');
+
+ $errors{dest} = "Please enter who your message is for"
+ unless $c->req->param('dest');
+
+ if ( $c->req->param('dest') eq 'council' || $c->req->param('dest') eq 'update' ) {
+ $errors{not_for_us} = 1;
+ }
+
+ return %errors;
+}
+
1;