my $branch = $query->param('branch') || $patron->branchcode || C4::Context->userenv->{branch} || '' ;
$template->param( branch => $branch );
-# Is the person allowed to choose their branch
-my $OPACChooseBranch = (C4::Context->preference("OPACAllowUserToChooseBranch")) ? 1 : 0;
-
-$template->param( choose_branch => $OPACChooseBranch);
-
#
#
# Build hashes of the requested biblio(item)s and items.
my $canreserve = 0;
my $singleBranchMode = Koha::Libraries->search->count == 1;
- if ( $singleBranchMode || !$OPACChooseBranch )
+ if ( $singleBranchMode || ! C4::Context->preference("OPACAllowUserToChooseBranch") )
{ # single branch mode or disabled user choosing
$branch = $patron->branchcode;
}
my $biblioLoop = [];
my $numBibsAvailable = 0;
my $itemdata_enumchron = 0;
+my $itemdata_ccode = 0;
my $anyholdable = 0;
my $itemLevelTypes = C4::Context->preference('item-level_itypes');
$template->param('item_level_itypes' => $itemLevelTypes);
$itemLoopIter->{homeBranchName} = $itemInfo->{homebranch};
$itemLoopIter->{callNumber} = $itemInfo->{itemcallnumber};
$itemLoopIter->{enumchron} = $itemInfo->{enumchron};
+ $itemLoopIter->{ccode} = $itemInfo->{ccode};
$itemLoopIter->{copynumber} = $itemInfo->{copynumber};
if ($itemLevelTypes) {
$itemLoopIter->{translated_description} = $itemInfo->{translated_description};
if ($itemLoopIter->{enumchron}) {
$itemdata_enumchron = 1;
}
+ # Show collection when needed
+ if ($itemLoopIter->{ccode}) {
+ $itemdata_ccode = 1;
+ }
push @{$biblioLoopIter{itemLoop}}, $itemLoopIter;
}
- $template->param( itemdata_enumchron => $itemdata_enumchron );
+ $template->param(
+ itemdata_enumchron => $itemdata_enumchron,
+ itemdata_ccode => $itemdata_ccode,
+ );
if ($numCopiesAvailable > 0) {
$numBibsAvailable++;