From 4eede46db49e74581f39e33bcd5e11b8638eaa9b Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Mon, 27 Jun 2016 18:10:33 +0100 Subject: Remove bit of unused/needed code. --- perllib/FixMyStreet/App/Controller/Report/New.pm | 27 +++--------------------- 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'perllib/FixMyStreet/App/Controller/Report/New.pm') diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 5e6921ed9..71dbae83a 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -777,8 +777,7 @@ sub process_report : Private { map { $_ => $c->get_param($_) } ( 'title', 'detail', 'pc', # - 'detail_size', 'detail_depth', - 'detail_offensive', + 'detail_size', 'may_show_name', # 'category', # 'subcategory', # @@ -802,9 +801,8 @@ sub process_report : Private { $report->title( Utils::cleanup_text( $params{title} ) ); my $detail = Utils::cleanup_text( $params{detail}, { allow_multiline => 1 } ); - for my $w ('depth', 'size', 'offensive') { + for my $w ('size') { next unless $params{"detail_$w"}; - next if $params{"detail_$w"} eq '-- Please select --'; $detail .= "\n\n\u$w: " . $params{"detail_$w"}; } $report->detail( $detail ); @@ -814,32 +812,13 @@ sub process_report : Private { # set these straight from the params $report->category( _ $params{category} ) if $params{category}; - $report->subcategory( $params{subcategory} ); my $areas = $c->stash->{all_areas_mapit}; $report->areas( ',' . join( ',', sort keys %$areas ) . ',' ); - # From earlier in the process. - $areas = $c->stash->{all_areas}; - my $bodies = $c->stash->{bodies}; - my $first_area = ( values %$areas )[0]; - my $first_body = ( values %$bodies )[0]; - if ( $report->category ) { - - # FIXME All contacts were fetched in setup_categories_and_bodies, - # so can this DB call also be avoided? - my @contacts = $c-> # - model('DB::Contact') # - ->not_deleted # - ->search( - { - body_id => [ keys %$bodies ], - category => $report->category - } - )->all; - + my @contacts = grep { $_->category eq $report->category } @{$c->stash->{contacts}}; unless ( @contacts ) { $c->stash->{field_errors}->{category} = _('Please choose a category'); $report->bodies_str( -1 ); -- cgit v1.2.3