aboutsummaryrefslogtreecommitdiffstats
path: root/perllib
diff options
context:
space:
mode:
Diffstat (limited to 'perllib')
-rw-r--r--perllib/FixMyStreet/Cobrand/TfL.pm10
-rw-r--r--perllib/FixMyStreet/Script/Inactive.pm1
2 files changed, 11 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/TfL.pm b/perllib/FixMyStreet/Cobrand/TfL.pm
index eedbc41b5..cc4b4f345 100644
--- a/perllib/FixMyStreet/Cobrand/TfL.pm
+++ b/perllib/FixMyStreet/Cobrand/TfL.pm
@@ -127,6 +127,16 @@ sub problems_sql_restriction {
return $q;
}
+sub inactive_reports_filter {
+ my ($self, $time, $rs) = @_;
+ if ($time < 7*12) {
+ $rs = $rs->search({ extra => { like => '%safety_critical,T5:value,T2:no%' } });
+ } else {
+ $rs = $rs->search({ extra => { like => '%safety_critical,T5:value,T3:yes%' } });
+ }
+ return $rs;
+}
+
sub password_expiry {
return if FixMyStreet->test_mode;
# uncoverable statement
diff --git a/perllib/FixMyStreet/Script/Inactive.pm b/perllib/FixMyStreet/Script/Inactive.pm
index 54cbaa7ad..e09417648 100644
--- a/perllib/FixMyStreet/Script/Inactive.pm
+++ b/perllib/FixMyStreet/Script/Inactive.pm
@@ -95,6 +95,7 @@ sub _relevant_reports {
});
if ($self->cobrand) {
$problems = $problems->search({ cobrand => $self->cobrand->moniker });
+ $problems = $self->cobrand->call_hook(inactive_reports_filter => $time, $problems) || $problems;
}
return $problems;
}