aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet')
-rw-r--r--perllib/FixMyStreet/App/Controller/Admin.pm6
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm37
2 files changed, 37 insertions, 6 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Admin.pm b/perllib/FixMyStreet/App/Controller/Admin.pm
index e9b4bb9a2..cd1436598 100644
--- a/perllib/FixMyStreet/App/Controller/Admin.pm
+++ b/perllib/FixMyStreet/App/Controller/Admin.pm
@@ -600,11 +600,13 @@ sub report_edit : Path('report_edit') : Args(1) {
$c->stash->{problem} = $problem;
+ $c->forward('get_token');
+
if ( $c->cobrand->moniker eq 'zurich' ) {
- $c->cobrand->admin_report_edit();
+ my $done = $c->cobrand->admin_report_edit();
+ return if $done;
}
- $c->forward('get_token');
$c->forward('check_email_for_abuse', [ $problem->user->email ] );
$c->stash->{updates} =
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 15397e0a2..d39e017f7 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -122,17 +122,46 @@ sub admin_report_edit {
$c->detach( '/page_error_404_not_found' )
unless $allowed_bodies{$problem->bodies_str};
- if ($type eq 'dm') {
+ if ($type eq 'super') {
+
+ my @bodies = $c->model('DB::Body')->all();
+ @bodies = sort { strcoll($a->name, $b->name) } @bodies;
+ $c->stash->{bodies} = \@bodies;
+
+ } elsif ($type eq 'dm') {
+
+ # Can assign to other DMs, and their own subdivisions
my @bodies = $c->model('DB::Body')->search( [ { parent => $body->parent->id }, { parent => $body->id } ] );
@bodies = sort { strcoll($a->name, $b->name) } @bodies;
$c->stash->{bodies} = \@bodies;
+
} elsif ($type eq 'sdm') {
+
+ # Has cut-down edit template for adding update and sending back up only
$c->stash->{template} = 'admin/report_edit-sdm.html';
- my @bodies = $c->model('DB::Body')->search( [ { id => $body->parent->id }, { id => $body->id } ] );
- @bodies = sort { strcoll($a->name, $b->name) } @bodies;
- $c->stash->{bodies} = \@bodies;
+
+ if ($c->req->param('send_back')) {
+ $c->forward('check_token');
+
+ $problem->bodies_str( $body->parent->id );
+ $problem->update;
+
+ # log here
+
+ $c->res->redirect( '/admin/summary' );
+ return 1;
+
+ } elsif ($c->req->param('submit')) {
+ $c->forward('check_token');
+
+ # Add new update from status_update
+
+ return 1;
+ }
}
+ return 0;
+
}
1;