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

(-)a/C4/Reports/Guided.pm (+1 lines)
Lines 916-921 Returns a hash containig all reserved words Link Here
916
sub GetReservedAuthorisedValues {
916
sub GetReservedAuthorisedValues {
917
    my %reserved_authorised_values =
917
    my %reserved_authorised_values =
918
            map { $_ => 1 } ( 'date',
918
            map { $_ => 1 } ( 'date',
919
                              'list',
919
                              'branches',
920
                              'branches',
920
                              'itemtypes',
921
                              'itemtypes',
921
                              'cn_source',
922
                              'cn_source',
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt (+5 lines)
Lines 814-819 Link Here
814
                                                <label for="sql_params[% loop.count | html %]">[% sql_param.entry | html %]: </label>
814
                                                <label for="sql_params[% loop.count | html %]">[% sql_param.entry | html %]: </label>
815
                                                <input id="sql_params[% loop.count | html %]" type="text" name="sql_params" />
815
                                                <input id="sql_params[% loop.count | html %]" type="text" name="sql_params" />
816
                                            </li>
816
                                            </li>
817
                                        [% ELSIF ( sql_param.input == 'textarea' ) %]
818
                                            <li>
819
                                                <label for="sql_params[% loop.count | html %]">[% sql_param.entry | html %]: </label>
820
                                                <textarea id="sql_params[% loop.count | html %]" name="sql_params" rows="5"></textarea>
821
                                            </li>
817
                                        [% ELSE %]
822
                                        [% ELSE %]
818
                                            <li>
823
                                            <li>
819
                                                <label for="sql_params_[% sql_param.labelid | html %]">[% sql_param.entry | html %]:</label>
824
                                                <label for="sql_params_[% sql_param.labelid | html %]">[% sql_param.entry | html %]:</label>
(-)a/reports/guided_reports.pl (-3 / +14 lines)
Lines 220-226 elsif ( $phase eq 'Update SQL'){ Link Here
220
    my $cache_expiry_units = $input->param('cache_expiry_units');
220
    my $cache_expiry_units = $input->param('cache_expiry_units');
221
    my $public = $input->param('public');
221
    my $public = $input->param('public');
222
    my $save_anyway = $input->param('save_anyway');
222
    my $save_anyway = $input->param('save_anyway');
223
224
    my @errors;
223
    my @errors;
225
224
226
    # if we have the units, then we came from creating a report from SQL and thus need to handle converting units
225
    # if we have the units, then we came from creating a report from SQL and thus need to handle converting units
Lines 734-739 elsif ($phase eq 'Run this report'){ Link Here
734
                } elsif ( $authorised_value eq "date" ) {
733
                } elsif ( $authorised_value eq "date" ) {
735
                    # require a date, provide a date picker
734
                    # require a date, provide a date picker
736
                    $input = 'date';
735
                    $input = 'date';
736
                } elsif ( $authorised_value eq "list" ) {
737
                    # require a list, provide a textarea
738
                    $input = 'textarea';
737
                } else {
739
                } else {
738
                    # defined $authorised_value, and not 'date'
740
                    # defined $authorised_value, and not 'date'
739
                    my $dbh=C4::Context->dbh;
741
                    my $dbh=C4::Context->dbh;
Lines 1118-1124 sub get_prepped_report { Link Here
1118
        if ($split[$i*2+1] =~ /\|\s*date\s*$/) {
1120
        if ($split[$i*2+1] =~ /\|\s*date\s*$/) {
1119
            $quoted = output_pref({ dt => dt_from_string($quoted), dateformat => 'iso', dateonly => 1 }) if $quoted;
1121
            $quoted = output_pref({ dt => dt_from_string($quoted), dateformat => 'iso', dateonly => 1 }) if $quoted;
1120
        }
1122
        }
1121
        $quoted = C4::Context->dbh->quote($quoted);
1123
        unless( $split[$i*2+1] =~ /\|\s*list\s*$/ && $quoted ){
1124
            $quoted = C4::Context->dbh->quote($quoted);
1125
        } else {
1126
            my @list = split /\n/, $quoted;
1127
            my @quoted_list;
1128
            foreach my $item ( @list ){
1129
                $item =~ s/\r//;
1130
              push @quoted_list, C4::Context->dbh->quote($item);
1131
            }
1132
            $quoted="(".join(",",@quoted_list).")";
1133
        }
1122
        $sql =~ s/<<$split[$i*2+1]>>/$quoted/;
1134
        $sql =~ s/<<$split[$i*2+1]>>/$quoted/;
1123
    }
1135
    }
1124
    return $sql,$headers;
1136
    return $sql,$headers;
1125
- 

Return to bug 27380