View | Details | Raw Unified | Return to bug 37077
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-4 / +8 lines)
Lines 882-888 Link Here
882
                                                <label for="sql_params_[% sql_param.labelid | html %]">[% sql_param.entry | html %]:</label>
882
                                                <label for="sql_params_[% sql_param.labelid | html %]">[% sql_param.entry | html %]:</label>
883
                                                [% IF (sql_param.select_multiple) %]
883
                                                [% IF (sql_param.select_multiple) %]
884
                                                    <select name="[%- sql_param.input.name | html -%]" tabindex="1"  id="[%- sql_param.input.id | html -%]" multiple>
884
                                                    <select name="[%- sql_param.input.name | html -%]" tabindex="1"  id="[%- sql_param.input.id | html -%]" multiple>
885
                                                        <option value="null" hidden></option>
885
                                                        <option value="%" hidden></option>
886
                                                [% ELSE %]
886
                                                [% ELSE %]
887
                                                    <select name="[%- sql_param.input.name | html -%]" tabindex="1"  id="[%- sql_param.input.id | html -%]">
887
                                                    <select name="[%- sql_param.input.name | html -%]" tabindex="1"  id="[%- sql_param.input.id | html -%]">
888
                                                [% END %]
888
                                                [% END %]
Lines 1581-1588 Link Here
1581
1581
1582
            $('#report_param_form').on('submit', function(e) {
1582
            $('#report_param_form').on('submit', function(e) {
1583
                $('#report_param_form').find('select[multiple]').each( function (i) {
1583
                $('#report_param_form').find('select[multiple]').each( function (i) {
1584
                    var $selected = $('option:first', this).val();
1584
                    if( $(this).find('option:selected').length === 0 ) {
1585
                    $(this).val($selected);
1585
                        $(this).val(['%']);
1586
                    }
1587
                    else if( $(this).find('option:selected').length > 1 ) {                    
1588
                        var $selected = $('option:first', this).val();
1589
                        $(this).val($selected);
1590
                    }  
1586
                });
1591
                });
1587
            });
1592
            });
1588
        }
1593
        }
1589
- 

Return to bug 37077