aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/Default.pm
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-05-01 15:42:01 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-05-07 10:54:25 +0100
commitf6d807fd5217a19ac488f652d1f0853a7891231f (patch)
tree2e8fc2f6496a1253339c9609008d09563877e614 /perllib/FixMyStreet/Cobrand/Default.pm
parentab0d1dc84b1ed7a1c572e986eda3a4bdc5157d77 (diff)
Add way to disallow report reopening in a category
Add a tickbox to the category admin, and do not allow reopening on reports made in the selected categories.
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/Default.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/Default.pm17
1 files changed, 16 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Default.pm b/perllib/FixMyStreet/Cobrand/Default.pm
index 07e781479..df7e333fb 100644
--- a/perllib/FixMyStreet/Cobrand/Default.pm
+++ b/perllib/FixMyStreet/Cobrand/Default.pm
@@ -523,7 +523,8 @@ sub allow_update_reporting { return 0; }
=item updates_disallowed
Returns a boolean indicating whether updates on a particular report are allowed
-or not. Default behaviour is disallowed if "closed_updates" metadata is set.
+or not. Default behaviour is disallowed if "closed_updates" metadata is set, or
+if the report's category has its "updates_disallowed" flag set.
=cut
@@ -534,6 +535,20 @@ sub updates_disallowed {
return 0;
}
+=item reopening_disallowed
+
+Returns a boolean indicating whether reopening of a particular report is
+allowed or not. Default behaviour is allowed unless the report's category
+has its reopening_disallowed flag set.
+
+=cut
+
+sub reopening_disallowed {
+ my ($self, $problem) = @_;
+ return 1 if $problem->contact && $problem->contact->get_extra_metadata('reopening_disallowed');
+ return 0;
+}
+
=item geocode_postcode
Given a QUERY, return LAT/LON and/or ERROR.