aboutsummaryrefslogtreecommitdiffstats
path: root/t/open311/getservicerequestupdates.t
Commit message (Collapse)AuthorAgeLines
* [Open311] No update text on fixed state move.Matthew Somerville2018-08-06-0/+20
| | | | | | A move between fixed states (presumably from fixed-user to fixed-council) should not count as a state change for the purposes of generating comment text from templates.
* Map Open311 CLOSED status to closed state if extended statuses enabled.Dave Arter2018-06-21-1/+13
| | | | | | | | | | | | | | | | | | | | | The Open311 specification has two values for a report's status: - open: it has been reported. - closed: it has been resolved. FixMyStreet previously mapped 'closed' to 'fixed - council', but this has been causing issues with Open311 endpoints that want to mark a FMS report as closed but not fixed. The mySociety Open311 additions introduce extended statuses, some of which represent a 'closed' state e.g. duplicate, no_further_action, but there are times when a report should simply be closed without any indication why - for example, if open311-adapter is being used to integrate with a council system which has a closed state not represented by the extended statuses. Marking a report as 'closed' on a council system and displaying that as 'fixed' on the FixMyStreet front end is not an ideal situation. This commit changes the mapping of the Open311 'closed' status to the 'closed' FMS state when extended_statuses is enabled.
* [Open311] Hide fetched update if no data to show.Matthew Somerville2018-04-27-0/+2
| | | | If no text, photo, or state change, hide the update from display.
* Use explicit ordering for test queryDave Arter2018-04-23-1/+1
| | | | This hopefully works around some odd test failures on Travis.
* Don’t trigger response templates unless problem state changesDave Arter2018-04-23-0/+12
| | | | | | | Response templates won't be triggered unless the problem state or external status code is changed. Fixes #2075
* [Open311] Generally store update state.Matthew Somerville2018-04-10-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, an update's problem_state was set via an Open311 update if: * the update timestamp was equal or greater to the report's last update; * the new state was visible, and not equal to the report's current state; * the update wouldn't change the report from a fixed state to another fixed state; * (Oxfordshire) the update wouldn't change the report from any open state to Open. It would also set the report's state to match if the report was currently visible. This mostly worked, but could lead to issues if e.g. the report started life in a non-confirmed state (e.g. we pulled it in already fixed from an external source), as then the update did not record its state and the update display got confused as to the state history. However it did mean there wasn't confusion if a later update than the Open311 update was made on the site itself. This new code will set an update's problem_state if: * the new state is visible; * the update wouldn't change the report from a fixed state to another fixed state; * (Oxfordshire) the update wouldn't change the report from any open state to Open. It will also set the report's state to match if the report is currently visible, changing state, and the update timestamp is equal or greater to the report's last update. So when the report state changes is unchanged, all the conditions still apply, but the update's problem_state is set more often (it will be set regardless of whether the timestamps align, or whether the state matches the report's current state). This could theoretically lead to issues elsewhere, e.g. if an update is left on a report on FixMyStreet and then an Open311 update is pulled in later (but with an earlier timestamp) that changes the state, the report state will not be updated due to the later update being made, though the Open311 update will list the state change, and then the later update might say it changed it back (if it recorded the current state in its problem_state), even though it technically did not. I think this issue is less worrying than the current situation, which can state that a random update has fixed a report when it was the previous update that did, and there will always be such issues with multiple sources of truth for a report status. An alternative would be to allow the Open311 update to override.
* Trigger response templates based on external_status_codeDave Arter2018-03-29-0/+41
|
* Fetch and store external_status_code in GetServiceRequestUpdatesDave Arter2018-03-28-0/+48
| | | | | | | If the Open311 endpoint provides the external_status_code field in servicerequestupdates.xml output, it’s stored in each comment’s extra field as well as the problem’s extra field. This will make it possible to trigger response templates based on this value.
* permit blank updates to be fetched over Open311Struan Donald2018-03-15-0/+48
| | | | | Add a per body configuration option to allow Open311 updates to contain only a status change, rather than emitting a warning when this happens.
* Use response template for Open311 updates without ‘description’ textDave Arter2017-12-04-3/+27
| | | | | | | If an Open311 service request update with an empty description field is received and there is a matching ResponseTemplate for the problem's category & state (and it's marked as auto-response) then the text from that ResponseTemplate will be used for the created update.
* [Oxfordshire] Open311 update, no open state switchMatthew Somerville2017-08-02-67/+105
|
* Run each test file in a transaction.Matthew Somerville2017-06-20-3/+1
| | | | This means that the tests can be run in parallel.
* Shrink test sample photo.Matthew Somerville2016-08-16-1/+1
|
* Use valid orientation flag for test imageDave Arter2016-06-27-1/+1
| | | | | | jhead 3.00 considers 0 an invalid value for EXIF orientation and will replace it with 1 when run with the -autorot flag. This was causing a test failure as the SHA hash of the sample image was being changed.
* Tidy up Open311 XML handling.Matthew Somerville2016-06-15-2/+2
| | | | | Parse the XML in such a way other parts of the code do not have to worry about single-value folding or the like.
* Skip fetched updates if they're out of date range.Matthew Somerville2016-04-26-6/+7
| | | | | Even when we ask for a specific range of dates, we sometimes get given more in the response.
* Add PNG image support.Matthew Somerville2016-04-08-1/+1
| | | | | | | Store image type along with hash in photo column, and use that when outputting images / generating URLs. Make sure all public photo URL generation goes through appropriate functions, and change temp URLs so the filename can be output directly from the list.
* Spot media_url in Open311 GetServiceRequestUpdate.Matthew Somerville2016-01-29-0/+27
| | | | Fixes #1315.
* Reduce use of FixMyStreet::App.Matthew Somerville2015-12-02-9/+9
| | | | Command line scripts don't need a full blown app, just database.
* Simplify/consolidate body restriction db code.Matthew Somerville2015-08-19-16/+14
| | | | | | | Make dashboard work properly in two-tier councils, showing reports sent to both. Create an index on the array of the bodies_str column to speed up performance, and use that throughout the code replacing all LIKE scans. This also enables a simplifying tidy of the restriction code.
* Remove need for cron-wrapper with existing scriptsMatthew Somerville2015-01-19-4/+0
| | | | | Call the necessary boilerplate in each script so you can call them directly. Remove boilerplate from files that don't need it.
* Fix uncommon Open311 errors on processing updates.Hakim Cassimally2014-02-27-9/+25
| | | | | | | | | | | Fixes #677. The query to fetch the related alert sometimes: * retrieves no result, causing an error on $alert->id * retrieves multiple results, causing deprecation warnings (e.g. which may at some point become future errors in DBIC) This commit turns the resultset('DB::Alert')->find(...) into a search(...) and loops over the results, to suppress them.
* Don't update problem state from service request if currently hidden.Matthew Somerville2014-01-30-18/+13
|
* Fix some missing time zone declarations in tests.Matthew Somerville2013-04-09-1/+3
|
* Merge remote branch 'origin/zurich'Matthew Somerville2013-02-04-9/+9
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/open311-populate-service-list bin/send-comments bin/update-all-reports conf/crontab.ugly db/schema.sql perllib/FixMyStreet/App/Controller/Admin.pm perllib/FixMyStreet/App/Controller/Report/New.pm perllib/FixMyStreet/App/Controller/Reports.pm perllib/FixMyStreet/Cobrand/Default.pm perllib/FixMyStreet/Cobrand/LichfieldDC.pm perllib/FixMyStreet/DB/Result/Open311conf.pm perllib/FixMyStreet/DB/Result/Problem.pm perllib/FixMyStreet/DB/ResultSet/Problem.pm perllib/FixMyStreet/SendReport.pm perllib/FixMyStreet/SendReport/Email.pm perllib/FixMyStreet/SendReport/Open311.pm perllib/Open311/GetServiceRequestUpdates.pm perllib/Open311/PopulateServiceList.pm t/app/controller/report_new.t t/app/controller/rss.t templates/web/bromley/report/display.html templates/web/default/admin/council_contacts.html templates/web/default/common_header_tags.html templates/web/default/dashboard/index.html templates/web/default/front/stats.html templates/web/default/report/_main.html templates/web/default/report/update-form.html templates/web/emptyhomes/index.html templates/web/emptyhomes/report/display.html templates/web/emptyhomes/report/new/councils_text_all.html templates/web/emptyhomes/reports/body.html templates/web/emptyhomes/reports/index.html templates/web/fixmystreet/report/new/fill_in_details_form.html templates/web/fixmystreet/report/update-form.html web/cobrands/fixmystreet/fixmystreet.js web/js/fixmystreet.js
| * Allow bodies to span multiple area IDs, and areas can be covered by more ↵Matthew Somerville2012-12-19-7/+7
| | | | | | | | than one body.
| * Update tests for new names of things and bodies needing to exist.Matthew Somerville2012-12-15-2/+2
| |
* | add internal review status to problemsStruan Donald2013-01-17-0/+12
| |
* | Merge branch 'bromley-new-statuses'Struan Donald2013-01-16-14/+148
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/send-comments conf/crontab.ugly db/schema.sql perllib/FixMyStreet/App/Controller/Admin.pm perllib/FixMyStreet/DB/Result/Open311conf.pm perllib/FixMyStreet/DB/ResultSet/Problem.pm perllib/Open311.pm t/app/controller/report_updates.t t/open311.t templates/web/default/report/display.html templates/web/default/report/updates.html templates/web/fixmystreet/report/display.html
| * be less restrictive about how open 311 status updates can change statesStruan Donald2012-11-09-4/+16
| | | | | | | | | | as logged in council users don't have the same restrictions also, fix open311 status name of unable to fix
| * simplfy state change code and also correct bugsStruan Donald2012-10-04-6/+56
| |
| * actually use a closed state in the testStruan Donald2012-10-04-1/+1
| |
| * add in test for FIXED statusStruan Donald2012-10-03-0/+12
| |
| * do not used planned status but use new action scheduled insteadStruan Donald2012-10-02-12/+0
| | | | | | | | | | NB: planned still listed in some places to account for old reports some test coverage improvements
| * tidy up status names in DB, improve tests a littleStruan Donald2012-10-01-4/+28
| |
| * initial work to handle changed problem statesStruan Donald2012-08-31-6/+54
| |
* | bring service request updates in line with our specStruan Donald2012-10-08-9/+9
| |
* | update getservice request tests for open311-fms versionStruan Donald2012-09-07-10/+31
| |
* | Always use 'reopened', and don't set mark_open for Open311 received updates.Matthew Somerville2012-09-05-2/+2
| |
* | handle re-opening of problems via open311 service requests updates correctlyStruan Donald2012-09-05-2/+2
|/ | | | also small tweaks to display of update meta information
* Use problem_state column rather than mark_fixed for updates from council.Matthew Somerville2012-06-06-3/+8
|
* add ability to suppress alerts to report creator onStruan Donald2012-05-11-0/+66
| | | | comments updated from open311
* tests for ignoring old comment state and related fixesStruan Donald2012-04-27-0/+57
|
* tests for time and comment replacement plus fixes for comment timeStruan Donald2012-03-28-0/+97
|
* add in start end date limits for get service request updatesStruan Donald2012-03-27-0/+46
|
* regularise data structure in open311 module as that is more sensibleStruan Donald2012-03-20-1/+1
|
* make sure external ids for problems and comments are only unique per councilStruan Donald2012-03-20-1/+72
|
* tests for mark_open and mark_fixedStruan Donald2012-03-20-0/+56
|
* slightly less convulted test data structureStruan Donald2012-03-20-4/+4
|
* add first pass of update comments method and testsStruan Donald2012-03-19-4/+75
|