aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/Cobrand/Zurich.pm
Commit message (Collapse)AuthorAgeLines
* Use default link zoom for all map types.Matthew Somerville2016-10-21-8/+1
| | | | [Bristol] Use more zoomed-in default link zoom.
* [Zurich] Call add_links filter correctlyDave Arter2016-09-06-2/+2
| | | | Fixes a bug with updates not being displayed correctly in the app.
* [Zurich] Send admin emails from the do-not-reply addressDave Arter2016-07-28-4/+3
| | | | | Also takes the opportunity to fix the incorrectly-encoded sender name which was appearing to some clients as "Züri Wie Neu".
* Use normal user authentication to control access to /adminMatthew Somerville2016-07-19-0/+6
| | | | | | | | | - Adds is_superuser flag to User - Logged-in user must be a superuser or have from_body set in order to access anything within /admin - has_permission_to on a superuser will always return true - Only superusers can create/grant superusers - New `createsuperuser` command for creating superusers
* [Zurich] Don’t include unpublished photos in CSV exportDave Arter2016-07-08-1/+1
|
* Improve CSRF tokens and add to more forms.Matthew Somerville2016-06-20-3/+3
|
* Use only one templating system for emails.Matthew Somerville2016-05-25-8/+0
| | | | | | | Historically, emails sent offline (alerts, questionnaires, etc) used a different templating system from those sent by the website (e.g. login emails), though the newer system was also being used for the site name and signature of offline emails.
* Add PNG image support.Matthew Somerville2016-04-08-4/+5
| | | | | | | 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.
* Refactor email handling to use Email::MIME alone.Matthew Somerville2016-03-30-1/+1
|
* Only load images from disk when needed.Matthew Somerville2016-02-23-7/+5
| | | | Fixes #1337.
* Factor multiple photo details into nicer function.Matthew Somerville2016-01-12-1/+1
| | | | | Remove get_photo_params, which only looked at the first photo, make explicit when we're doing that using `.first`.
* Merge branch 'reduce-fixmystreet-app'Matthew Somerville2015-12-02-3/+3
|\
| * Reduce use of FixMyStreet::App.Matthew Somerville2015-12-02-3/+3
| | | | | | | | Command line scripts don't need a full blown app, just database.
* | [Zurich] Include problem extra fields in CSV downloadDave Arter2015-11-18-1/+14
| | | | | | | | | | Some categories ask the user for extra information such as street or house number; these are output in the CSV if the report includes them.
* | [Zurich] Generate the CSV header the same way as normal rowsDave Arter2015-11-18-1/+29
| |
* | [Zurich] Add 'closure status' to admin report CSVDave Arter2015-11-18-2/+4
|/
* [Zurich] Use FMS::App->get_param() instead of req->paramDave Arter2015-10-06-10/+10
|
* [Zurich] Set report's public response before sending email to userDave Arter2015-10-06-5/+5
| | | | | | | | The 'public response' to a problem was being omitted from the email sent to the user when the problem is closed, because the email was sent before the report's 'extra' field was updated with the response body text. This commit sets the public response on the problem before sending the email.
* [Zurich] Don't include external messages in a report's internal notices sectionDave Arter2015-10-06-0/+2
| | | | See mysociety/FixMyStreet-Commercial#674, mysociety/FixMyStreet-Commercial#673
* [Zurich] Display message sent to user when report is closedDave Arter2015-10-06-5/+16
| | | | | | On the report admin page, include the message the user received when the report was closed. See mysociety/FixMyStreet-Commercial#718
* [Zurich] Keep DM on report edit page after closing reportDave Arter2015-10-06-2/+2
| | | | See mysociety/FixMyStreet-Commercial#690
* [Zurich] Make sure external/competent body message is savedDave Arter2015-10-06-1/+5
| | | | | | | - Only send external_message when the problem state has the correct value - But make sure the message is preserved for editing when problem state is 'planned' See mysociety/FixMyStreet-Commercial#718
* [Zurich] UI improvements for DM/SDM report edit adminZarino Zappia2015-10-06-4/+4
| | | | | | | | | | | - Styling for "Updated!" message The message shown on form submission no longer pushes both columns down, and disappears after 5 seconds. - Make "time spent" labels inline to save space - Simplify display of report admin category dropdown - Change order of report admin inputs for Division Managers See mysociety/FixMyStreet-Commercial#690
* [Zurich] Tweaks to redirectHakim Cassimally2015-10-06-19/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See mysociety/FixMyStreet-Commercial#690 I understand redirection to summary page was introduced at ZWN's request, to make it easy to process reports and then quickly move onto the next one. However, during testing now, Tobias has mentioned this is a) slowing things down and b) confusing because it's not obvious that the report has been saved. I've tried to address (b) by adding the "Aktualisiert!" message when you are redirected. Also, for (a) I've removed the redirection from a few cases, and disabled it for superuser. If need be, I can remove redirection from more (or all) cases. Fix Official answer/Reply to user - hide label for status update on state change - correct wording on button for closure (single wording) - correct wording on label for user reply (either "Official answer" or "Reply to user" as appropriate) - Make sure the official response texts are shown for edit/static as appropriate, and test. - javascript improvements - honour public status update for Extern/Wunsch too - don't show public message for Wunsch - Ignore all other fields when rotating photos. (See mysociety/FixMyStreet-Commercial#718)
* [Zurich] additional closure statuses workHakim Cassimally2015-10-06-53/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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] Updated email templatesMatthew Somerville2015-10-06-0/+10
| | | | | | | - submit-external-wish.txt includes a link with report's coordinates, template values are interpolated Conflicts: perllib/FixMyStreet/SendReport/Zurich.pm
* [Zurich] admin workflow changes available statesHakim Cassimally2015-10-06-11/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | See mysociety/FixMyStreet-Commercial#690 - external_message for Extern/Wunsch states - as per PDF mockups, the "public response" field is now editable from more states, namely: - Ruckmeldung ausstehend - Extern - Zustandigkeit unbekannt - Wunsch - Nicht kontaktierbar - Unsichtbar - test fixes NB: slight hack to reorder Zurich report_display tests As these remove 'investigating' from hidden_states, these break tests for default cobrand (the FMS::App code expects to be called once on request start, not multiple times within one test) - Not contactable button and tests for this and the similar `send_back` functionality (previously untested). NB: Unsure why we need to specify form_number=2 just for these submits, but test won't find the buttons otherwise. - Make sure SDMs' "time_spent" figure is recorded. (See mysociety/FixMyStreet-Commercial#718)
* [Zurich] new status flagsHakim Cassimally2015-10-06-0/+19
| | | | | | | Have moved the generation of banner text from the template into problem_as_hashref See mysociety/FixMyStreet-Commercial#672
* [Zurich] prevent invalid bodies_strHakim Cassimally2015-10-06-0/+2
| | | | | | | | See issue in mysociety/FixMyStreet-Commercial#663 with problems not appearing in the "Erfasst" filter. It looks like Zurich requires a single id in the `bodies_str` (like '4'), and may rely on the configuration of bodies/contacts in database to be perfect to avoid them becoming something like '4|47,48'.
* Add "time spent" admin logging.Hakim Cassimally2015-10-06-4/+50
| | | | | | | | | | | | | | | | | | | | | Mechanism is general, but current implementation only used for Zurich. - Zurich: Record time_spent field mysociety/FixMyStreet-Commercial#676 - template changes (including jQuery spinner) - backend changes to save data are made: - in log_edit, if supplied - and time on category change (and arbitrary actions) - Add update_admin_log to all paths for DM, ensuring that it gets called, while resetting the `time_spent` parameter, to make sure that there is never a duplicate record created. - Also quell warning about using DateTime values in query. - Also add (seemingly unrelated) parens to stop misparsing of OK line in questionnaire test now that DT::Format::Pg is used in Zurich cobrand See mysociety/FixMyStreet-Commercial#676
* [Zurich] Response templates for report admin.Hakim Cassimally2015-10-06-1/+3
| | | | | | | This provides a ResponseTemplate model that an admin/staff user can choose from when responding to problems. For mysociety/FixMyStreet-Commercial#671.
* [Zurich] Attach images to external bodyHakim Cassimally2015-10-06-1/+27
| | | | See mysociety/FixMyStreet-Commercial#675
* [Zurich] Make stats export media column blank if no photo.Hakim Cassimally2015-10-06-1/+4
|
* [Zurich] reduce number of pins on /reportsHakim Cassimally2015-10-06-0/+2
| | | | | For mobile, but should be done via same mechanism. See mysociety/FixMyStreet-Commercial#670
* [Zurich] Provide a setup-contacts command.Hakim Cassimally2015-10-06-0/+95
| | | | | | | | | | | | | for Zurich (and generic data), progressing mysociety/FixMyStreet-Commercial/issues/663, to provide a way for body/contact config to be consistent across dev/staging/live. Run like so: bin/setup-contacts zurich e.g. with the lower-case sigil describing the cobrand to run setup-contacts for.
* [Zurich] Vary confirmation email wording if address is confirmedHakim Cassimally2015-10-06-0/+9
| | | | See mysociety/FixMyStreet-Commercial#669
* [Zurich] all admin users can see statsHakim Cassimally2015-10-06-1/+2
| | | | | | | Admin CR4 https://github.com/mysociety/FixMyStreet-Commercial/issues/673 seems like admin_pages should be able to generate the menu, but this change also needs template change.
* 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.
* Factor out all uses of param()/params.Matthew Somerville2015-07-07-34/+34
| | | | | | | 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.
* [Zurich] add columns to stats exportHakim Cassimally2015-03-31-8/+38
| | | | | | | | | | | | | | | - Original Report description - Amended Report description (unsure what this is) - Media URL (currently one picture, in the future 1-3 pictures) - Interface used (see open311) - Requested datetime (see open311) (seems to be same as created) - Agency sent datetime (see open311) - Updated datetime (see open311) - Council-Response - title as per https://github.com/mysociety/FixMyStreet-Commercial/issues/678
* Add Extra role to ease use of {extra} field.Hakim Cassimally2015-03-20-27/+32
| | | | | | | | | Historically, the extra field has been used in two different ways by different cobrands, both as a list (e.g. Open311 category fields) and a hash (e.g. the Zurich cobrand). This commit consolidates usage, adding an API to make use of the field easier and always returning a hash for the code to use. Fixes #1018.
* Remove need to have to specify en-gb in LANGUAGES.Matthew Somerville2015-02-13-1/+1
| | | | | | Instead, add it if not present at the negotiation stage. Even if not negotiated, we currently need it to be present for the in_gb_locale() calls to work.
* Rename 'body_edit' admin endpoint to 'body'.Matthew Somerville2015-01-20-1/+0
|
* Change default email indentation to none.Matthew Somerville2014-03-17-2/+0
| | | | | This is very old, no-one seems to want/need it any more, and more than one reuser does not want it. Fixes #715.
* [Zurich] admin template to respect closed_overdueHakim Cassimally2013-12-20-2/+35
| | | | | | | | | | | | | This value is now cached, but the template calls the function, calculating it anew, so for old reports (closed within SLA) the problem_row.html template showed these as overdue. Instead, we point the template at a function which first checks the cached value. (Attempting to roll this functionality into the .overdue() method itself caused a fair amount of collateral test breakage, and it seems safest to extract the caching function for now.) Closes https://github.com/mysociety/FixMyStreet-Commercial/issues/462
* [Zurich] stats export include 'hidden'Hakim Cassimally2013-12-17-1/+1
| | | | | | | | | | See https://github.com/mysociety/FixMyStreet-Commercial/issues/461 Again, we just need to substitute the %params line (which elides hidden reports) for the less restrictive %date_params. This commit includes very basic tests for the previously untested ?export=1 functionality.
* [Zurich] also allow hidden reports for closed_overdueHakim Cassimally2013-12-10-1/+1
|
* [Zurich] fix moderated statistics to include hiddenHakim Cassimally2013-12-10-1/+1
| | | | | | As per comments after testing mysociety/FixMyStreet-Commercial#459, the business logic of the actual state changes is fine, but the stats do also then need to include hidden records.
* [Zurich] log admin changesHakim Cassimally2013-12-09-6/+13
| | | | | To allow us to infer additional stats changes requirements such as in mysociety/FixMyStreet-Commercial#459 better in future.
* [Zurich] test /admin/statsHakim Cassimally2013-12-09-0/+1
| | | | | | | First test that this page is only available to superuser. Then test that the moderated and fixed stats are doing something that is (hopefully) the spec in mysociety/FixMyStreet-Commercial#459