From 20c0d1d46ea7fead8baaafe2a900f760e3dbd3da Mon Sep 17 00:00:00 2001 From: Brendan Lawlor Date: Wed, 29 Jan 2025 20:27:27 +0000 Subject: [PATCH] Bug 37050: Add select2 to SQL reports multiselect This patch adds select 2 to multi-select parameter fields in SQL reports. If no selections are made for a multi-select all authorised values will be used by default. This allows reports to be written where a multi select parameter is optional. 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 and making single 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 Sponsored-by: CLAMS --- koha-tmpl/intranet-tmpl/prog/css/select2.css | 5 +++ .../modules/reports/guided_reports_start.tt | 31 +++++++++++-------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/select2.css b/koha-tmpl/intranet-tmpl/prog/css/select2.css index 8046026ea5..6880eaa3c0 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/select2.css +++ b/koha-tmpl/intranet-tmpl/prog/css/select2.css @@ -44,3 +44,8 @@ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove { margin-right: 3px; } + +.select2-container--default .select2-selection--multiple .select2-selection__rendered li { + clear: none; + width: auto; +} \ No newline at end of file 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 cdba5aad88..499dc11dbc 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,7 @@ [% IF (sql_param.select_multiple) %] [% END %] @@ -1576,25 +1576,23 @@ [% Asset.css("lib/codemirror/highlight.css") | $raw %] [% Asset.js( "js/mana.js" ) | $raw %] [% Asset.js("js/form-submit.js") | $raw %] + [% INCLUDE 'select2.inc' %]