diff options
-rw-r--r-- | CHANGELOG.md | 3 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Buckinghamshire.pm | 2 | ||||
-rw-r--r-- | perllib/Open311.pm | 2 | ||||
-rw-r--r-- | perllib/Open311/GetServiceRequestUpdates.pm | 7 | ||||
-rw-r--r-- | t/cobrand/bucks.t | 2 | ||||
-rw-r--r-- | t/open311/getservicerequestupdates.t | 14 | ||||
-rw-r--r-- | t/script/inactive.t | 3 | ||||
-rw-r--r-- | templates/web/base/report/display.html | 20 |
8 files changed, 38 insertions, 15 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 7698b8736..9249149bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,15 @@ - Front end improvements: - Simplify footer CSS. #2107 - Keep commas in geocode lookups. + - Show message on reports closed to updates. - Bugfixes: - Don't remove automated fields when editing contacts #2163 - Remove small border to left of Fixed banner. #2156 - Fix issue displaying admin timeline. #2159 - Send details of unresponsive bodies to mobile app #2164 - Fix issue with category filter when category contains comma #2166 + - Open311 improvements: + - CLOSED status maps to 'closed' state if extended statuses are enabled. * v2.3.4 (7th June 2018) - Bugfixes: diff --git a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm index 9b4445460..b3c8350cf 100644 --- a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm +++ b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm @@ -101,7 +101,7 @@ sub munge_sendreport_params { # service at the point we're sending the report by email. my $site_code = $row->get_extra_field_value('site_code') || $self->lookup_site_code($row, 10); if ($site_code) { - my $e = join('', 'internaltfb', '@', $self->admin_user_domain); + my $e = join('', 'crmbusinesssupport', '@', $self->admin_user_domain); push @{$hdrs->{To}}, [ $e, 'TfB' ]; } } diff --git a/perllib/Open311.pm b/perllib/Open311.pm index a91de0a7c..a57fceeaf 100644 --- a/perllib/Open311.pm +++ b/perllib/Open311.pm @@ -327,7 +327,7 @@ sub map_state { 'not councils responsibility' => 'not responsible', 'no further action' => 'unable to fix', open => 'confirmed', - closed => 'fixed - council', + closed => $self->extended_statuses ? 'closed' : 'fixed - council', ); return $state_map{$incoming_state} || $incoming_state; diff --git a/perllib/Open311/GetServiceRequestUpdates.pm b/perllib/Open311/GetServiceRequestUpdates.pm index 7cbfc7192..4b1642506 100644 --- a/perllib/Open311/GetServiceRequestUpdates.pm +++ b/perllib/Open311/GetServiceRequestUpdates.pm @@ -32,9 +32,10 @@ sub fetch { while ( my $body = $bodies->next ) { my $o = Open311->new( - endpoint => $body->endpoint, - api_key => $body->api_key, - jurisdiction => $body->jurisdiction, + endpoint => $body->endpoint, + api_key => $body->api_key, + jurisdiction => $body->jurisdiction, + extended_statuses => $body->send_extended_statuses, ); # custom endpoint URLs because these councils have non-standard paths diff --git a/t/cobrand/bucks.t b/t/cobrand/bucks.t index 1dee8b47e..882de8179 100644 --- a/t/cobrand/bucks.t +++ b/t/cobrand/bucks.t @@ -32,7 +32,7 @@ $mech->create_problems_for_body(1, $body->id, 'On Road', { subtest 'flytipping on road sent to extra email' => sub { FixMyStreet::Script::Reports::send(); my $email = $mech->get_email; - my $tfb = join('', 'internaltfb', '@', 'buckscc.gov.uk'); + my $tfb = join('', 'crmbusinesssupport', '@', 'buckscc.gov.uk'); is $email->header('To'), '"Buckinghamshire" <flytipping@example.org>, "TfB" <' . $tfb . '>'; }; diff --git a/t/open311/getservicerequestupdates.t b/t/open311/getservicerequestupdates.t index 3c279d776..27064574b 100644 --- a/t/open311/getservicerequestupdates.t +++ b/t/open311/getservicerequestupdates.t @@ -258,6 +258,18 @@ for my $test ( end_state => 'fixed - council', }, { + desc => 'status of CLOSED marks report as closed when using extended statuses', + description => 'This is a note', + external_id => 638344, + start_state => 'confirmed', + comment_status => 'CLOSED', + mark_fixed=> 0, + mark_open => 0, + problem_state => 'closed', + end_state => 'closed', + extended_statuses => 1, + }, + { desc => 'status of OPEN re-opens fixed report', description => 'This is a note', external_id => 638344, @@ -384,7 +396,7 @@ for my $test ( ) { subtest $test->{desc} => sub { my $local_requests_xml = setup_xml($problem->external_id, $problem->id, $test->{comment_status}, $test->{xml_description}); - my $o = Open311->new( jurisdiction => 'mysociety', endpoint => 'http://example.com', test_mode => 1, test_get_returns => { 'servicerequestupdates.xml' => $local_requests_xml } ); + my $o = Open311->new( jurisdiction => 'mysociety', endpoint => 'http://example.com', extended_statuses => $test->{extended_statuses}, test_mode => 1, test_get_returns => { 'servicerequestupdates.xml' => $local_requests_xml } ); $problem->lastupdate( DateTime->now()->subtract( days => 1 ) ); $problem->state( $test->{start_state} ); diff --git a/t/script/inactive.t b/t/script/inactive.t index 4d78b385f..4667c989b 100644 --- a/t/script/inactive.t +++ b/t/script/inactive.t @@ -55,7 +55,8 @@ subtest 'Closing updates on inactive fixed/closed reports' => sub { $in->reports; $problems[2]->discard_changes; is $problems[2]->get_extra_metadata('closed_updates'), 1, 'Closed to updates'; - # TODO Visit page, check closed for updates + $mech->get_ok("/report/" . $problems[2]->id); + $mech->content_contains('now closed to updates'); }; subtest 'Anonymization of inactive users' => sub { diff --git a/templates/web/base/report/display.html b/templates/web/base/report/display.html index 8c461dced..ebe969994 100644 --- a/templates/web/base/report/display.html +++ b/templates/web/base/report/display.html @@ -53,17 +53,23 @@ [% TRY %][% INCLUDE 'report/sharing.html' %][% CATCH file %][% END %] [% INCLUDE 'report/updates.html' %] -[% IF two_column_sidebar AND NOT problem.extra.closed_updates %] -<button class="btn btn--provide-update js-provide-update hidden-nojs">[% loc('Provide an update') %]</button> -<div class="hidden-js"> -[% END %] [% IF problem.duplicate_of %] [% INCLUDE 'report/duplicate-no-updates.html' %] +[% ELSIF problem.extra.closed_updates %] + <p>[% loc('This report is now closed to updates.') %] + [% tprintf(loc('You can <a href="%s">make a new report in the same location</a>.'), + c.uri_for( '/report/new', { longitude => longitude, latitude => latitude } ) + ) %] + </p> [% ELSIF NOT shown_form %] + [% IF two_column_sidebar %] + <button class="btn btn--provide-update js-provide-update hidden-nojs">[% loc('Provide an update') %]</button> + <div class="hidden-js"> + [% END %] [% INCLUDE 'report/update-form.html' %] -[% END %] -[% IF two_column_sidebar AND NOT problem.extra.closed_updates %] -</div> + [% IF two_column_sidebar %] + </div> + [% END %] [% END %] </div> |