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

(-)a/C4/Reports/Guided.pm (-1 / +1 lines)
Lines 974-980 sub GetParametersFromSQL { Link Here
974
974
975
    for ( my $i = 0; $i < ($#split/2) ; $i++ ) {
975
    for ( my $i = 0; $i < ($#split/2) ; $i++ ) {
976
        my ($name,$authval) = split(/\|/,$split[$i*2+1]);
976
        my ($name,$authval) = split(/\|/,$split[$i*2+1]);
977
        $authval =~ s/\:all$// if $authval;
977
        $authval =~ s/\:all$|\:in$// if $authval;
978
        push @sql_parameters, { 'name' => $name, 'authval' => $authval };
978
        push @sql_parameters, { 'name' => $name, 'authval' => $authval };
979
    }
979
    }
980
980
(-)a/Koha/Report.pm (-1 / +1 lines)
Lines 169-175 sub prep_report { Link Here
169
        #        }
169
        #        }
170
        #    ) if $quoted;
170
        #    ) if $quoted;
171
        #}
171
        #}
172
        unless ( $split[ $i * 2 + 1 ] =~ /\|\s*list\s*$/ && $quoted ) {
172
        unless ( $split[ $i * 2 + 1 ] =~ /\|\s*list\s*$|\s*\:in\s*$/ && $quoted ) {
173
            $quoted = C4::Context->dbh->quote($quoted);
173
            $quoted = C4::Context->dbh->quote($quoted);
174
        }
174
        }
175
        else {
175
        else {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (-2 / +22 lines)
Lines 843-849 Link Here
843
                [% END # /IF ( warn_authval_problem )%]
843
                [% END # /IF ( warn_authval_problem )%]
844
844
845
                [% IF ( enter_params ) %]
845
                [% IF ( enter_params ) %]
846
                    <form action='/cgi-bin/koha/reports/guided_reports.pl'>
846
                    <form action='/cgi-bin/koha/reports/guided_reports.pl' id='report_param_form'>
847
                        <input type='hidden' name='reports' value="[% reports | html %]" />
847
                        <input type='hidden' name='reports' value="[% reports | html %]" />
848
                        [% IF ( auth_val_error ) %]
848
                        [% IF ( auth_val_error ) %]
849
                            <input type='hidden' name='phase' value='Edit SQL' />
849
                            <input type='hidden' name='phase' value='Edit SQL' />
Lines 884-893 Link Here
884
                                        [% ELSE %]
884
                                        [% ELSE %]
885
                                            <li>
885
                                            <li>
886
                                                <label for="sql_params_[% sql_param.labelid | html %]">[% sql_param.entry | html %]:</label>
886
                                                <label for="sql_params_[% sql_param.labelid | html %]">[% sql_param.entry | html %]:</label>
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 -%]" [%- sql_param.select_multiple | html -%]>
888
                                                    [% IF (sql_param.include_all) %]
888
                                                    [% IF (sql_param.include_all) %]
889
                                                        <option value="%">All</option>
889
                                                        <option value="%">All</option>
890
                                                    [% END %]
890
                                                    [% END %]
891
                                                    [% IF (sql_param.select_multiple) %]
892
                                                        <option value="null" hidden></option>
893
                                                    [% END %]
891
                                                    [% FOREACH value IN sql_param.input.values %]
894
                                                    [% FOREACH value IN sql_param.input.values %]
892
                                                        <option value="[%- value | html -%]">[%- sql_param.input.labels.$value | html -%]</option>
895
                                                        <option value="[%- value | html -%]">[%- sql_param.input.labels.$value | html -%]</option>
893
                                                    [% END %]
896
                                                    [% END %]
Lines 1536-1541 Link Here
1536
1539
1537
    <script>
1540
    <script>
1538
1541
1542
        //  if the report param form has multiselects override default form submission
1543
        if( $('#report_param_form').find('select[multiple]').length ) {
1544
            $('#report_param_form').find('select[multiple]').each( function (i) {
1545
                $(this).on('change', function() {
1546
                    var $selected = $(this).val().join('\n');
1547
                    $(this).find('option:first').val($selected);
1548
                });
1549
            });
1550
1551
            $('#report_param_form').on('submit', function(e) {
1552
                $('#report_param_form').find('select[multiple]').each( function (i) {
1553
                    var $selected = $('option:first', this).val();
1554
                    $(this).val($selected);
1555
                });
1556
            });
1557
        }
1558
1539
        function hide_bar_element() {
1559
        function hide_bar_element() {
1540
            $('#chart-column-horizontal').hide()
1560
            $('#chart-column-horizontal').hide()
1541
            $('.chart-column-group').each(function( index ) {
1561
            $('.chart-column-group').each(function( index ) {
(-)a/reports/guided_reports.pl (-3 / +9 lines)
Lines 710-716 elsif ($phase eq 'Run this report'){ Link Here
710
                if( defined $uniq_params{$text.$sep.$authorised_value_all} ){
710
                if( defined $uniq_params{$text.$sep.$authorised_value_all} ){
711
                    next;
711
                    next;
712
                } else { $uniq_params{$text.$sep.$authorised_value_all} = "$i"; }
712
                } else { $uniq_params{$text.$sep.$authorised_value_all} = "$i"; }
713
                my ($authorised_value, $all) = split /:/, $authorised_value_all;
713
                my ($authorised_value, $param_options) = split /:/, $authorised_value_all;
714
                my $all;
715
                my $multiple;
716
                if ( $param_options eq "all" ) {
717
                    $all = "all";
718
                } elsif ( $param_options eq "in" ) {
719
                    $multiple = "multiple";
720
                }
714
                my $input;
721
                my $input;
715
                my $labelid;
722
                my $labelid;
716
                if ( not defined $authorised_value ) {
723
                if ( not defined $authorised_value ) {
Lines 829-835 elsif ($phase eq 'Run this report'){ Link Here
829
                    };
836
                    };
830
                }
837
                }
831
838
832
                push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid, 'name' => $text.$sep.$authorised_value_all, 'include_all' => $all };
839
                push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid, 'name' => $text.$sep.$authorised_value_all, 'include_all' => $all, 'select_multiple' => $multiple };
833
            }
840
            }
834
            $template->param('sql'         => $sql,
841
            $template->param('sql'         => $sql,
835
                            'name'         => $name,
842
                            'name'         => $name,
836
- 

Return to bug 35746