diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index 114a2e19f22..6145a6eb025 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -425,7 +425,7 @@ sub update_contacts : Private {
sub body_params : Private {
my ( $self, $c ) = @_;
- my @fields = qw/name endpoint jurisdiction api_key send_method send_comments suppress_alerts send_extended_statuses comment_user_id can_be_devolved parent deleted/;
+ my @fields = qw/name endpoint jurisdiction api_key send_method external_url/;
my %defaults = map { $_ => '' } @fields;
%defaults = ( %defaults,
send_comments => 0,
@@ -436,7 +436,7 @@ sub body_params : Private {
parent => undef,
deleted => 0,
);
- my %params = map { $_ => $c->get_param($_) || $defaults{$_} } @fields;
+ my %params = map { $_ => $c->get_param($_) || $defaults{$_} } keys %defaults;
return \%params;
}
@@ -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} = '
' . _('That problem has been marked as sent.') . '
';
+ $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 f63a7211734..498f1cedcbb 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' );
@@ -1083,7 +1083,7 @@ subtest 'report search' => sub {
subtest 'search abuse' => sub {
$mech->get_ok( '/admin/users?search=example' );
- $mech->content_like(qr{test4\@example.com.*\s*.*? | \s*\(Email in abuse table});
+ $mech->content_like(qr{test4\@example.com.* | \s*.*? | \s*\(Email in abuse table}s);
};
subtest 'show flagged entries' => sub {
diff --git a/templates/web/base/admin/bodies.html b/templates/web/base/admin/bodies.html
index a039f8208ba..4c95423c0b2 100644
--- a/templates/web/base/admin/bodies.html
+++ b/templates/web/base/admin/bodies.html
@@ -35,13 +35,13 @@
[% IF c.cobrand.moniker == 'zurich' %]
[% FILTER repeat(4*body.api_key) %] [% END %]
[% IF admin_type == 'super' %]
- [% body.name %]
+ [% body.name | html %]
[% ELSE %]
- [% body.name %]
+ [% body.name | html %]
[% END %]
[% ELSE %] [%# not Zurich: all bodies should be links %]
- [% body.name %]
- [%- ', ' _ body.parent.name IF body.parent -%]
+ [% body.name | html%]
+ [%- IF body.parent %], [% body.parent.name | html %][% END -%]
[% END %]
|
[% IF c.cobrand.moniker == 'zurich' %]
diff --git a/templates/web/base/admin/body-form.html b/templates/web/base/admin/body-form.html
index 608a77dc26c..6b103a7cf5d 100644
--- a/templates/web/base/admin/body-form.html
+++ b/templates/web/base/admin/body-form.html
@@ -16,7 +16,7 @@
-
+
@@ -72,17 +72,21 @@
[% SET body_areas = body.areas %]
[% FOR area IN areas %]
[% SET aid = area.id %]
-
+
[% END %]
+
+
+
+
[% loc( "You can mark a body as deleted if you do not want it to be active on the site." ) %]
-
+
@@ -124,7 +128,7 @@
-
+
@@ -137,7 +141,7 @@
-
+
@@ -150,7 +154,7 @@
-
+
@@ -180,6 +184,9 @@
+ [% IF body.comment_user_id %]
+ [% loc('edit user') %]
+ [% END %]
diff --git a/templates/web/base/admin/body.html b/templates/web/base/admin/body.html
index cd87a5af845..84ea6840ca6 100644
--- a/templates/web/base/admin/body.html
+++ b/templates/web/base/admin/body.html
@@ -13,14 +13,22 @@
[% IF example_pc %]
[% tprintf( loc('Example postcode %s'), example_pc ) | html %] |
[% END %]
- [% IF c.cobrand.moniker == 'emptyhomes' %]
-
[% loc('List all reported problems' ) %] |
- [% ELSE %]
+ [% loc('Area covered') %]:
+ [% SET body_areas = body.areas %]
+ [% FOR area IN areas %]
+ [% SET aid = area.id %]
+ [% IF body_areas.$aid %]
+
[% area.name | html %]
+ [% END %]
+ [% END %]
+
[% loc('List all reported problems' ) %] |
- [% END %]
-
[% loc('Text only version') %]
+
[% loc('Text only version') %]
+
[% IF body.send_method == 'Open311' %]
Council contacts configured via Open311
@@ -65,7 +73,7 @@
[% WHILE ( cat = contacts.next ) %]
- [% cat.category %]
+ | [% cat.category | html %]
[% cat.email | html %] |
[% loc('Confirmed') %]:
@@ -79,10 +87,10 @@
[% loc('Devolved') %]:
[%- IF body.can_be_devolved AND cat.send_method %][% loc('Yes') %][% ELSE %][% loc('No') %][% END %]
|
- [% cat.editor %]
+ | [% cat.editor | html %]
[% PROCESS format_time time=cat.whenedited %] |
[% cat.note | html %] |
- |
+ |
[% END %]
diff --git a/templates/web/base/admin/category_edit.html b/templates/web/base/admin/category_edit.html
index ef7a0a11c76..b827a4b6da9 100644
--- a/templates/web/base/admin/category_edit.html
+++ b/templates/web/base/admin/category_edit.html
@@ -23,6 +23,11 @@
[% loc('Category:') %] [% contact.category | html %]
+ [% IF contact.extra %]
+
[% loc('Extra data:') %]
+ [% USE Dumper %]
+ [% Dumper.dump(contact.extra) | html %]
+ [% END %]
[% loc('Email:') %]
@@ -48,17 +53,17 @@
[% loc('Configure Endpoint') %]