diff options
author | Dave Arter <davea@mysociety.org> | 2017-07-24 09:59:06 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2017-08-17 13:21:31 +0100 |
commit | fb03c300258b5d1dc419d7d08ecb3afa12a2fa5b (patch) | |
tree | c110c92155be4cfeadd91d1d663df0684c341929 /perllib/FixMyStreet/Cobrand/Default.pm | |
parent | 653d8b84d6a14f1759950e774b9b1a8bbba5f1b1 (diff) |
Add site-wide extra fields for reports, and admin UI to manage
- Also provides an editor for the extra Open311 fields on contacts.
- Adds .btn--small class for small buttons
Fixes #1743.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Default.pm')
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Default.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm index 852f380f0..5dcdc9a4b 100644 --- a/perllib/FixMyStreet/Cobrand/Default.pm +++ b/perllib/FixMyStreet/Cobrand/Default.pm @@ -668,6 +668,10 @@ sub admin_pages { $pages->{users} = [ _('Users'), 6 ]; $pages->{user_edit} = [ undef, undef ]; } + if ( $self->allow_report_extra_fields && $user->has_body_permission_to('category_edit') ) { + $pages->{reportextrafields} = [ _('Extra Fields'), 10 ]; + $pages->{reportextrafields_edit} = [ undef, undef ]; + } return $pages; } @@ -1221,5 +1225,16 @@ the 'n days ago' format is used. By default the absolute date is always used. =cut sub display_days_ago_threshold { 0 } +=head2 allow_report_extra_fields + +Used to control whether site-wide extra fields are available. If true, +users with the category_edit permission can add site-wide fields via the +admin. + +=cut + +sub allow_report_extra_fields { 0 } + + 1; |