diff options
author | Struan Donald <struan@exo.org.uk> | 2012-04-02 17:38:21 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-04-02 17:38:21 +0100 |
commit | d3e033d5426144dcc7bf0da3170fbf2361d22ba6 (patch) | |
tree | 7b380a3e57c4e2403f5a191783bc04de2880bf39 /perllib/FixMyStreet/Cobrand/FixMyStreet.pm | |
parent | ac69b1dda48806c806ce96e399e06fc5557072c8 (diff) |
move special field processing out to cobrands
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/FixMyStreet.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FixMyStreet.pm | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm index 97b4c3c8b..c971a5a82 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm @@ -32,5 +32,31 @@ sub generate_problem_banner { return $banner; } +sub process_extras { + my $self = shift; + my $ctx = shift; + my $contacts = shift; + my $extra = shift; + + if ( $contacts->[0]->area_id == 2482 ) { + for my $field ( qw/ fms_extra_title / ) { + my $value = $ctx->request->param( $field ); + + if ( !$value ) { + $ctx->stash->{field_errors}->{ $field } = _('This information is required'); + } + push @$extra, { + name => $field, + description => uc( $field), + value => $value || '', + }; + } + + if ( $ctx->request->param('fms_extra_title') ) { + $ctx->stash->{fms_extra_title} = $ctx->request->param('fms_extra_title'); + $ctx->stash->{extra_name_info} = 1; + } + } +} 1; |