Skip to content

Commit

Permalink
[NottsPolice] Restrict to cobrand problems only.
Browse files Browse the repository at this point in the history
  • Loading branch information
neprune committed Jun 3, 2024
1 parent 2ced943 commit 0db86df
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions perllib/FixMyStreet/Cobrand/NottinghamshirePolice.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,41 @@ sub privacy_policy_url {

sub admin_user_domain { 'notts.police.uk' }

=item problems_restriction
Only shows reports made on it, not those from FMS.com or others.
=cut

sub problems_restriction {
my ($self, $rs) = @_;

my $table = ref $rs eq 'FixMyStreet::DB::ResultSet::Nearby' ? 'problem' : 'me';
return $rs->search({
"$table.cobrand" => "nottinghamshirepolice"
});
}

sub problems_sql_restriction {
my ($self, $item_table) = @_;

return "AND cobrand = 'nottinghamshirepolice'";
}

=item problems_on_map_restriction
Same restriction on map as problems_restriction above.
=cut

sub problems_on_map_restriction {
my ($self, $rs) = @_;
$self->problems_restriction($rs);
}

sub updates_restriction {
my ($self, $rs) = @_;
return $rs->search({ 'problem.cobrand' => 'nottinghamshirepolice' }, { join => 'problem' });
}

1;

0 comments on commit 0db86df

Please sign in to comment.