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/Bromley.pm | |
parent | ac69b1dda48806c806ce96e399e06fc5557072c8 (diff) |
move special field processing out to cobrands
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Bromley.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bromley.pm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm index 75174b638..90661c0c3 100644 --- a/perllib/FixMyStreet/Cobrand/Bromley.pm +++ b/perllib/FixMyStreet/Cobrand/Bromley.pm @@ -31,5 +31,33 @@ sub example_places { return ( 'BR1 3UH', 'Glebe Rd, Bromley' ); } +sub process_extras { + my $self = shift; + my $ctx = shift; + my $contacts = shift; + my $extra = shift; + + for my $field (qw/ fms_extra_title first_name last_name /) { + 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; |