my $dbh = C4::Context->dbh;
my $sth;
my $input = new CGI;
-my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
+my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
{
template_name => "reserve/request.tmpl",
query => $input,
# if independent branches is on we need to check if the person can reserve
# for branches they arent logged in to
- if ( C4::Context->preference("IndependantBranches") ) {
+ if ( C4::Context->preference("IndependentBranches") ) {
if (! C4::Context->preference("canreservefromotherbranches")){
# cant reserve items so need to check if item homebranch and userenv branch match if not we cant reserve
my $userenv = C4::Context->userenv;
$reserve{'barcode'} = $res->{'barcode'};
$reserve{'priority'} = $res->{'priority'};
$reserve{'lowestPriority'} = $res->{'lowestPriority'};
- $reserve{'branchloop'} = GetBranchesLoop($res->{'branchcode'});
$reserve{'optionloop'} = \@optionloop;
$reserve{'suspend'} = $res->{'suspend'};
$reserve{'suspend_until'} = $res->{'suspend_until'};
+
+ if ( C4::Context->preference('IndependantBranches') && $flags->{'superlibrarian'} != 1 ) {
+ $reserve{'branchloop'} = [ GetBranchDetail($res->{'branchcode'}) ];
+ } else {
+ $reserve{'branchloop'} = GetBranchesLoop($res->{'branchcode'});
+ }
+
push( @reserveloop, \%reserve );
}