-else {
- if($selectedshelf){
- # adding to specific shelf
- my ( $singleshelf, $singleshelfname, $singlecategory ) = GetShelf( $query->param('selectedshelf') );
- $template->param(
- singleshelf => 1,
- shelfnumber => $singleshelf,
- shelfname => $singleshelfname,
- "category$singlecategory" => 1
- );
- } else {
- # offer choice of shelves
- my $limit = 10;
- my @shelvesloop;
- my %shelvesloop;
- #grab each type of shelf, open (type 3) should not be limited by user.
- foreach my $shelftype (1,2,3) {
- my ($shelflist) = GetRecentShelves($shelftype, $limit, $shelftype == 3 ? undef : $loggedinuser);
- for my $shelf (@{ $shelflist->[0] }) {
- push(@shelvesloop, $shelf->{shelfnumber});
- $shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
- }
+
+sub HandleShelfNumber {
+ if($authorized= ShelfPossibleAction($loggedinuser, $shelfnumber, 'add')) {
+ AddBibliosToShelf($shelfnumber,@biblionumber);
+ #Close this page and return
+ print $query->header;
+ print "<html><meta http-equiv=\"refresh\" content=\"0\" /><body onload=\"self.close();\"></body></html>";