|
Lines 23-28
use warnings;
Link Here
|
| 23 |
use CGI qw ( -utf8 ); |
23 |
use CGI qw ( -utf8 ); |
| 24 |
use URI::Escape; |
24 |
use URI::Escape; |
| 25 |
use C4::Auth; |
25 |
use C4::Auth; |
|
|
26 |
use POSIX qw(ceil); |
| 26 |
|
27 |
|
| 27 |
use C4::Context; |
28 |
use C4::Context; |
| 28 |
use C4::Auth; |
29 |
use C4::Auth; |
|
Lines 95-102
if ( $op eq "do_search" ) {
Link Here
|
| 95 |
[$marclist], [$and_or], [$excluding], [$operator], |
96 |
[$marclist], [$and_or], [$excluding], [$operator], |
| 96 |
[$value], $authtypecode, $orderby |
97 |
[$value], $authtypecode, $orderby |
| 97 |
); |
98 |
); |
|
|
99 |
my $offset = ( $startfrom - 1 ) * $resultsperpage + 1; |
| 98 |
my ( $results, $total ) = $searcher->search_auth_compat( |
100 |
my ( $results, $total ) = $searcher->search_auth_compat( |
| 99 |
$search_query, $startfrom, $resultsperpage |
101 |
$search_query, $offset, $resultsperpage, ( offset => $offset - 1 ) |
| 100 |
); |
102 |
); |
| 101 |
|
103 |
|
| 102 |
( $template, $loggedinuser, $cookie ) = get_template_and_user( |
104 |
( $template, $loggedinuser, $cookie ) = get_template_and_user( |
|
Lines 180-194
if ( $op eq "do_search" ) {
Link Here
|
| 180 |
|
182 |
|
| 181 |
$template->param( result => $results ) if $results; |
183 |
$template->param( result => $results ) if $results; |
| 182 |
|
184 |
|
|
|
185 |
my $max_result_window = $searcher->max_result_window; |
| 186 |
my $hits_to_paginate = ($max_result_window && $max_result_window < $total) ? $max_result_window : $total; |
| 183 |
$template->param( |
187 |
$template->param( |
| 184 |
pagination_bar => pagination_bar( |
188 |
pagination_bar => pagination_bar( |
| 185 |
$base_url, int( $total / $resultsperpage ) + 1, |
189 |
$base_url, ceil( $hits_to_paginate / $resultsperpage ) , |
| 186 |
$startfrom, 'startfrom' |
190 |
$startfrom, 'startfrom' |
| 187 |
), |
191 |
), |
| 188 |
total => $total, |
192 |
total => $total, |
| 189 |
from => $from, |
193 |
hits_to_paginate => $hits_to_paginate, |
| 190 |
to => $to, |
194 |
from => $from, |
| 191 |
isEDITORS => $authtypecode eq 'EDITORS', |
195 |
to => $to, |
|
|
196 |
isEDITORS => $authtypecode eq 'EDITORS', |
| 192 |
); |
197 |
); |
| 193 |
|
198 |
|
| 194 |
} |
199 |
} |
| 195 |
- |
|
|