aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm7
-rw-r--r--t/app/controller/admin.t2
-rw-r--r--templates/web/base/admin/report_edit.html5
3 files changed, 12 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 7b760d26d..6145a6eb0 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -705,6 +705,13 @@ sub report_edit : Path('report_edit') : Args(1) {
$c->forward( 'log_edit', [ $id, 'problem', 'resend' ] );
}
+ elsif ( $c->get_param('mark_sent') ) {
+ $c->forward('check_token');
+ $problem->whensent(\'ms_current_timestamp()');
+ $problem->update();
+ $c->stash->{status_message} = '<p><em>' . _('That problem has been marked as sent.') . '</em></p>';
+ $c->forward( 'log_edit', [ $id, 'problem', 'marked sent' ] );
+ }
elsif ( $c->get_param('flaguser') ) {
$c->forward('flag_user');
$c->stash->{problem}->discard_changes;
diff --git a/t/app/controller/admin.t b/t/app/controller/admin.t
index f63a72117..fb3ab1917 100644
--- a/t/app/controller/admin.t
+++ b/t/app/controller/admin.t
@@ -568,7 +568,7 @@ foreach my $test (
$report->discard_changes;
- if ( $report->state eq 'confirmed' ) {
+ if ($report->state eq 'confirmed' && $report->whensent) {
$mech->content_contains( 'type="submit" name="resend"', 'resend button' );
} else {
$mech->content_lacks( 'type="submit" name="resend"', 'no resend button' );
diff --git a/templates/web/base/admin/report_edit.html b/templates/web/base/admin/report_edit.html
index 12560fdf3..f14c1616a 100644
--- a/templates/web/base/admin/report_edit.html
+++ b/templates/web/base/admin/report_edit.html
@@ -68,7 +68,10 @@
<li>[% loc('Phone:') %] [% problem.user.phone | html %]</li>
<li>[% loc('Created:') %] [% PROCESS format_time time=problem.created %]</li>
<li>[% loc('Confirmed:') %] [% PROCESS format_time time=problem.confirmed no_time='-' %]</li>
-<li>[% loc('Sent:') %] [% PROCESS format_time time=problem.whensent %] [% IF problem.state == 'confirmed' %]<input onclick="return confirm('[% loc('You really want to resend?') %]')" type="submit" name="resend" value="[% loc('Resend report') %]">[% END %]</li>
+<li>[% loc('Sent:') %] [% PROCESS format_time time=problem.whensent %]
+[% IF problem.state == 'confirmed' AND problem.whensent %]<input onclick="return confirm('[% loc('You really want to resend?') %]')" type="submit" name="resend" value="[% loc('Resend report') %]">[% END %]
+[% IF NOT problem.whensent %]<input type="submit" name="mark_sent" value="[% loc('Mark as sent') %]">[% END %]
+</li>
<li>[% loc('Last update:') %] [% PROCESS format_time time=problem.lastupdate %]</li>
<li>[% loc('Service:') %] [% problem.service %]</li>
<li>[% loc('Cobrand:') %] [% problem.cobrand %]</li>