diff options
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Admin/Bodies.pm | 2 | ||||
-rw-r--r-- | t/app/controller/admin/bodies.t | 18 | ||||
-rwxr-xr-x | templates/web/fixmystreet.com/reports/_body_gone.html | 1 | ||||
-rw-r--r-- | web/cobrands/hounslow/assets.js | 70 |
5 files changed, 57 insertions, 35 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ce0db9630..456be61d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,7 @@ - Have duplicate suggestion and assets coexist better. - Don't include lat/lon of private reports in ‘Report another problem here’ link. + - Allow contact send method to be unset always. - Front end improvements: - Set report title autocomplete to off to prevent email autocompleting - Development improvements: diff --git a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm index 2ff69b3b5..67177fcbd 100644 --- a/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm +++ b/perllib/FixMyStreet/App/Controller/Admin/Bodies.pm @@ -241,7 +241,7 @@ sub update_contacts : Private { my $email = $c->get_param('email'); $email =~ s/\s+//g; - my $send_method = $c->get_param('send_method') || $contact->send_method || $contact->body->send_method || ""; + my $send_method = $c->get_param('send_method') || $contact->body->send_method || ""; unless ( $send_method eq 'Open311' ) { $errors{email} = _('Please enter a valid email') unless is_valid_email_list($email) || $email eq 'REFUSED'; } diff --git a/t/app/controller/admin/bodies.t b/t/app/controller/admin/bodies.t index db53b7cda..6fb13f0ff 100644 --- a/t/app/controller/admin/bodies.t +++ b/t/app/controller/admin/bodies.t @@ -182,6 +182,7 @@ subtest 'check open311 configuring' => sub { send_comments => 0, send_method => 'Open311', fetch_all_problems => 0, + can_be_devolved => 1, # for next test } } ); @@ -192,6 +193,23 @@ subtest 'check open311 configuring' => sub { ok !$conf->get_extra_metadata('fetch_all_problems'), 'fetch all problems unset'; }; +subtest 'check open311 devolved editing' => sub { + $mech->get_ok('/admin/body/' . $body->id . '/test%20category'); + $mech->submit_form_ok( { with_fields => { + send_method => 'Email', + email => 'testing@example.org', + note => 'Updating contact to email', + } } ); + $mech->content_contains('Values updated'); + $mech->get_ok('/admin/body/' . $body->id . '/test%20category'); + $mech->submit_form_ok( { with_fields => { + send_method => '', + email => 'open311-code', + note => 'Removing email send method', + } } ); + $mech->content_contains('Values updated'); +}; + subtest 'check text output' => sub { $mech->get_ok('/admin/body/' . $body->id . '?text=1'); is $mech->content_type, 'text/plain'; diff --git a/templates/web/fixmystreet.com/reports/_body_gone.html b/templates/web/fixmystreet.com/reports/_body_gone.html index 5a8232110..d65a8e44b 100755 --- a/templates/web/fixmystreet.com/reports/_body_gone.html +++ b/templates/web/fixmystreet.com/reports/_body_gone.html @@ -1,3 +1,4 @@ +[% RETURN IF body.name == 'Highways England' # Covers no areas but does exist %] <p id="unknown" class="alert">This council no longer exists. [% IF body.name.match('Antrim|Newtownabbey') %] Its area is now covered by <a href="/reports/Antrim+and+Newtownabbey">Antrim and Newtownabbey Borough Council</a>. diff --git a/web/cobrands/hounslow/assets.js b/web/cobrands/hounslow/assets.js index 6bd603b8c..abe3d20da 100644 --- a/web/cobrands/hounslow/assets.js +++ b/web/cobrands/hounslow/assets.js @@ -42,40 +42,42 @@ fixmystreet.assets.add($.extend(true, {}, defaults, { asset_item: 'bin' })); -fixmystreet.assets.add($.extend(true, {}, defaults, { - http_options: { - params: { - TYPENAME: "trees" - } - }, - asset_id_field: 'central_asset_id', - attributes: { - central_asset_id: 'central_asset_id', - asset_details: 'asset_number' - }, - asset_category: [ - "Tree Danger/Obstruction", - "Branches overhanging", - "Damage By Tree", - "Dead/Dying/Diseased", - "Dying or dangerous tree", - "Empty tree Pit", - "Fallen or leaning tree", - "General Maintenance and pruning", - "Illuminated Traffic signal obstructed by vegetation", - "Traffic signal obstructed by vegetation", - "Pest: Tree/Shrub", - "Pests in trees and shrubs", - "Tree Branches Overhanging", - "Tree Maintenance", - "Tree causing damage to property", - "Tree obstructing street light", - "Trees or shrubs blocking visibility", - "Trees or shrubs causing obstruction of highway", - "Trees" - ], - asset_item: 'tree' -})); +// Disabled for now as the data is quite out of date and causing problems +// sending reports. +// fixmystreet.assets.add($.extend(true, {}, defaults, { +// http_options: { +// params: { +// TYPENAME: "trees" +// } +// }, +// asset_id_field: 'central_asset_id', +// attributes: { +// central_asset_id: 'central_asset_id', +// asset_details: 'asset_number' +// }, +// asset_category: [ +// "Tree Danger/Obstruction", +// "Branches overhanging", +// "Damage By Tree", +// "Dead/Dying/Diseased", +// "Dying or dangerous tree", +// "Empty tree Pit", +// "Fallen or leaning tree", +// "General Maintenance and pruning", +// "Illuminated Traffic signal obstructed by vegetation", +// "Traffic signal obstructed by vegetation", +// "Pest: Tree/Shrub", +// "Pests in trees and shrubs", +// "Tree Branches Overhanging", +// "Tree Maintenance", +// "Tree causing damage to property", +// "Tree obstructing street light", +// "Trees or shrubs blocking visibility", +// "Trees or shrubs causing obstruction of highway", +// "Trees" +// ], +// asset_item: 'tree' +// })); fixmystreet.assets.add($.extend(true, {}, defaults, { http_options: { |