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

(-)a/C4/Suggestions.pm (-7 / +3 lines)
Lines 25-37 use CGI qw ( -utf8 ); Link Here
25
25
26
use C4::Context;
26
use C4::Context;
27
use C4::Output;
27
use C4::Output;
28
use C4::Dates qw(format_date format_date_in_iso);
29
use C4::Debug;
28
use C4::Debug;
30
use C4::Letters;
29
use C4::Letters;
31
use Koha::DateUtils qw( dt_from_string );
30
use Koha::DateUtils;
32
31
33
use List::MoreUtils qw(any);
32
use List::MoreUtils qw(any);
34
use C4::Dates qw(format_date_in_iso);
35
use base qw(Exporter);
33
use base qw(Exporter);
36
34
37
our $VERSION = 3.07.00.049;
35
our $VERSION = 3.07.00.049;
Lines 174-189 sub SearchSuggestion { Link Here
174
    }
172
    }
175
173
176
    # filter on date fields
174
    # filter on date fields
177
    my $today = C4::Dates->today('iso');
178
    foreach my $field (qw( suggesteddate manageddate accepteddate )) {
175
    foreach my $field (qw( suggesteddate manageddate accepteddate )) {
179
        my $from = $field . "_from";
176
        my $from = $field . "_from";
180
        my $to   = $field . "_to";
177
        my $to   = $field . "_to";
181
        if ( $suggestion->{$from} || $suggestion->{$to} ) {
178
        if ( $suggestion->{$from} || $suggestion->{$to} ) {
182
            push @query, qq{ AND suggestions.$field BETWEEN ? AND ? };
179
            push @query, qq{ AND suggestions.$field BETWEEN ? AND ? };
183
            push @sql_params,
180
            push @sql_params,
184
              format_date_in_iso( $suggestion->{$from} ) || '0000-00-00';
181
              output_pref({ dt => dt_from_string( $suggestion->{$from} ), dateformat => 'iso', dateonly => 1 }) || '0000-00-00';
185
            push @sql_params,
182
            push @sql_params,
186
              format_date_in_iso( $suggestion->{$to} ) || $today;
183
              output_pref({ dt => dt_from_string( $suggestion->{$to} ), dateformat => 'iso', dateonly => 1 }) || output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
187
        }
184
        }
188
    }
185
    }
189
186
190
- 

Return to bug 13813