diff options
author | Struan Donald <struan@exo.org.uk> | 2012-03-30 17:45:12 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2012-03-30 17:45:12 +0100 |
commit | d0ad2aa1df43fcdbb853eb2d53c9618084c9ba46 (patch) | |
tree | 93bc9ba185f5ebebc79f2087cb48da1670bf0522 /perllib/FixMyStreet/App/Controller/Report/Update.pm | |
parent | 9e2b71aedd208a2c378ca411388d5f750f0e9fc7 (diff) |
add in first and last name to updates
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/Update.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/Update.pm | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/Update.pm b/perllib/FixMyStreet/App/Controller/Report/Update.pm index 772a0b8ee..114c86c28 100644 --- a/perllib/FixMyStreet/App/Controller/Report/Update.pm +++ b/perllib/FixMyStreet/App/Controller/Report/Update.pm @@ -153,6 +153,15 @@ want to move adding these elsewhere sub process_update : Private { my ( $self, $c ) = @_; + if ( $c->req->param('first_name' ) && $c->req->param('last_name' ) ) { + my $first_name = $c->req->param('first_name'); + my $last_name = $c->req->param('last_name'); + $c->req->param('name', sprintf( '%s %s', $first_name, $last_name ) ); + + $c->stash->{first_name} = $first_name; + $c->stash->{last_name} = $last_name; + } + my %params = map { $_ => scalar $c->req->param($_) } ( 'update', 'name', 'fixed', 'state', 'reopen' ); @@ -190,8 +199,19 @@ sub process_update : Private { $extras{title} = $c->req->param('fms_extra_title'); $extras{email_alerts_required} = $c->req->param('add_alert'); $update->extra( \%extras ); + + $c->stash->{fms_extra_title} = $c->req->param('fms_extra_title'); } + if ( $c->stash->{ first_name } && $c->stash->{ last_name } ) { + my $extra = $update->extra || {}; + $extra->{first_name} = $c->stash->{ first_name }; + $extra->{last_name} = $c->stash->{ last_name }; + $update->extra( $extra ); + } + + $c->log->debug( 'name is ' . $c->req->param('name') ); + $c->stash->{update} = $update; $c->stash->{add_alert} = $c->req->param('add_alert'); |