aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2017-09-13 09:52:12 +0100
committerStruan Donald <struan@exo.org.uk>2017-09-13 09:52:12 +0100
commita181c520986498ab5a898ad3c21c04affa215378 (patch)
tree9630a7b97fd57081f9175741cdeeeb8046d39d32 /perllib
parent81744445eedc8686827cfc119b51ae8ec704a963 (diff)
parente2225f14211e061330223b9f752b7924610bc0f9 (diff)
Merge branch 'issues/forcouncils/224-default-priority'
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin/ResponsePriorities.pm1
-rw-r--r--perllib/FixMyStreet/App/Controller/Report.pm6
-rw-r--r--perllib/FixMyStreet/DB/Result/ResponsePriority.pm6
3 files changed, 11 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin/ResponsePriorities.pm b/perllib/FixMyStreet/App/Controller/Admin/ResponsePriorities.pm
index 7983a6e4d..2613f6ae0 100644
--- a/perllib/FixMyStreet/App/Controller/Admin/ResponsePriorities.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin/ResponsePriorities.pm
@@ -65,6 +65,7 @@ sub edit : Path : Args(2) {
$priority->name( $c->get_param('name') );
$priority->description( $c->get_param('description') );
$priority->external_id( $c->get_param('external_id') );
+ $priority->is_default( $c->get_param('is_default') ? 1 : 0 );
$priority->update_or_insert;
my @live_contact_ids = map { $_->id } @live_contacts;
diff --git a/perllib/FixMyStreet/App/Controller/Report.pm b/perllib/FixMyStreet/App/Controller/Report.pm
index 60d373a16..e37e08698 100644
--- a/perllib/FixMyStreet/App/Controller/Report.pm
+++ b/perllib/FixMyStreet/App/Controller/Report.pm
@@ -320,6 +320,12 @@ sub inspect : Private {
$c->stash->{post_inspect_url} = $c->req->referer;
}
+ if ($c->user->has_body_permission_to('report_edit_priority') or
+ $c->user->has_body_permission_to('report_inspect')
+ ) {
+ $c->stash->{has_default_priority} = scalar( grep { $_->is_default } $problem->response_priorities );
+ }
+
if ( $c->get_param('save') ) {
$c->forward('/auth/check_csrf_token');
diff --git a/perllib/FixMyStreet/DB/Result/ResponsePriority.pm b/perllib/FixMyStreet/DB/Result/ResponsePriority.pm
index 44635d174..df54cfa08 100644
--- a/perllib/FixMyStreet/DB/Result/ResponsePriority.pm
+++ b/perllib/FixMyStreet/DB/Result/ResponsePriority.pm
@@ -28,6 +28,8 @@ __PACKAGE__->add_columns(
{ data_type => "text", is_nullable => 1 },
"external_id",
{ data_type => "text", is_nullable => 1 },
+ "is_default",
+ { data_type => "boolean", default_value => \"false", is_nullable => 0 },
);
__PACKAGE__->set_primary_key("id");
__PACKAGE__->add_unique_constraint("response_priorities_body_id_name_key", ["body_id", "name"]);
@@ -51,8 +53,8 @@ __PACKAGE__->has_many(
);
-# Created by DBIx::Class::Schema::Loader v0.07035 @ 2016-12-14 17:12:09
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:glsO0fLK6fNvg4TmW1DMPg
+# Created by DBIx::Class::Schema::Loader v0.07035 @ 2017-09-12 09:32:53
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:JBIHFnaLvXCAUjgwTSB3CQ
__PACKAGE__->many_to_many( contacts => 'contact_response_priorities', 'contact' );