MT 1976 : Lists are directly displayed through VirtualShelves.pm
(and not through the session, like in opac)
This commit is contained in:
parent
19a8d922b9
commit
f00a4a7cfb
1 changed files with 15 additions and 15 deletions
|
@ -144,6 +144,7 @@ use C4::Auth qw(:DEFAULT get_session);
|
||||||
use C4::Search;
|
use C4::Search;
|
||||||
use C4::Languages qw(getAllLanguages);
|
use C4::Languages qw(getAllLanguages);
|
||||||
use C4::Koha;
|
use C4::Koha;
|
||||||
|
use C4::VirtualShelves qw(GetRecentShelves);
|
||||||
use POSIX qw(ceil floor);
|
use POSIX qw(ceil floor);
|
||||||
use C4::Branch; # GetBranches
|
use C4::Branch; # GetBranches
|
||||||
|
|
||||||
|
@ -640,23 +641,22 @@ if ($query_desc || $limit_desc) {
|
||||||
# VI. BUILD THE TEMPLATE
|
# VI. BUILD THE TEMPLATE
|
||||||
|
|
||||||
# Build drop-down list for 'Add To:' menu...
|
# Build drop-down list for 'Add To:' menu...
|
||||||
my $session = get_session($cgi->cookie("CGISESSID"));
|
|
||||||
my @addpubshelves;
|
my $row_count = 10; # FIXME:This probably should be a syspref
|
||||||
my $pubshelves = $session->param('pubshelves');
|
my ($pubshelves, $total) = GetRecentShelves(2, $row_count, undef);
|
||||||
my $barshelves = $session->param('barshelves');
|
my ($barshelves, $total) = GetRecentShelves(1, $row_count, $borrowernumber);
|
||||||
foreach my $shelf (@$pubshelves) {
|
|
||||||
next if ( ($shelf->{'owner'} != ($borrowernumber ? $borrowernumber : -1)) && ($shelf->{'category'} < 3) );
|
my @pubshelves = @{$pubshelves};
|
||||||
push (@addpubshelves, $shelf);
|
my @barshelves = @{$barshelves};
|
||||||
|
|
||||||
|
if (@pubshelves) {
|
||||||
|
$template->param( addpubshelves => scalar (@pubshelves));
|
||||||
|
$template->param( addpubshelvesloop => @pubshelves);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (@addpubshelves) {
|
if (@barshelves) {
|
||||||
$template->param( addpubshelves => scalar (@addpubshelves));
|
$template->param( addbarshelves => scalar (@barshelves));
|
||||||
$template->param( addpubshelvesloop => \@addpubshelves);
|
$template->param( addbarshelvesloop => @barshelves);
|
||||||
}
|
|
||||||
|
|
||||||
if (defined $barshelves) {
|
|
||||||
$template->param( addbarshelves => scalar (@$barshelves));
|
|
||||||
$template->param( addbarshelvesloop => $barshelves);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue