diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-28 17:44:38 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-28 17:44:38 +0100 |
commit | e2414d30dd673ecea38e2a40d187b835bd076ac3 (patch) | |
tree | c1c08382858784655c18e3bde293d0161e2380c7 /perllib/FixMyStreet | |
parent | 96da0c04218644450f141f20c1dee4247a0ed8fe (diff) |
indicate problem has been closed in alert
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r-- | perllib/FixMyStreet/DB/ResultSet/AlertType.pm | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm index d5b2f5535..a7e6d9736 100644 --- a/perllib/FixMyStreet/DB/ResultSet/AlertType.pm +++ b/perllib/FixMyStreet/DB/ResultSet/AlertType.pm @@ -49,6 +49,7 @@ sub email_alerts ($) { # XXX Ugh - needs work $query =~ s/\?/alert.parameter/ if ($query =~ /\?/); $query =~ s/\?/alert.parameter2/ if ($query =~ /\?/); + $query = dbh()->prepare($query); $query->execute(); my $last_alert_id; @@ -73,11 +74,13 @@ sub email_alerts ($) { } # create problem status message for the templates - $data{state_message} = - # XXXXXX test this - FixMyStreet::DB::Result::Problem::fixed_states()->{$row->{state}} - ? _("This report is currently marked as fixed.") - : _("This report is currently marked as open."); + if ( FixMyStreet::DB::Result::Problem::fixed_states()->{$row->{state}} ) { + $data{state_message} = _("This report is currently marked as fixed."); + } elsif ( FixMyStreet::DB::Result::Problem::closed_states()->{$row->{state}} ) { + $data{state_message} = _("This report is currently marked as closed.") + } else { + $data{state_message} = _("This report is currently marked as open."); + } my $url = $cobrand->base_url_for_emails( $row->{alert_cobrand_data} ); if ($row->{item_text}) { |