aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report/New.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Report/New.pm20
1 files changed, 18 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm
index 9baee5eb4..ac462e293 100644
--- a/perllib/FixMyStreet/App/Controller/Report/New.pm
+++ b/perllib/FixMyStreet/App/Controller/Report/New.pm
@@ -398,6 +398,13 @@ sub initialize_report : Private {
}
+ if ( $c->req->param('first_name') && $c->req->param('last_name') ) {
+ $c->stash->{first_name} = $c->req->param('first_name');
+ $c->stash->{last_name} = $c->req->param('last_name');
+
+ $c->req->param( 'name', sprintf( '%s %s', $c->req->param('first_name'), $c->req->param('last_name') ) );
+ }
+
# Capture whether the map was used
$report->used_map( $c->req->param('skipped') ? 0 : 1 );
@@ -791,13 +798,22 @@ sub process_report : Private {
}
if ( $contacts[0]->area_id == 2482 ) {
- for my $field ( qw/ fms_extra_title / ) {
+ for my $field ( qw/ fms_extra_title first_name last_name / ) {
+ my $value = $c->request->param( $field );
+ if ( !$value ) {
+ $c->stash->{field_errors}->{ $field } = _('This information is required');
+ }
push @extra, {
name => $field,
description => uc( $field),
- value => $c->request->param( $field ) || '',
+ value => $value || '',
};
}
+
+ if ( $c->request->param('fms_extra_title') ) {
+ $c->stash->{fms_extra_title} = $c->request->param('fms_extra_title');
+ $c->stash->{extra_name_info} = 1;
+ }
}
if ( @extra ) {