=back
-=item id or supplierid
+=item id or booksellerid
The id of the supplier whose baskets we will display
#parameters
my $supplier = $query->param('supplier');
-my $id = $query->param('id') || $query->param('supplierid');
+my $booksellerid = $query->param('booksellerid');
my @suppliers;
-if ($id) {
- push @suppliers, GetBookSellerFromId($id);
+if ($booksellerid) {
+ push @suppliers, GetBookSellerFromId($booksellerid);
} else {
@suppliers = GetBookSeller($supplier);
}
if ( $supplier_count == 1 ) {
$template->param(
supplier_name => $suppliers[0]->{'name'},
- id => $suppliers[0]->{'id'}
+ booksellerid => $suppliers[0]->{'booksellerid'}
);
}
for my $basket ( @{$baskets} ) {
my $authorisedby = $basket->{authorisedby};
- my $basketbranch = ''; # set a blank branch to start with
- if ( GetMember( borrowernumber => $authorisedby ) ) {
- # authorisedby may not be a valid borrowernumber; it's not foreign-key constrained!
- $basketbranch = GetMember( borrowernumber => $authorisedby )->{branchcode};
- }
if ($userenv->{'flags'} & 1 || #user is superlibrarian
(haspermission( $uid, { acquisition => q{*} } ) && #user has acq permissions and
($viewbaskets eq 'all' || #user is allowed to see all baskets
- ($viewbaskets eq 'branch' && $authorisedby && $userbranch eq $basketbranch) || #basket belongs to user's branch
+ ($viewbaskets eq 'branch' && $authorisedby && $userbranch eq GetMember( borrowernumber => $authorisedby )->{branchcode}) || #basket belongs to user's branch
($basket->{authorisedby} && $viewbaskets == 'user' && $authorisedby == $loggedinuser) #user created this basket
)
)
push @{$loop_suppliers},
{ loop_basket => $loop_basket,
- supplierid => $vendor->{id},
+ booksellerid => $vendor->{id},
name => $vendor->{name},
active => $vendor->{active},
};
}
$template->param(
loop_suppliers => $loop_suppliers,
- supplier => ( $id || $supplier ),
+ supplier => ( $booksellerid || $supplier ),
count => $supplier_count,
);