aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/Open311/GetServiceRequestUpdates.pm
Commit message (Collapse)AuthorAgeLines
* [Open311] Hide fetched update if no data to show.Matthew Somerville2018-04-27-2/+6
| | | | If no text, photo, or state change, hide the update from display.
* Don’t trigger response templates unless problem state changesDave Arter2018-04-23-15/+26
| | | | | | | 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-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Allow same-time state change from Open311 updates.Matthew Somerville2018-04-06-1/+2
| | | | | | If we've pulled in a report and an update from an external source, both may have exactly the same timestamp, and we do want to record the problem_state in that case.
* Trigger response templates based on external_status_codeDave Arter2018-03-29-3/+10
|
* Fetch and store external_status_code in GetServiceRequestUpdatesDave Arter2018-03-28-0/+9
| | | | | | | 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/+4
| | | | | Add a per body configuration option to allow Open311 updates to contain only a status change, rather than emitting a warning when this happens.
* fetch new problems over open311Struan Donald2018-03-15-29/+3
| | | | | | | | | | This enables the display of existing reports from the back end on FMS if the body is configured to do this. Reports will not be created if they are missing an id, a lat or a long, if the lat/long is outside the area covered by the body, if there is already a report with a matching id, or if we can't parse out the request time.
* Use response template for Open311 updates without ‘description’ textDave Arter2017-12-04-4/+19
| | | | | | | 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.
* Drop council_states and $visible_states.Matthew Somerville2017-08-29-1/+1
|
* Move FixMyStreet::DB to FixMyStreet::DB::Schema.Matthew Somerville2017-08-09-1/+1
| | | | Store a schema object on FixMyStreet::DB instead.
* [Oxfordshire] Open311 update, no open state switchMatthew Somerville2017-08-02-0/+3
|
* Skip incoming Open311 update if no ID or content.Matthew Somerville2016-08-10-0/+1
|
* Tidy up Open311 XML handling.Matthew Somerville2016-06-15-2/+1
| | | | | 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-2/+7
| | | | | Even when we ask for a specific range of dates, we sometimes get given more in the response.
* Only load images from disk when needed.Matthew Somerville2016-02-23-2/+1
| | | | Fixes #1337.
* Spot media_url in Open311 GetServiceRequestUpdate.Matthew Somerville2016-01-29-0/+14
| | | | Fixes #1315.
* Move from Moose to Moo in non-App code.Matthew Somerville2015-12-02-3/+3
| | | | And create default cobrand class without all of Moose.
* Reduce use of FixMyStreet::App.Matthew Somerville2015-12-02-6/+7
| | | | Command line scripts don't need a full blown app, just database.
* Simplify/consolidate body restriction db code.Matthew Somerville2015-08-19-7/+5
| | | | | | | 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.
* Fix uncommon Open311 errors on processing updates.Hakim Cassimally2014-02-27-5/+7
| | | | | | | | | | | 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-1/+3
|
* Remove *_local tz functions, set timezone on fetching original columns from ↵Matthew Somerville2013-02-14-1/+1
| | | | database.
* Remove all special body handling in order to move FMB to use bodies properly.Matthew Somerville2013-02-04-6/+4
|
* Merge remote branch 'origin/zurich'Matthew Somerville2013-02-04-15/+15
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+6
| | | | | | | | than one body.
| * Rename a few more less important variables.Matthew Somerville2012-12-15-4/+4
| |
| * Rename council column to bodies_str, and all the related code.Matthew Somerville2012-12-15-10/+10
| |
| * Convert PopulateServiceList to use body IDs.Matthew Somerville2012-12-15-1/+0
| |
| * Rename 'open311conf' database table to 'body'.Matthew Somerville2012-12-15-1/+1
| |
* | tidy up hardcoded council (area) idsDave Whiteland2013-01-21-4/+5
| |
* | add Oxfordshire's non-standard endpoint for service request updatesDave Whiteland2013-01-21-0/+7
| |
* | Merge remote-tracking branch 'origin/master'Struan Donald2013-01-21-6/+8
|\ \
| * | use jurisdiction to identify external bodies for FixMyBarangay's status ↵Dave Whiteland2013-01-20-6/+8
| |/ | | | | | | updates coming from endpoints in devolved contacts
* | Merge branch 'bromley-new-statuses'Struan Donald2013-01-16-6/+26
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | 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-7/+5
| | | | | | | | | | 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-17/+27
| |
| * tidy up status names in DB, improve tests a littleStruan Donald2012-10-01-0/+2
| |
| * initial work to handle changed problem statesStruan Donald2012-08-31-2/+12
| |
* | correct typo in special casing bromley service request updates endpointStruan Donald2012-11-21-1/+1
| |
* | slightly more useful error messages if fetching Open311 service request ↵Struan Donald2012-11-21-1/+1
| | | | | | | | updates fails
* | Merge branch 'stevenage'Struan Donald2012-11-19-0/+15
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .gitignore bin/make_css conf/crontab.ugly perllib/FixMyStreet/Cobrand/Default.pm perllib/Open311.pm templates/web/fixmystreet/around/postcode_form.html
| * | add script to fetch last 24 hours of updates as a backup and default to last ↵Struan Donald2012-10-17-0/+8
| | | | | | | | | | | | 2 hours in standard script
| * | bring service request updates in line with our specStruan Donald2012-10-08-0/+7
| | |
* | | More cron quietening, only show full Open311 first time, then summarise.Matthew Somerville2012-10-05-1/+3
|/ /
* | Always use 'reopened', and don't set mark_open for Open311 received updates.Matthew Somerville2012-09-05-1/+0
| |
* | handle re-opening of problems via open311 service requests updates correctlyStruan Donald2012-09-05-0/+1
|/ | | | 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-4/+2
|
* always update the last update time on problems when fetching commentsStruan Donald2012-05-30-4/+2
|
* add ability to suppress alerts to report creator onStruan Donald2012-05-11-0/+16
| | | | comments updated from open311