X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=acqui%2Fbooksellers.pl;h=ac3c557c5e1665a536c778c4367cf46b694ea595;hb=e4abe486daa05669dd1cd85758d4d6eaec3f8427;hp=634eb93d576fb3dd2e035db5eec3923f32423778;hpb=bfc3ea8cc4f0746d4d5658d7c2e2353855bd2b29;p=koha.git diff --git a/acqui/booksellers.pl b/acqui/booksellers.pl index 634eb93d57..ac3c557c5e 100755 --- a/acqui/booksellers.pl +++ b/acqui/booksellers.pl @@ -41,7 +41,7 @@ C<$supplier> is the string with which we search for a supplier =back -=item id or supplierid +=item id or booksellerid The id of the supplier whose baskets we will display @@ -74,11 +74,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( #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); } @@ -87,7 +87,7 @@ my $supplier_count = @suppliers; if ( $supplier_count == 1 ) { $template->param( supplier_name => $suppliers[0]->{'name'}, - id => $suppliers[0]->{'id'} + booksellerid => $suppliers[0]->{'booksellerid'} ); } @@ -111,16 +111,11 @@ for my $vendor (@suppliers) { 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 ) ) @@ -136,7 +131,7 @@ for my $vendor (@suppliers) { push @{$loop_suppliers}, { loop_basket => $loop_basket, - supplierid => $vendor->{id}, + booksellerid => $vendor->{id}, name => $vendor->{name}, active => $vendor->{active}, }; @@ -144,7 +139,7 @@ for my $vendor (@suppliers) { } $template->param( loop_suppliers => $loop_suppliers, - supplier => ( $id || $supplier ), + supplier => ( $booksellerid || $supplier ), count => $supplier_count, );