diff options
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/IsleOfWight.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/IsleOfWight.pm | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/perllib/FixMyStreet/Cobrand/IsleOfWight.pm b/perllib/FixMyStreet/Cobrand/IsleOfWight.pm index db0a20b9c..72555b9e6 100644 --- a/perllib/FixMyStreet/Cobrand/IsleOfWight.pm +++ b/perllib/FixMyStreet/Cobrand/IsleOfWight.pm @@ -6,6 +6,7 @@ use warnings; use Moo; with 'FixMyStreet::Roles::ConfirmOpen311'; +with 'FixMyStreet::Roles::ConfirmValidation'; sub council_area_id { 2636 } sub council_area { 'Isle of Wight' } @@ -63,20 +64,18 @@ sub lookup_site_code_config { { accept_feature => sub { 1 } } } -sub open311_pre_send { - my ($self, $row, $open311) = @_; - - return unless $row->extra; - my $extra = $row->get_extra_fields; - if (@$extra) { - @$extra = grep { $_->{name} ne 'urgent' } @$extra; - $row->set_extra_fields(@$extra); - } -} +sub open311_extra_data_exclude { [ '^urgent$' ] } # Make sure fetched report description isn't shown. sub filter_report_description { "" } +around 'open311_config' => sub { + my ($orig, $self, $row, $h, $params) = @_; + + $params->{upload_files} = 1; + $self->$orig($row, $h, $params); +}; + sub open311_munge_update_params { my ($self, $params, $comment, $body) = @_; @@ -130,19 +129,18 @@ sub munge_around_category_where { my $b = $self->{c}->model('DB::Body')->for_areas( $self->council_area_id )->first; if ( $user && ( $user->is_superuser || $user->belongs_to_body( $b->id ) ) ) { $where->{send_method} = [ { '!=' => 'Triage' }, undef ]; - return $where; + return; } $where->{'send_method'} = 'Triage'; - return $where; } sub munge_load_and_group_problems { my ($self, $where, $filter) = @_; - return unless $where->{category}; + return unless $where->{'me.category'}; - $where->{category} = $self->_expand_triage_cat_list($where->{category}); + $where->{'me.category'} = $self->_expand_triage_cat_list($where->{'me.category'}); } sub munge_around_filter_category_list { @@ -176,10 +174,7 @@ sub expand_triage_cat_list { my %group_to_category; while ( my $cat = $all_cats->next ) { - next unless $cat->get_extra_metadata('group'); - my $groups = $cat->get_extra_metadata('group'); - $groups = ref $groups eq 'ARRAY' ? $groups : [ $groups ]; - for my $group ( @$groups ) { + for my $group ( @{$cat->groups} ) { $group_to_category{$group} //= []; push @{ $group_to_category{$group} }, $cat->category; } |