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

(-)a/C4/Suggestions.pm (-3 / +7 lines)
Lines 177-186 sub SearchSuggestion { Link Here
177
    foreach my $field (qw( suggesteddate manageddate accepteddate )) {
177
    foreach my $field (qw( suggesteddate manageddate accepteddate )) {
178
        my $from = $field . "_from";
178
        my $from = $field . "_from";
179
        my $to   = $field . "_to";
179
        my $to   = $field . "_to";
180
        my $from_dt;
181
        $from_dt = eval { dt_from_string( $suggestion->{$from} ) } if ( $suggestion->{$from} );
182
        my $from_sql = '0000-00-00';
183
        $from_sql = output_pref({ dt => $from_dt, dateformat => 'iso', dateonly => 1 })
184
            if ($from_dt);
185
        $debug && warn "SQL for start date ($field): $from_sql";
180
        if ( $suggestion->{$from} || $suggestion->{$to} ) {
186
        if ( $suggestion->{$from} || $suggestion->{$to} ) {
181
            push @query, qq{ AND suggestions.$field BETWEEN ? AND ? };
187
            push @query, qq{ AND suggestions.$field BETWEEN ? AND ? };
182
            push @sql_params,
188
            push @sql_params, $from_sql;
183
              output_pref({ dt => dt_from_string( $suggestion->{$from} ), dateformat => 'iso', dateonly => 1 }) || '0000-00-00';
184
            push @sql_params,
189
            push @sql_params,
185
              output_pref({ dt => dt_from_string( $suggestion->{$to} ), dateformat => 'iso', dateonly => 1 }) || output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
190
              output_pref({ dt => dt_from_string( $suggestion->{$to} ), dateformat => 'iso', dateonly => 1 }) || output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
186
        }
191
        }
187
- 

Return to bug 15090