Bug 27644: Add button to SQL report editor for inserting runtime parameters
authorOwen Leonard <oleonard@myacpl.org>
Fri, 5 Feb 2021 18:28:15 +0000 (18:28 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 21 Apr 2021 13:25:07 +0000 (15:25 +0200)
commitc9a15b73f01796e1f6f71e5eca8efbee94958af5
tree3f8a1dd8905585d8d9ac011c5b41b7b214b3e17d
parent08c575f8d6e3fafae8ba455404429d7446d768c8
Bug 27644: Add button to SQL report editor for inserting runtime parameters

This patch adds a button menu to the SQL report CodeMirror editor for
inserting runtime parameters. Each menu item triggers a modal dialog
where the user can specify a parameter label and any other relevant
option.

To test, apply the patch and rebuild the staff client CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

- Go to Reports -> Use saved.
- Create or edit a report.
- You should see a menu button above the SQL editor field, "Insert
  runtime parameter."
- The menu should contain the options "Authorized value," "Date," "Item
  types," "Libraries," "Patron categories," and "Text field."
- Test each option. Each should trigger the display of a modal dialog
  with a heading which corresponds to your choice.
- In all cases except the "Authorized value" choice you should see a
  single form field for "label."
- Enter text in the label field and click the "Insert parameter" button.
- The correct runtime parameter should be inserted into the SQL editor.
  - If you placed a cursor somewhere in the SQL editor first, your
    parameter should be inserted in that location in the editor.
  - If you selected some text in the editor before selecting a
    parameter, the paramter should replace the selected text.
- In the case of the "Authorized value" selection, the modal dialog
  should include both a label field and a field for choosing an
  authorized value category.
- Try submitting the form without selecting an authorized value. It
  should warn you that the field is required.
- After testing the authorized value selection, try inserting another
  parameter to confirm that the authorized value selection (now hidden)
  is no longer required.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt