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 6-12 Link Here
6
            <ul class="pagination">
6
            <ul class="pagination">
7
                [% IF ( displayprev ) %]
7
                [% IF ( displayprev ) %]
8
                    <li class="page-item">
8
                    <li class="page-item">
9
                        <a class="page-link" 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>
9
                        <a class="page-link" href="label-item-search.pl?startfrom=[% startfromprev | html %]&amp;idx=[% idx | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;op=do_search&amp;batch_id=[% batch_id | html %]&amp;ccl_textbox=[% ccl_textbox | html %]&amp;limits=[% limits | html %]"><i class="fa fa-arrow-left"></i> Previous</a>
10
                    </li>
10
                    </li>
11
                [% END %]
11
                [% END %]
12
                [% FOREACH number IN numbers %]
12
                [% FOREACH number IN numbers %]
Lines 16-28 Link Here
16
                        </li>
16
                        </li>
17
                    [% ELSE %]
17
                    [% ELSE %]
18
                        <li class="page-item">
18
                        <li class="page-item">
19
                            <a class="page-link" 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>
19
                            <a class="page-link" href="label-item-search.pl?startfrom=[% number.startfrom | html %]&amp;idx=[% idx | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;op=do_search&amp;batch_id=[% batch_id | html %]&amp;ccl_textbox=[% ccl_textbox | html %]&amp;limits=[% limits | html %]">[% number.number | html %]</a>
20
                        </li>
20
                        </li>
21
                    [% END %]
21
                    [% END %]
22
                [% END %]
22
                [% END %]
23
                [% IF ( displaynext ) %]
23
                [% IF ( displaynext ) %]
24
                    <li class="page-item">
24
                    <li class="page-item">
25
                        <a class="page-link" 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>
25
                        <a class="page-link" href="label-item-search.pl?startfrom=[% startfromnext | html %]&amp;idx=[% idx | html %]&amp;resultsperpage=[% resultsperpage | html %]&amp;op=do_search&amp;batch_id=[% batch_id | html %]&amp;ccl_textbox=[% ccl_textbox | html %]&amp;limits=[% limits | html %]">Next <i class="fa fa-arrow-right"></i></a>
26
                    </li>
26
                    </li>
27
                [% END %]
27
                [% END %]
28
            </ul>
28
            </ul>
Lines 60-66 Link Here
60
            </div>
60
            </div>
61
61
62
                <div id="label-search-results" class="page-section">
62
                <div id="label-search-results" class="page-section">
63
                <input type="hidden" name="ccl_query" value="[% ccl_query | html %]" />
64
            [% FOREACH result_se IN result_set %]
63
            [% FOREACH result_se IN result_set %]
65
            <div style="border-bottom:1px solid #CCC;padding:1em 0;">
64
            <div style="border-bottom:1px solid #CCC;padding:1em 0;">
66
                    <h4>[% result_se.title | html %]</h4>
65
                    <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