aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-04-03 10:37:39 +0100
committerStruan Donald <struan@exo.org.uk>2012-04-03 10:37:39 +0100
commit592924059a07a5a30e8a09dfc4ca8dea56c5c77a (patch)
treec99e86d3e3f780427bbf7a9ec0ae5187b697dfa5 /perllib/FixMyStreet/Cobrand/FixMyStreet.pm
parent65066d275557e16448aa99ecdfa4df62d4d79649 (diff)
parentd92bbef188eff6c14adf0f0c7b032846b1be85a6 (diff)
Merge remote-tracking branch 'origin/master' into send-report-rewrite
Conflicts: bin/send-reports perllib/FixMyStreet/Cobrand/Default.pm perllib/FixMyStreet/Cobrand/FixMyStreet.pm
Diffstat (limited to 'perllib/FixMyStreet/Cobrand/FixMyStreet.pm')
-rw-r--r--perllib/FixMyStreet/Cobrand/FixMyStreet.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
index 9958e6215..80d57400d 100644
--- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
+++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm
@@ -19,5 +19,31 @@ sub get_council_sender {
return 'Email';
}
+sub generate_problem_banner {
+ my ( $self, $problem ) = @_;
+
+ my $banner = {};
+ if ( $problem->is_open && time() - $problem->lastupdate_local->epoch > 8 * 7 * 24 * 60 * 60 )
+ {
+ $banner->{id} = 'unknown';
+ $banner->{text} = _('Unknown');
+ }
+ if ($problem->is_fixed) {
+ $banner->{id} = 'fixed';
+ $banner->{text} = _('Fixed');
+ }
+ if ($problem->is_closed) {
+ $banner->{id} = 'closed';
+ $banner->{text} = _('Closed');
+ }
+
+ if ( grep { $problem->state eq $_ } ( 'investigating', 'in progress', 'planned' ) ) {
+ $banner->{id} = 'progress';
+ $banner->{text} = _('In progress');
+ }
+
+ return $banner;
+}
+
1;