Bugzilla – Attachment 171959 Details for
Bug 37050
Add select2 to SQL report multi select
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37050: (follow-up) Add select2 to SQL reports multiselect
Bug-37050-follow-up-Add-select2-to-SQL-reports-mul.patch (text/plain), 3.52 KB, created by
Biblibre Sandboxes
on 2024-09-25 21:58:09 UTC
(
hide
)
Description:
Bug 37050: (follow-up) Add select2 to SQL reports multiselect
Filename:
MIME Type:
Creator:
Biblibre Sandboxes
Created:
2024-09-25 21:58:09 UTC
Size:
3.52 KB
patch
obsolete
>From 8ddb242cc6b64120a396bc3d49ab51fa2579bed2 Mon Sep 17 00:00:00 2001 >From: Brendan Lawlor <blawlor@clamsnet.org> >Date: Tue, 10 Sep 2024 21:02:53 +0000 >Subject: [PATCH] Bug 37050: (follow-up) Add select2 to SQL reports multiselect > >Rebase for changes made on bug 37077 >This patch removes some javascript in favor of an update to the template. >The default value for multi select parameter's is a newline separated list >so that report results are not limited when no selections are made. > >Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu> >--- > .../en/modules/reports/guided_reports_start.tt | 18 ++---------------- > 1 file changed, 2 insertions(+), 16 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 e1f070f844..fde986a36b 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 >@@ -881,7 +881,7 @@ > <label for="sql_params_[% sql_param.labelid | html %]">[% sql_param.entry | html %]:</label> > [% IF (sql_param.select_multiple) %] > <select name="[%- sql_param.input.name | html -%]" tabindex="1" id="[%- sql_param.input.id | html -%]" multiple> >- <option value="%" hidden></option> >+ <option value="[% sql_param.input.values.join("\n") | html %]" hidden></option> > [% ELSE %] > <select name="[%- sql_param.input.name | html -%]" tabindex="1" id="[%- sql_param.input.id | html -%]"> > [% END %] >@@ -1582,7 +1582,6 @@ > // if the report param form has multiselects override default form submission > if( $('#report_param_form').find('select[multiple]').length ) { > $('#report_param_form').find('select[multiple]').each( function (i) { >- $(this).prepend('<option hidden></option>'); > $(this).on('change', function() { > var $selected = $(this).val().join('\n'); > $(this).find('option:first').val($selected); >@@ -1591,20 +1590,7 @@ > > $('#report_param_form').on('submit', function(e) { > $('#report_param_form').find('select[multiple]').each( function (i) { >- if( $(this).find('option:selected').length ) { >- var $selected = $('option:first', this).val(); >- $(this).val($selected); >- } >- else { >- let values = $.map( $(this).find('option'), function(o) { >- return $(o).val(); >- }).slice(1).join('\n'); >- $(this).find('option:first').val(values).prop('selected', true); >- } >- if( $(this).find('option:selected').length === 0 ) { >- $(this).val(['%']); >- } >- else if( $(this).find('option:selected').length > 1 ) { >+ if( $(this).find('option:selected').length != 1 ) { > var $selected = $('option:first', this).val(); > $(this).val($selected); > } >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37050
:
167555
|
167659
|
167838
|
167839
|
167840
|
167841
|
169750
|
169751
|
169818
|
169819
|
171340
|
171341
|
171342
|
171957
|
171958
|
171959
|
177320
|
179669
|
179728