aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-rw-r--r--perllib/FixMyStreet/Cobrand/Base.pm12
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm11
-rw-r--r--perllib/FixMyStreet/Cobrand/Oxfordshire.pm35
-rw-r--r--perllib/FixMyStreet/Cobrand/UKCouncils.pm2
4 files changed, 58 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Base.pm b/perllib/FixMyStreet/Cobrand/Base.pm
index a9eed0018..ea2b8f410 100644
--- a/perllib/FixMyStreet/Cobrand/Base.pm
+++ b/perllib/FixMyStreet/Cobrand/Base.pm
@@ -65,6 +65,18 @@ sub is_default {
return $self->moniker eq 'default';
}
+=head2 call_hook
+
+ $cobrand->call_hook(foo => 1, 2, 3); # calls $cobrand->foo(1, 2, 3) if it exists
+
+=cut
+
+sub call_hook {
+ my ($self, $method_name, @args) = @_;
+ my $method = $self->can($method_name) or return;
+ return $self->$method(@args);
+}
+
# NB: this Base class is for 'meta' features. To add base methods for all cobrands,
# you may want to look at FMS::Cobrand::Default instead!
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 1fdbe9de2..63db8b64a 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -665,7 +665,6 @@ sub admin_pages {
$pages->{responsepriorities} = [ _('Priorities'), 4 ];
$pages->{responsepriority_edit} = [ undef, undef ];
};
-
if ( $user->has_body_permission_to('user_edit') ) {
$pages->{users} = [ _('Users'), 6 ];
$pages->{user_edit} = [ undef, undef ];
@@ -1188,6 +1187,16 @@ sub category_extra_hidden {
return 0;
}
+=head2 reputation_increment_states/reputation_decrement_states
+
+Get a hashref of states that cause the reporting user's reputation to be
+incremented/decremented, if a report is changed to this state upon inspection.
+
+=cut
+
+sub reputation_increment_states { {} };
+sub reputation_decrement_states { {} };
+
sub traffic_management_options {
return [
_("Yes"),
diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
index e58c7f36b..7fa548406 100644
--- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
@@ -129,5 +129,40 @@ sub traffic_management_options {
];
}
+sub admin_pages {
+ my $self = shift;
+
+ my $user = $self->{c}->user;
+
+ my $pages = $self->next::method();
+
+ # Oxfordshire have a custom admin page for downloading reports in an Exor-
+ # friendly format which anyone with report_instruct permission can use.
+ if ( $user->is_superuser || $user->has_body_permission_to('report_instruct') ) {
+ $pages->{exordefects} = [ _('Download Exor RDI'), 10 ];
+ }
+
+ return $pages;
+}
+
+sub defect_types {
+ {
+ SFP2 => "SFP2: sweep and fill <1m2",
+ POT2 => "POT2",
+ };
+}
+
+sub exor_rdi_link_id { 1989169 }
+sub exor_rdi_link_length { 50 }
+
+sub reputation_increment_states {
+ return {
+ 'action scheduled' => 1,
+ };
+}
+
+sub user_extra_fields {
+ return [ 'initials' ];
+}
1;
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
index 4e900e653..e0b6b5298 100644
--- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm
+++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm
@@ -76,7 +76,7 @@ sub users_restriction {
my $or_query = [
from_body => $self->council_id,
- id => [ { -in => $problem_user_ids }, { -in => $update_user_ids } ],
+ 'me.id' => [ { -in => $problem_user_ids }, { -in => $update_user_ids } ],
];
if ($self->can('admin_user_domain')) {
my $domain = $self->admin_user_domain;