aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Report.pm
Commit message (Collapse)AuthorAgeLines
* Fix issue with categories with regex characters.Matthew Somerville2017-04-13-1/+1
| | | | | | As the templates were using `grep`, they failed to match on a category such as "Footpaths (right of way)". Changing the stash variables to be hashes instead of lists makes checking for a key simpler. Fixes #1688.
* Merge branch 'offline-tests'Matthew Somerville2017-03-28-1/+1
|\
| * Fix warning, use correct user object in delete logMatthew Somerville2017-03-17-1/+1
| |
* | Add customisable defect types.Dave Arter2017-03-23-1/+7
|/ | | | | | | | | Problems can have an associated defect type, that can be assigned during an inspection. Include an admin interface for managing these types, that can also be assigned on a per-category basis, currently available to the Oxfordshire cobrand. (Also include 'TM' in traffic management Exor RDI output.)
* Store user object when deleting report.Matthew Somerville2017-03-14-1/+2
|
* Allow superuser to leave update when inspecting.Matthew Somerville2017-03-10-1/+2
|
* [Oxfordshire] Add Exor RDI file download featureDave Arter2017-02-15-1/+1
| | | | | | | | | | The RDI file format encapsulates information about inspections that have taken place, and can be uploaded into Exor to create defects in bulk. This commit adds a page to the Oxfordshire cobrand's admin allowing RDI files to be generated and downloaded from FMS. For mysociety/fixmystreetforcouncils#127
* Allow cobrands to control which states affect reputationDave Arter2017-02-15-1/+3
| | | | | | | | | | | | Rather than assigning +1 to a user's reputation every time a report is inspected, this allows cobrands to specify which states should increment or decrement the reputation value when a report is inspected. The default behaviour is for reputation to never be changed, but the Oxfordshire cobrand will increment the reputation when a report is marked as 'action scheduled'. For mysociety/fixmystreetforcouncils#119
* Clarify ‘inspected’ behaviourDave Arter2017-02-15-5/+10
| | | | | | A report is now considered 'inspected' if its state was changed by an inspector. Additionally, an AdminLog entry is created so the time of inspection and inspector can be recorded.
* Redirect to shortlist if user has shortlist perms.Matthew Somerville2017-01-24-0/+6
| | | | | Assume that if they inspect and save a report, they want to go back to their shortlist.
* Merge branch 'issues/forcouncils/20-offline-inspecting'Matthew Somerville2016-12-16-2/+6
|\
| * Add offline storing of inspect forms.Matthew Somerville2016-12-16-2/+6
| | | | | | | | | | | | | | | | | | | | This allows the inspect form to be submitted when offline, with the data saved in localStorage, the number of saved forms shown in the banner, and the forms to be uploaded when back online. It copes if you go back to a report after having submitted the form, and if the back-online submission fails due to CSRF failure, retrying once with a new token.
* | Merge branch 'issues/forcouncils/108-pick-up-a-priority'Matthew Somerville2016-12-15-4/+27
|\ \ | |/ |/|
| * Update priorities in inspect form on cat. change.Matthew Somerville2016-12-15-4/+27
| | | | | | | | | | Different categories may have a different list of priorities, so store them all and update as the category changes.
* | Make it clearer that report is closed when marked as duplicateDave Arter2016-12-13-0/+7
| | | | | | | | | | | | - Record state change when leaving update and marking as duplicate - Change save button wording to match problem state when inspecting - Make it clearer that updates marking a report as duplicate actually close the report
* | Display nearby candidate reports when marking as duplicateDave Arter2016-12-13-9/+11
| | | | | | | | | | | | | | | | - Use Problem->pin_data for single report page - Promote markers_highlight to fixmystreet.maps API We want to highlight map pins on the duplicate report selection UI, so let's use what's already there instead of writing something new. - Make sure duplicate report pins aren’t draggable
* | Use nearby problems for duplicate suggestions instead of bounding box of mapDave Arter2016-12-13-0/+26
| |
* | Add test for correct display of duplicate reportDave Arter2016-12-13-0/+3
| |
* | Store and display selected duplicate reportDave Arter2016-12-13-1/+1
|/
* Update problem lastupdate column on inspect save.Matthew Somerville2016-12-02-0/+1
|
* Redirect to correct cobrand when category changed.Dave Arter2016-10-26-1/+11
|
* Have report page show inspect form if available.Matthew Somerville2016-10-24-19/+13
|
* Merge branch 'issues/forcouncils/36-mobile-inspector-improvements'Matthew Somerville2016-10-04-2/+11
|\
| * Handle extra field updates on report inspect pageDave Arter2016-10-04-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to make sure the extra metadata stored on a problem is kept in sync with the requirements of the category the report is in. Thus, if a report is moved to a category that collects extra metadata then the appropriate input fields should be shown so the inspector can enter the data. This commit shows the category extra HTML elements for every selectable category on the inspector page hiding those that don't apply to the selected category. JS is used to show/hide the extra fields when the category dropdown is changed. A consequence of the implementation is that any extra metadata from the original category is lost when the category is changed. Some thought was given to storing the old values elsewhere in the problem's extra field but I decided against this for the time being. For mysociety/fixmystreetforcouncils#45
| * Remove separate “Public update” form sectionZarino Zappia2016-10-04-1/+1
| | | | | | | | | | | | Inspectors can now tick the optional “Save with a public update” checkbox, to reveal the “Public update” textarea. This means there is no longer a need for two separate submit buttons.
| * Restructure Inspect form into logical sectionsZarino Zappia2016-10-04-1/+1
| | | | | | | | | | | | | | | | IDs and locations at the top, then location-related actions (including a new “navigate to this problem” button), then status and category inputs (since these can have an effect on how we display the rest of the form), then any status/category-related inputs, and finally inputs for internal details like priority and traffic management.
* | Update user reputation when inspecting reportDave Arter2016-09-23-0/+7
|/
* Remove from_body requirement from User::has_permission_toDave Arter2016-09-20-2/+2
|
* Require inspector to provide update when instructing reportDave Arter2016-09-12-3/+26
| | | | | | | This adds an update field to the bottom of the inspect form, requiring the inspector to provide an update to be added to the report as it's sent. See mysociety/fixmystreetforcouncils#64
* Add manage screen for editing priority/category.Matthew Somerville2016-09-09-23/+35
| | | | | | | This is a cut-down version of the full inspect screen. We truncate the co-ordinates just in case (they should be anyway but e.g. the test report isn't).
* Refactor problem response priority into its own modelDave Arter2016-09-09-12/+3
| | | | | | | This moves the response priority values from a cobrand-specific method to a full DB model, and includes management screens in the admin for administering them. For mysociety/fixmystreetforcouncils#66
* Add ‘Inspection required’ field to categoriesDave Arter2016-09-09-1/+5
| | | | | | | | | | | Categories can now require reports to be marked as 'inspected' via the frontend before they're sent by send-reports. A side-effect here is that send-reports will perform an extra n queries for each report, where n is the number of bodies that report is being sent to, but hopefully in practice this won't matter as it's an offline cronjob. See mysociety/fixmystreetforcouncils#50
* Add inspector report detail viewDave Arter2016-09-06-3/+95
| | | | | | | | | | | | | Users with the `report_inspect` permission can click a new 'inspect' button on a report page to input more detailed problem information into a new form that appears in a column alongside the report detail. - Inspector data is stored in problem's 'extra' field - Report category/state can be edited - Location can be changed by dragging the pin or HTML5 geolocation (Factored out Zurich admin pin drag into own function) For mysociety/fixmystreetforcouncils#22
* Add static map output view for a report.Matthew Somerville2016-08-01-0/+11
|
* Improve CSRF tokens and add to more forms.Matthew Somerville2016-06-20-0/+3
|
* Improve in-place moderation UIZarino Zappia2016-05-18-0/+11
| | | | | | | | | | | This rearranges the moderation UI into logical chunks, and improves the 'revert to original' checkboxes by: - hiding them unless there's some original text to revert to - displaying the text that will be reverted to in the appropriate input fields when checked. Part of mysociety/FixMyStreet-Commercial#731
* Remove final web/fixmystreet templates.Matthew Somerville2016-04-20-1/+1
| | | | And associated, e.g. nothing references fixmystreet-old-box.js any more.
* Switch to JSON::MaybeXS, remove JSON::XS.Matthew Somerville2016-01-22-1/+3
| | | | | | Travis has Cpanel::JSON::XS preinstalled, which means that the build would fail there, as JSON::MaybeXS would try and upgrade JSON::XS to version 3 which the snapshot did not contain.
* [Zurich] additional closure statuses workHakim Cassimally2015-10-06-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Requirements: ============= 1: DM to be able to mark a problem as Wish, Extern, Not contactable, Hidden, Jurisdiction unknown 2: SDM to be able to mark a problem as Not contactable. 3: DM to be able to add information to such a problem, and trigger emails to external agencies, and to user, closing the problem at the same time. 4: Closed reports must be categorized as Wish/Extern/NC/Hidden/JU for statistical reporting 5: Non-closed reports must appear as open, to allow DM to see them in the list, similar to what is currently done for Ruckmeldung Ausstehend (Feedback outstanding). 5b: however "Hidden" problems must be immediately hidden from public view. Proposal: ========= a) Requirement 1 will be carried out in exactly the same way by DM. e.g. Category dropdown select b) Requirement 2 will be carried out in exactly the same way by SDM. e.g. "Not contactable" button c) BUT, for a), c), the category will be diverted to "Ruckmeldung Ausstehend" (Feedback outstanding), and metadata will be saved with the appropriate closure type. d) NOTE: this means the report will still be visible to public as "In bearbeitung" (Except for Hidden reports, as per 5b) e) The extra fields will be presented on the "Ruckmeldung Ausstehend" page, just as defined in the PDF, depending on the metadata. e.g. - Wish: Zustaendige Stelle + Message - Extern: External body + Message2 - Not contactable: (no extra info) - Hidden: (no extra info) - Jurisdiction unknown: (no extra info) f) When the DM publishes the answer (e.g. "Antwort Veroeffentlichen" button), the state will normally change to Fixed. BUT in the new cases, the metadata saved in step c) will be checked, and the report will change state to Wish/Extern/Not contactable/Hidden/Jurisdiction unknown, as appropriate. The report will now be visible/hidden as previously discussed depending on the new state. g) If the report is edited again (in /admin/report_edit) it will be in the relevant state, and any extra fields will be visible as per e). Those fields may be updated. Alternatively, the state may be changed, possibly triggering a) again, and clearing any metadata. - Fix javascript interactions 690 - show new statuses in summary - fix photos on SDM page - fix Planned => Planned+metadata transition - stop "assignation .select" js affecting templates - fix redirection for Extern and generally See mysociety/FixMyStreet-Commercial#672, mysociety/FixMyStreet-Commercial#690
* [Zurich] new status flagsHakim Cassimally2015-10-06-3/+10
| | | | | | | Have moved the generation of banner text from the template into problem_as_hashref See mysociety/FixMyStreet-Commercial#672
* Remove remaining hardcoded site name from strings.Matthew Somerville2015-09-28-2/+1
| | | | Add a site_name template parameter available to all templates.
* Remove ms_current_timestamp() override function.Matthew Somerville2015-08-13-1/+1
| | | | | This override is not used anywhere, it dates from a very old long-gone test script, and causes issues with database query planning.
* Alter token logging in and timeout behaviour.Matthew Somerville2015-07-10-0/+4
| | | | | | | Restrict email_sign_in token to one day, unused confirmation tokens to one month. Used tokens will redirect to the created thing but not log in; don't log in with alert links (unsubscribe link never expires, reply link will still show "reopen" tickbox).
* Factor out all uses of param()/params.Matthew Somerville2015-07-07-3/+3
| | | | | | | Use a central get_param and get_param_list functions dependent on whether we're after a scalar or a list (almost always a scalar). This prevents any possibility of confusion where param() could return a list, or params->{} an arrayref.
* Always show confirmation page for reports/updates.Matthew Somerville2015-02-19-3/+0
| | | | | Rather than redirecting to the report if they're already logged in. Fixes #1003.
* Make sure all co-ordinates are stringified.Matthew Somerville2015-02-13-1/+1
| | | | | | | This includes MapIt postcode lookups, geocoding, query parameters, tile clicks. Stringifying truncates them to six decimal places, which means we no longer need any "short" versions anywhere, and the JSON response will always uses a decimal point regardless of locale.
* Move site_title function to site-name web templateMatthew Somerville2015-01-19-1/+2
| | | | | | | This matches the email template behaviour, and makes it much easier to override without requiring a cobrand package file. Fixes #979.
* Move bromley from report hiding to moderationHakim Cassimally2014-08-14-0/+13
| | | | | | | | | The feature to hide reports is still enabled, as it is used by other `users_can_hide` bodies. As we want to roll out moderation to Bromley, in this commit we hide the functionality *only* for Bromley. Of course if we migrate those other users to this moderation method, then we will need to make equivalent change to general template, and remove the functionality from Report.pm.
* alter pave url sent to analytics on report completionStruan Donald2014-04-16-0/+3
| | | | | | | | | | | | | | | | In order to allow us to do funnel analysis in google analytics we need to send a differnt page url when a user completes a report. To do this we add a report_created=1 to the query string on either the report page or the report confirmation page for logged in and confirm by email users respectively. There's a bit of complication as we don't want to set a session cookie everywhere as that will break caching so we set a stash variable, although if the user is logged in this is controlled by a variable in the flash as there is already a session cookie at this point. also, removes the code that sends an event upon report completion as this was no use for funnel analysis.
* Allow cobrands to set their own path to pin filesHakim Cassimally2014-03-25-1/+1
| | | | | | | | | New cobrand function of pin_path that sets the path to where the image files for pins are located. Defaults to /i This still means they need to use the same file names but they can at least put those in a cobrand directory rather than having to overwrite the files in /i or fudge it with pin_colour