aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/FixMyStreet/Cobrand/Zurich.pm2
-rw-r--r--perllib/FixMyStreet/DB/Result/Problem.pm6
-rw-r--r--perllib/FixMyStreet/SendReport/Zurich.pm2
-rw-r--r--templates/web/zurich/admin/index-dm.html6
-rw-r--r--templates/web/zurich/admin/problem_row.html10
5 files changed, 19 insertions, 7 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Zurich.pm b/perllib/FixMyStreet/Cobrand/Zurich.pm
index 4846e6f1e..b6e582dc2 100644
--- a/perllib/FixMyStreet/Cobrand/Zurich.pm
+++ b/perllib/FixMyStreet/Cobrand/Zurich.pm
@@ -211,7 +211,7 @@ sub admin_report_edit {
$redirect = 1;
} elsif ( my $external = $c->req->params->{body_external} ) {
$problem->state( 'closed' );
- $problem->bodies_str( $external );
+ $problem->external_body( $external );
$problem->whensent( undef );
$redirect = 1;
} else {
diff --git a/perllib/FixMyStreet/DB/Result/Problem.pm b/perllib/FixMyStreet/DB/Result/Problem.pm
index 1a13ca2f4..20b79167f 100644
--- a/perllib/FixMyStreet/DB/Result/Problem.pm
+++ b/perllib/FixMyStreet/DB/Result/Problem.pm
@@ -557,7 +557,11 @@ sub body {
my ( $problem, $c ) = @_;
my $body;
if ($problem->external_body) {
- $body = $problem->external_body;
+ if ($problem->cobrand eq 'zurich') {
+ $body = $c->model('DB::Body')->find({ id => $problem->external_body });
+ } else {
+ $body = $problem->external_body;
+ }
} else {
my $bodies = $problem->bodies;
$body = join( _(' and '),
diff --git a/perllib/FixMyStreet/SendReport/Zurich.pm b/perllib/FixMyStreet/SendReport/Zurich.pm
index 7bf6fe1a3..ca9e6f33e 100644
--- a/perllib/FixMyStreet/SendReport/Zurich.pm
+++ b/perllib/FixMyStreet/SendReport/Zurich.pm
@@ -9,6 +9,8 @@ sub build_recipient_list {
# Only one body ever, most of the time with an email endpoint
my $body = @{ $self->bodies }[0];
+ $body = FixMyStreet::App->model("DB::Body")->find( { id => $row->external_body } )
+ if $row->external_body;
my $body_email = $body->endpoint;
my @bodies = $body->bodies;
diff --git a/templates/web/zurich/admin/index-dm.html b/templates/web/zurich/admin/index-dm.html
index 1286861bc..a88100ee4 100644
--- a/templates/web/zurich/admin/index-dm.html
+++ b/templates/web/zurich/admin/index-dm.html
@@ -10,7 +10,7 @@
[% INCLUDE list, problems = approval.all %]
<h2>[% loc('All reports') %]</h2>
-[% INCLUDE list, problems = other.all %]
+[% INCLUDE list, problems = other.all, include_subdiv = 1 %]
[% INCLUDE 'admin/footer.html' %]
@@ -23,7 +23,9 @@
<th>[% loc('Submitted') %]</th>
<th>[% loc('Updated') %]</th>
<th>[% loc('Status') %]</th>
- <th>[% loc('Subdivision') %]</th>
+ [% IF include_subdiv %]
+ <th>[% loc('Subdivision/Body') %]</th>
+ [% END %]
<th>*</th>
</tr>
<tr class="filter-row">
diff --git a/templates/web/zurich/admin/problem_row.html b/templates/web/zurich/admin/problem_row.html
index 7fddddf8e..176f1a1a6 100644
--- a/templates/web/zurich/admin/problem_row.html
+++ b/templates/web/zurich/admin/problem_row.html
@@ -1,6 +1,6 @@
[%- FOR problem IN problems %]
+ [% SET p_body = problem.bodies.values.0 %]
[% IF page == 'search' %]
- [% SET p_body = problem.bodies.values.0 %]
[% NEXT IF admin_type == 'sdm' AND p_body.id != body.id %]
[% NEXT IF admin_type == 'dm' AND p_body.id != body.id AND p_body.parent.id != body.id %]
[% END %]
@@ -15,15 +15,19 @@
<td>[% PROCESS format_date this_date=problem.created %]</td>
<td>[% PROCESS format_date this_date=problem.lastupdate %]</td>
<td>[% states.${problem.state} %]</td>
- [% IF admin_type != 'sdm' %]
+
+ [% IF include_subdiv %]
<td>
- [%- IF p_body.parent.id AND p_body.parent.parent.id -%][%# ...it's a subdivision %]
+ [%- IF p_body.parent.parent.id -%][%# ...it's a subdivision %]
[% PROCESS value_or_nbsp value=p_body.name %]
+ [%- ELSIF problem.external_body %]
+ [% PROCESS value_or_nbsp value=problem.body(c).name %]
[%- ELSE -%]
&nbsp;
[%- END -%]
</td>
[% END %]
+
[% IF NOT no_edit %]
<td><a href="[% c.uri_for( 'report_edit', problem.id ) %]">[% loc('Edit') %]</a></td>
[% END %]