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

(-)a/C4/Reports/Guided.pm (-2 / +2 lines)
Lines 23-31 use Carp; Link Here
23
23
24
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
24
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
25
use C4::Context;
25
use C4::Context;
26
use C4::Dates qw/format_date format_date_in_iso/;
27
use C4::Templates qw/themelanguage/;
26
use C4::Templates qw/themelanguage/;
28
use C4::Koha;
27
use C4::Koha;
28
use Koha::DateUtils;
29
use C4::Output;
29
use C4::Output;
30
use XML::Simple;
30
use XML::Simple;
31
use XML::Dumper;
31
use XML::Dumper;
Lines 675-681 sub get_saved_reports { Link Here
675
    my (@cond,@args);
675
    my (@cond,@args);
676
    if ($filter) {
676
    if ($filter) {
677
        if (my $date = $filter->{date}) {
677
        if (my $date = $filter->{date}) {
678
            $date = format_date_in_iso($date);
678
            $date = eval { output_pref( { dt => dt_from_string( $date ), dateonly => 1, dateformat => 'iso' }); };
679
            push @cond, "DATE(date_run) = ? OR
679
            push @cond, "DATE(date_run) = ? OR
680
                         DATE(date_created) = ? OR
680
                         DATE(date_created) = ? OR
681
                         DATE(last_modified) = ? OR
681
                         DATE(last_modified) = ? OR
(-)a/reports/dictionary.pl (-13 / +15 lines)
Lines 23-29 use C4::Auth; Link Here
23
use CGI qw ( -utf8 );
23
use CGI qw ( -utf8 );
24
use C4::Output;
24
use C4::Output;
25
use C4::Reports::Guided;
25
use C4::Reports::Guided;
26
use C4::Dates;
26
use Koha::DateUtils;
27
27
28
=head1 NAME
28
=head1 NAME
29
29
Lines 141-174 elsif ( $phase eq 'New Term step 5' ) { Link Here
141
            $tmp_hash{'name'}  = $crit;
141
            $tmp_hash{'name'}  = $crit;
142
            $tmp_hash{'value'} = $value;
142
            $tmp_hash{'value'} = $value;
143
            push @criteria_loop, \%tmp_hash;
143
            push @criteria_loop, \%tmp_hash;
144
            if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) {
144
            my $value_dt = eval { dt_from_string( $value ) };
145
                my $date = C4::Dates->new($value);
145
            $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } )
146
                $value = $date->output("iso");
146
                if ( $value_dt );
147
            }
147
148
            $query_criteria .= " AND $crit='$value'";
148
            $query_criteria .= " AND $crit='$value'";
149
        }
149
        }
150
        $value = $input->param( $crit . "_start_value" );
150
        $value = $input->param( $crit . "_start_value" );
151
151
        if ($value) {
152
        if ($value) {
152
            my %tmp_hash;
153
            my %tmp_hash;
153
            $tmp_hash{'name'}  = "$crit Start";
154
            $tmp_hash{'name'}  = "$crit Start";
154
            $tmp_hash{'value'} = $value;
155
            $tmp_hash{'value'} = $value;
155
            push @criteria_loop, \%tmp_hash;
156
            push @criteria_loop, \%tmp_hash;
156
            if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) {
157
            my $value_dt = eval { dt_from_string( $value ) };
157
                my $date = C4::Dates->new($value);
158
            $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } )
158
                $value = $date->output("iso");
159
                if ( $value_dt );
159
            }
160
160
            $query_criteria .= " AND $crit >= '$value'";
161
            $query_criteria .= " AND $crit >= '$value'";
161
        }
162
        }
163
162
        $value = $input->param( $crit . "_end_value" );
164
        $value = $input->param( $crit . "_end_value" );
163
        if ($value) {
165
        if ($value) {
164
            my %tmp_hash;
166
            my %tmp_hash;
165
            $tmp_hash{'name'}  = "$crit End";
167
            $tmp_hash{'name'}  = "$crit End";
166
            $tmp_hash{'value'} = $value;
168
            $tmp_hash{'value'} = $value;
167
            push @criteria_loop, \%tmp_hash;
169
            push @criteria_loop, \%tmp_hash;
168
            if ( $value =~ C4::Dates->regexp( C4::Context->preference('dateformat') ) ) {
170
            my $value_dt = eval { dt_from_string( $value ) };
169
                my $date = C4::Dates->new($value);
171
            $value = output_pref( { dt => $value_dt, dateonly => 1, dateformat => 'iso' } )
170
                $value = $date->output("iso");
172
                if ( $value_dt );
171
            }
173
172
            $query_criteria .= " AND $crit <= '$value'";
174
            $query_criteria .= " AND $crit <= '$value'";
173
        }
175
        }
174
    }
176
    }
(-)a/reports/guided_reports.pl (-2 lines)
Lines 27-33 use File::Basename qw( dirname ); Link Here
27
use C4::Reports::Guided;
27
use C4::Reports::Guided;
28
use C4::Auth qw/:DEFAULT get_session/;
28
use C4::Auth qw/:DEFAULT get_session/;
29
use C4::Output;
29
use C4::Output;
30
use C4::Dates qw/format_date/;
31
use C4::Debug;
30
use C4::Debug;
32
use C4::Branch; # XXX subfield_is_koha_internal_p
31
use C4::Branch; # XXX subfield_is_koha_internal_p
33
use C4::Koha qw/IsAuthorisedValueCategory GetFrameworksLoop/;
32
use C4::Koha qw/IsAuthorisedValueCategory GetFrameworksLoop/;
34
- 

Return to bug 14982