From f12db48a1bfd4a5c90672d00a29722972733a1c4 Mon Sep 17 00:00:00 2001 From: Brendan Lawlor Date: Thu, 6 Jun 2024 19:49:47 +0000 Subject: [PATCH] Bug 37050: Add select2 to SQL reports multi select This patch adds select 2 to modifies multi-select parameter fields in SQL reports to use the select2 framework. If no selections are made for a multi select parameter all values will be used by default. To test: 1. Apply patch 2. Go to Reports and create a report from SQL select * from items where homebranch in <> and itype in <> 3. Run the report making multiple selections for each parameter 4. Run the report making multiple selections for one parameter and no selections in another parameter 5. Check that the results are as you would expect 6. On the results page click 'Show SQL code' 7. Confirm that the codes are included according to your selections 8. Note that when no selections are made for a parameter all codes are used by defaut. This allows the query to run when no selections are made instead of causing an error. It allows reports to be written where a multi select parameter is optional. --- .../modules/reports/guided_reports_start.tt | 25 ++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 50f7a65a4f..7378b2ef5e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -882,7 +882,6 @@ [% IF (sql_param.select_multiple) %] [% END %] @@ -1567,12 +1566,14 @@ [% Asset.js( "lib/codemirror/highlight.js" ) | $raw %] [% Asset.css("lib/codemirror/highlight.css") | $raw %] [% Asset.js( "js/mana.js" ) | $raw %] + [% INCLUDE 'select2.inc' %]