|
Lines 76-86
sub shelfpage {
Link Here
|
| 76 |
my ( $shelflimit, $shelfoffset, $shelveslimit, $shelvesoffset ); |
76 |
my ( $shelflimit, $shelfoffset, $shelveslimit, $shelvesoffset ); |
| 77 |
my $marcflavour = C4::Context->preference("marcflavour"); |
77 |
my $marcflavour = C4::Context->preference("marcflavour"); |
| 78 |
|
78 |
|
| 79 |
$shelflimit = ( $type eq 'opac' ? C4::Context->preference('OPACnumSearchResults') : C4::Context->preference('numSearchResults') ); |
79 |
unless ( $query->param('print') ) { |
| 80 |
$shelflimit = $shelflimit || ShelvesMax('MGRPAGE'); |
80 |
$shelflimit = |
| 81 |
$shelfoffset = ( $itemoff - 1 ) * $shelflimit; # Sets the offset to begin retrieving items at |
81 |
( $type eq 'opac' |
| 82 |
$shelveslimit = $shelflimit; # Limits number of shelves returned for a given query (row_count) |
82 |
? C4::Context->preference('OPACnumSearchResults') |
| 83 |
$shelvesoffset = ( $shelfoff - 1 ) * $shelflimit; # Sets the offset to begin retrieving shelves at (offset) |
83 |
: C4::Context->preference('numSearchResults') ); |
|
|
84 |
$shelflimit = $shelflimit || ShelvesMax('MGRPAGE'); |
| 85 |
$shelfoffset = ( $itemoff - 1 ) * $shelflimit; # Sets the offset to begin retrieving items at |
| 86 |
$shelveslimit = $shelflimit; # Limits number of shelves returned for a given query (row_count) |
| 87 |
$shelvesoffset = ( $shelfoff - 1 ) * $shelflimit; # Sets the offset to begin retrieving shelves at (offset) |
| 88 |
} |
| 89 |
|
| 84 |
# getting the Shelves list |
90 |
# getting the Shelves list |
| 85 |
my $category = ( ( $displaymode eq 'privateshelves' ) ? 1 : 2 ); |
91 |
my $category = ( ( $displaymode eq 'privateshelves' ) ? 1 : 2 ); |
| 86 |
my $shelflist = GetShelves( $category, $shelveslimit, $shelvesoffset, $loggedinuser ); |
92 |
my $shelflist = GetShelves( $category, $shelveslimit, $shelvesoffset, $loggedinuser ); |
|
Lines 459-470
sub shelfpage {
Link Here
|
| 459 |
$qhash{$_} = $query->param($_) if $query->param($_); |
465 |
$qhash{$_} = $query->param($_) if $query->param($_); |
| 460 |
} |
466 |
} |
| 461 |
( scalar keys %qhash ) and $url .= '?' . join '&', map { "$_=$qhash{$_}" } keys %qhash; |
467 |
( scalar keys %qhash ) and $url .= '?' . join '&', map { "$_=$qhash{$_}" } keys %qhash; |
| 462 |
if ( $shelfnumber && $totitems ) { |
468 |
|
| 463 |
$template->param( pagination_bar => pagination_bar( $url, ( int( $totitems / $shelflimit ) ) + ( ( $totitems % $shelflimit ) > 0 ? 1 : 0 ), $itemoff, "itemoff" ) ); |
469 |
unless ( $query->param('print')) { |
| 464 |
} elsif ( $totshelves ) { |
470 |
if ( $shelfnumber && $totitems ) { |
| 465 |
$template->param( |
471 |
$template->param( pagination_bar => pagination_bar( $url, ( int( $totitems / $shelflimit ) ) + ( ( $totitems % $shelflimit ) > 0 ? 1 : 0 ), $itemoff, "itemoff" ) ); |
| 466 |
pagination_bar => pagination_bar( $url, ( int( $totshelves / $shelveslimit ) ) + ( ( $totshelves % $shelveslimit ) > 0 ? 1 : 0 ), $shelfoff, "shelfoff" ) ); |
472 |
} elsif ( $totshelves ) { |
|
|
473 |
$template->param( |
| 474 |
pagination_bar => pagination_bar( $url, ( int( $totshelves / $shelveslimit ) ) + ( ( $totshelves % $shelveslimit ) > 0 ? 1 : 0 ), $shelfoff, "shelfoff" ) ); |
| 475 |
} |
| 467 |
} |
476 |
} |
|
|
477 |
|
| 468 |
$template->param( |
478 |
$template->param( |
| 469 |
shelveslooppriv => \@shelveslooppriv, |
479 |
shelveslooppriv => \@shelveslooppriv, |
| 470 |
shelvesloop => \@shelvesloop, |
480 |
shelvesloop => \@shelvesloop, |