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

(-)a/labels/label-item-search.pl (-8 / +7 lines)
Lines 28-40 use POSIX qw(ceil); Link Here
28
use C4::Auth qw(get_template_and_user);
28
use C4::Auth qw(get_template_and_user);
29
use C4::Output qw(output_html_with_http_headers);
29
use C4::Output qw(output_html_with_http_headers);
30
use C4::Context;
30
use C4::Context;
31
use C4::Dates;
32
use C4::Search qw(SimpleSearch);
31
use C4::Search qw(SimpleSearch);
33
use C4::Biblio qw(TransformMarcToKoha);
32
use C4::Biblio qw(TransformMarcToKoha);
34
use C4::Items qw(GetItemInfosOf get_itemnumbers_of);
33
use C4::Items qw(GetItemInfosOf get_itemnumbers_of);
35
use C4::Koha qw(GetItemTypes);    # XXX subfield_is_koha_internal_p
34
use C4::Koha qw(GetItemTypes);    # XXX subfield_is_koha_internal_p
36
use C4::Creators::Lib qw(html_table);
35
use C4::Creators::Lib qw(html_table);
37
use C4::Debug;
36
use C4::Debug;
37
use Koha::DateUtils;
38
38
39
BEGIN {
39
BEGIN {
40
    $debug = $debug || $cgi_debug;
40
    $debug = $debug || $cgi_debug;
Lines 78-103 if ( $op eq "do_search" ) { Link Here
78
    $dateto   = $query->param('dateto');
78
    $dateto   = $query->param('dateto');
79
79
80
    if ($datefrom) {
80
    if ($datefrom) {
81
        $datefrom = C4::Dates->new($datefrom);
81
        $datefrom = output_pref({ dt => dt_from_string( $datefrom ), dateformat => 'iso', dateonly => 1 });
82
        if ($QParser) {
82
        if ($QParser) {
83
            $ccl_query .= ' && ' if $ccl_textbox;
83
            $ccl_query .= ' && ' if $ccl_textbox;
84
            $ccl_query .=
84
            $ccl_query .=
85
                "acqdate(" . $datefrom->output("iso") . '-)';
85
                "acqdate(" . $datefrom . '-)';
86
        } else {
86
        } else {
87
            $ccl_query .= ' and ' if $ccl_textbox;
87
            $ccl_query .= ' and ' if $ccl_textbox;
88
            $ccl_query .=
88
            $ccl_query .=
89
                "acqdate,st-date-normalized,ge=" . $datefrom->output("iso");
89
                "acqdate,st-date-normalized,ge=" . $datefrom;
90
        }
90
        }
91
    }
91
    }
92
92
93
    if ($dateto) {
93
    if ($dateto) {
94
        $dateto = C4::Dates->new($dateto);
94
        $dateto = output_pref({ dt => dt_from_string( $dateto ), dateformat => 'iso', dateonly => 1 });
95
        if ($QParser) {
95
        if ($QParser) {
96
            $ccl_query .= ' && ' if ( $ccl_textbox || $datefrom );
96
            $ccl_query .= ' && ' if ( $ccl_textbox || $datefrom );
97
            $ccl_query .= "acqdate(-" . $dateto->output("iso") . ')';
97
            $ccl_query .= "acqdate(-" . $dateto . ')';
98
        } else {
98
        } else {
99
            $ccl_query .= ' and ' if ( $ccl_textbox || $datefrom );
99
            $ccl_query .= ' and ' if ( $ccl_textbox || $datefrom );
100
            $ccl_query .= "acqdate,st-date-normalized,le=" . $dateto->output("iso");
100
            $ccl_query .= "acqdate,st-date-normalized,le=" . $dateto;
101
        }
101
        }
102
    }
102
    }
103
103
104
- 

Return to bug 14923