aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-02-13 15:13:12 +0000
committerMatthew Somerville <matthew@mysociety.org>2017-03-23 12:54:24 +0000
commit3f21a9742d89c3e4fda47a0be6ec2a17f802c99a (patch)
tree3f199f8f6b43aa8818dc3c5349623bb2d4a5e8a3 /perllib/FixMyStreet/Cobrand
parent6fb4eca34fd47612216f642985cac74359727b15 (diff)
Add customisable defect types.
Problems can have an associated defect type, that can be assigned during an inspection. Include an admin interface for managing these types, that can also be assigned on a per-category basis, currently available to the Oxfordshire cobrand. (Also include 'TM' in traffic management Exor RDI output.)
Diffstat (limited to 'perllib/FixMyStreet/Cobrand')
-rw-r--r--perllib/FixMyStreet/Cobrand/Oxfordshire.pm22
1 files changed, 21 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
index d585a5328..78247e39d 100644
--- a/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
+++ b/perllib/FixMyStreet/Cobrand/Oxfordshire.pm
@@ -161,9 +161,13 @@ sub admin_pages {
# 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') ) {
+ if ( $user->has_body_permission_to('report_instruct') ) {
$pages->{exordefects} = [ _('Download Exor RDI'), 10 ];
}
+ if ( $user->has_body_permission_to('defect_type_edit') ) {
+ $pages->{defecttypes} = [ _('Defect Types'), 11 ];
+ $pages->{defecttype_edit} = [ undef, undef ];
+ };
return $pages;
}
@@ -190,4 +194,20 @@ sub user_extra_fields {
sub display_days_ago_threshold { 28 }
+sub defect_type_extra_fields {
+ return [
+ 'activity_code',
+ 'defect_code',
+ ];
+};
+
+sub available_permissions {
+ my $self = shift;
+
+ my $perms = $self->next::method();
+ $perms->{Bodies}->{defect_type_edit} = "Add/edit defect types";
+
+ return $perms;
+}
+
1;