diff options
Diffstat (limited to 'perllib/FixMyStreet/App')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin.pm | 18 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Open311.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Report/New.pm | 12 |
3 files changed, 16 insertions, 16 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm index fcbde1bd9..8c37f0f2e 100644 --- a/perllib/FixMyStreet/App/Controller/Admin.pm +++ b/perllib/FixMyStreet/App/Controller/Admin.pm @@ -233,15 +233,15 @@ sub council_list : Path('council_list') : Args(0) { my $contacts = $c->model('DB::Contact')->search( undef, { - select => [ 'area_id', { count => 'id' }, { count => \'case when deleted then 1 else null end' }, + select => [ 'body_id', { count => 'id' }, { count => \'case when deleted then 1 else null end' }, { count => \'case when confirmed then 1 else null end' } ], - as => [qw/area_id c deleted confirmed/], - group_by => [ 'area_id' ], + as => [qw/body_id c deleted confirmed/], + group_by => [ 'body_id' ], result_class => 'DBIx::Class::ResultClass::HashRefInflator' } ); - my %council_info = map { $_->{area_id} => $_ } $contacts->all; + my %council_info = map { $_->{body_id} => $_ } $contacts->all; my @no_info = grep { !$council_info{$_} } @councils_ids; my @one_plus_deleted = grep { $council_info{$_} && $council_info{$_}->{deleted} } @councils_ids; @@ -294,7 +294,7 @@ sub update_contacts : Private { my $contact = $c->model('DB::Contact')->find_or_new( { - area_id => $c->stash->{area_id}, + body_id => $c->stash->{area_id}, category => $category, } ); @@ -328,7 +328,7 @@ sub update_contacts : Private { my $contacts = $c->model('DB::Contact')->search( { - area_id => $c->stash->{area_id}, + body_id => $c->stash->{area_id}, category => { -in => \@categories }, } ); @@ -390,7 +390,7 @@ sub display_contacts : Private { my $area_id = $c->stash->{area_id}; my $contacts = $c->model('DB::Contact')->search( - { area_id => $area_id }, + { body_id => $area_id }, { order_by => ['category'] } ); @@ -450,7 +450,7 @@ sub council_edit : Path('council_edit') : Args(2) { my $contact = $c->model('DB::Contact')->search( { - area_id => $area_id, + body_id => $area_id, category => $category } )->first; @@ -459,7 +459,7 @@ sub council_edit : Path('council_edit') : Args(2) { my $history = $c->model('DB::ContactsHistory')->search( { - area_id => $area_id, + body_id => $area_id, category => $category }, { diff --git a/perllib/FixMyStreet/App/Controller/Open311.pm b/perllib/FixMyStreet/App/Controller/Open311.pm index 040b0d3e6..54faf906a 100644 --- a/perllib/FixMyStreet/App/Controller/Open311.pm +++ b/perllib/FixMyStreet/App/Controller/Open311.pm @@ -168,7 +168,7 @@ sub get_services : Private { "4326/$lon,$lat", type => $area_types); $categories = $categories->search( { - area_id => [ keys %$all_councils ], + body_id => [ keys %$all_councils ], } ); } diff --git a/perllib/FixMyStreet/App/Controller/Report/New.pm b/perllib/FixMyStreet/App/Controller/Report/New.pm index 823b38e02..57cf1de49 100644 --- a/perllib/FixMyStreet/App/Controller/Report/New.pm +++ b/perllib/FixMyStreet/App/Controller/Report/New.pm @@ -584,7 +584,7 @@ sub setup_categories_and_councils : Private { = $c # ->model('DB::Contact') # ->not_deleted # - ->search( { area_id => [ keys %$all_councils ] } ) # + ->search( { body_id => [ keys %$all_councils ] } ) # ->all; # variables to populate @@ -600,7 +600,7 @@ sub setup_categories_and_councils : Private { # add all areas found to the list foreach (@contacts) { - $area_ids_to_list{ $_->area_id } = 1; + $area_ids_to_list{ $_->body_id } = 1; } # set our own categories @@ -638,7 +638,7 @@ sub setup_categories_and_councils : Private { my %seen; foreach my $contact (@contacts) { - $area_ids_to_list{ $contact->area_id } = 1; + $area_ids_to_list{ $contact->body_id } = 1; unless ( $seen{$contact->category} ) { push @category_options, $contact->category; @@ -839,7 +839,7 @@ sub process_report : Private { ->not_deleted # ->search( { - area_id => [ keys %$councils ], + body_id => [ keys %$councils ], category => $report->category } )->all; @@ -853,7 +853,7 @@ sub process_report : Private { # construct the council string: # 'x,x' - x are council IDs that have this category # 'x,x|y,y' - x are council IDs that have this category, y council IDs with *no* contact - my $council_string = join( ',', map { $_->area_id } @contacts ); + my $council_string = join( ',', map { $_->body_id } @contacts ); $council_string .= '|' . join( ',', @{ $c->stash->{missing_details_councils} } ) if $council_string && @{ $c->stash->{missing_details_councils} }; @@ -879,7 +879,7 @@ sub process_report : Private { $report->non_public( 1 ); } - $c->cobrand->process_extras( $c, $contacts[0]->area_id, \@extra ); + $c->cobrand->process_extras( $c, $contacts[0]->body_id, \@extra ); if ( @extra ) { $c->stash->{report_meta} = { map { $_->{name} => $_ } @extra }; |