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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/labels/result.tt (-4 / +3 lines)
Lines 5-21 Link Here
5
        [% IF ( displayprev || displaynext ) %]
5
        [% IF ( displayprev || displaynext ) %]
6
            <ul class="pagination">
6
            <ul class="pagination">
7
                [% IF ( displayprev ) %]
7
                [% IF ( displayprev ) %]
8
                    <li><a class="nav" href="label-item-search.pl?startfrom=[% startfromprev | html %]&amp;ccl_query=[% ccl_query | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;op=do_search&amp;batch_id=[% batch_id | html %]"><i class="fa fa-arrow-left"></i> Previous</a></li>
8
                    <li><a class="nav" href="label-item-search.pl?startfrom=[% startfromprev | html %]&amp;idx=[% idx | html %]&amp;ccl_textbox=[% ccl_textbox | html %]&amp;limits=[% limits | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;op=do_search&amp;batch_id=[% batch_id | html %]"><i class="fa fa-arrow-left"></i> Previous</a></li>
9
                [% END %]
9
                [% END %]
10
                [% FOREACH number IN numbers %]
10
                [% FOREACH number IN numbers %]
11
                    [% IF ( startfrom == number.startfrom ) %]
11
                    [% IF ( startfrom == number.startfrom ) %]
12
                        <li class="active"><span>[% number.number | html %]</span></a></li>
12
                        <li class="active"><span>[% number.number | html %]</span></a></li>
13
                    [% ELSE %]
13
                    [% ELSE %]
14
                        <li><a class="nav" href="label-item-search.pl?startfrom=[% number.startfrom | html %]&amp;ccl_query=[% ccl_query | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;op=do_search&amp;batch_id=[% batch_id | html %]">[% number.number | html %]</a></li>
14
                        <li><a class="nav" href="label-item-search.pl?startfrom=[% number.startfrom | html %]&amp;idx=[% idx | html %]&amp;ccl_textbox=[% ccl_textbox | html %]&amp;limits=[% limits | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;op=do_search&amp;batch_id=[% batch_id | html %]">[% number.number | html %]</a></li>
15
                    [% END %]
15
                    [% END %]
16
                [% END %]
16
                [% END %]
17
                [% IF ( displaynext ) %]
17
                [% IF ( displaynext ) %]
18
                    <li><a class="nav" href="label-item-search.pl?startfrom=[% startfromnext | html %]&amp;ccl_query=[% ccl_query | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;op=do_search&amp;batch_id=[% batch_id | html %]">Next <i class="fa fa-arrow-right"></i></a></li>
18
                    <li><a class="nav" href="label-item-search.pl?startfrom=[% startfromnext | html %]&amp;idx=[% idx | html %]&amp;ccl_textbox=[% ccl_textbox | html %]&amp;limits=[% limits | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;op=do_search&amp;batch_id=[% batch_id | html %]">Next <i class="fa fa-arrow-right"></i></a></li>
19
                [% END %]
19
                [% END %]
20
            </ul>
20
            </ul>
21
        [% END %]
21
        [% END %]
Lines 54-60 Link Here
54
            </div>
54
            </div>
55
55
56
                <div id="label-search-results" class="page-section">
56
                <div id="label-search-results" class="page-section">
57
                <input type="hidden" name="ccl_query" value="[% ccl_query | html %]" />
58
            [% FOREACH result_se IN result_set %]
57
            [% FOREACH result_se IN result_set %]
59
            <div style="border-bottom:1px solid #CCC;padding:1em 0;">
58
            <div style="border-bottom:1px solid #CCC;padding:1em 0;">
60
                    <h4>[% result_se.title | html %]</h4>
59
                    <h4>[% result_se.title | html %]</h4>
(-)a/labels/label-item-search.pl (-16 / +14 lines)
Lines 40-46 my $query = CGI->new; Link Here
40
my $type      = $query->param('type');
40
my $type      = $query->param('type');
41
my $op        = $query->param('op') || '';
41
my $op        = $query->param('op') || '';
42
my $batch_id  = $query->param('batch_id');
42
my $batch_id  = $query->param('batch_id');
43
my $ccl_query = $query->param('ccl_query');
43
my @limits    = split(" AND ", $query->param('limits') || "");
44
my $startfrom = $query->param('startfrom') || 1;
44
my $startfrom = $query->param('startfrom') || 1;
45
my ($template, $loggedinuser, $cookie) = (undef, undef, undef);
45
my ($template, $loggedinuser, $cookie) = (undef, undef, undef);
46
my (
46
my (
Lines 68-80 if ( $op eq "do_search" ) { Link Here
68
    my $searcher = Koha::SearchEngine::Search->new(
68
    my $searcher = Koha::SearchEngine::Search->new(
69
        { index => $Koha::SearchEngine::BIBLIOS_INDEX } );
69
        { index => $Koha::SearchEngine::BIBLIOS_INDEX } );
70
70
71
    my @limits;
71
    if (!@limits) {
72
    if ($datefrom) {
72
        push(@limits, "acqdate,ge,st-date-normalized=$datefrom") if ($datefrom);
73
        push(@limits, "acqdate,ge,st-date-normalized=$datefrom");
73
        push(@limits, "acqdate,le,st-date-normalized=$dateto") if ($dateto);
74
    }
75
76
    if ($dateto) {
77
        push(@limits, "acqdate,le,st-date-normalized=$dateto");
78
    }
74
    }
79
75
80
    my ( $build_error, $query, $simple_query, $query_cgi,
76
    my ( $build_error, $query, $simple_query, $query_cgi,
Lines 90-97 if ( $op eq "do_search" ) { Link Here
90
    );
86
    );
91
87
92
    if (!defined $error && @{$results->{biblioserver}{RECORDS}} ) {
88
    if (!defined $error && @{$results->{biblioserver}{RECORDS}} ) {
93
        $show_results = @{$results->{biblioserver}{RECORDS}};
89
        $show_results = grep { defined $_ } @{$results->{biblioserver}{RECORDS}};
94
        $marcresults = $results->{biblioserver}{RECORDS};
90
        $marcresults = [ grep { defined $_ } @{$results->{biblioserver}{RECORDS}} ];
91
        $total_hits = $results->{biblioserver}{hits};
95
    }
92
    }
96
    else {
93
    else {
97
        Koha::Logger->get->warn("ERROR label-item-search: no results from simple_search_compat");
94
        Koha::Logger->get->warn("ERROR label-item-search: no results from simple_search_compat");
Lines 196-206 if ($show_results) { Link Here
196
    );
193
    );
197
194
198
    $template->param(
195
    $template->param(
199
        results   => ($show_results ? 1 : 0),
196
        results     => ($show_results ? 1 : 0),
200
        result_set=> \@results_set,
197
        result_set  => \@results_set,
201
        batch_id  => $batch_id,
198
        batch_id    => $batch_id,
202
        type      => $type,
199
        type        => $type,
203
        ccl_query => $ccl_query,
200
        idx         => $idx,
201
        ccl_textbox => $ccl_textbox,
202
        limits      => join(" AND ", @limits),
204
    );
203
    );
205
}
204
}
206
205
207
- 

Return to bug 30745