View | Details | Raw Unified | Return to bug 6279
Collapse All | Expand All

(-)a/C4/VirtualShelves/Page.pm (-6 / +6 lines)
Lines 338-353 sub shelfpage { Link Here
338
        #Deleting a shelf (asking for confirmation if it has entries)
338
        #Deleting a shelf (asking for confirmation if it has entries)
339
            foreach ( $query->param() ) {
339
            foreach ( $query->param() ) {
340
                /DEL-(\d+)/ or next;
340
                /DEL-(\d+)/ or next;
341
                $delflag = 1;
342
                my $number = $1;
341
                my $number = $1;
343
                unless ( defined $shelflist->{$number} || defined $privshelflist->{$number} ) {
342
                my ($delnumber,$delname,$delowner,$delcategory,$delsorton) = GetShelf($number);
343
                unless ( defined $delnumber ) {
344
                    push( @paramsloop, { unrecognized => $number } );
344
                    push( @paramsloop, { unrecognized => $number } );
345
                    last;
345
                    last;
346
                }
346
                }
347
                unless ( ShelfPossibleAction( $loggedinuser, $number, 'manage' ) ) {
347
                unless ( ShelfPossibleAction( $loggedinuser, $number, 'manage' ) ) {
348
                    push( @paramsloop, { nopermission => $shelfnumber } );
348
                    push( @paramsloop, { nopermission => $number } );
349
                    last;
349
                    last;
350
                }
350
                }
351
                $delflag = 1;
351
                my $contents;
352
                my $contents;
352
                ( $contents, $totshelves ) = GetShelfContents( $number, $shelveslimit, $shelvesoffset );
353
                ( $contents, $totshelves ) = GetShelfContents( $number, $shelveslimit, $shelvesoffset );
353
                if ( my $count = scalar @$contents ) {
354
                if ( my $count = scalar @$contents ) {
Lines 355-361 sub shelfpage { Link Here
355
                        if ( defined $shelflist->{$number} ) {
356
                        if ( defined $shelflist->{$number} ) {
356
                            push( @paramsloop, { need_confirm => $shelflist->{$number}->{shelfname}, count => $count, single => ($count eq 1 ? 1:0) } );
357
                            push( @paramsloop, { need_confirm => $shelflist->{$number}->{shelfname}, count => $count, single => ($count eq 1 ? 1:0) } );
357
                            $shelflist->{$number}->{confirm} = $number;
358
                            $shelflist->{$number}->{confirm} = $number;
358
                        } else {
359
                        } elsif ( defined $privshelflist->{$number} ) {
359
                            push( @paramsloop, { need_confirm => $privshelflist->{$number}->{shelfname}, count => $count } );
360
                            push( @paramsloop, { need_confirm => $privshelflist->{$number}->{shelfname}, count => $count } );
360
                            $privshelflist->{$number}->{confirm} = $number;
361
                            $privshelflist->{$number}->{confirm} = $number;
361
                        }
362
                        }
Lines 367-373 sub shelfpage { Link Here
367
                if ( defined $shelflist->{$number} ) {
368
                if ( defined $shelflist->{$number} ) {
368
                    $name = $shelflist->{$number}->{'shelfname'};
369
                    $name = $shelflist->{$number}->{'shelfname'};
369
                    delete $shelflist->{$number};
370
                    delete $shelflist->{$number};
370
                } else {
371
                } elsif ( defined $privshelflist->{$number} ) {
371
                    $name = $privshelflist->{$number}->{'shelfname'};
372
                    $name = $privshelflist->{$number}->{'shelfname'};
372
                    delete $privshelflist->{$number};
373
                    delete $privshelflist->{$number};
373
                }
374
                }
374
- 

Return to bug 6279