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

(-)a/cataloguing/additem.pl (-35 / +21 lines)
Lines 643-683 if ($op eq "additem") { Link Here
643
#-------------------------------------------------------------------------------
643
#-------------------------------------------------------------------------------
644
} elsif ($op eq "delallitems") {
644
} elsif ($op eq "delallitems") {
645
#-------------------------------------------------------------------------------
645
#-------------------------------------------------------------------------------
646
    my @biblioitems = &GetBiblioItemByBiblioNumber($biblionumber);
646
    my $itemnumbers = C4::Items::GetItemnumbersForBiblio( $biblionumber );
647
    my $errortest=0;
647
    foreach my $itemnumber ( @$itemnumbers ) {
648
    my $itemfail;
648
        $error = C4::Items::DelItemCheck( $biblionumber, $itemnumber );
649
    foreach my $biblioitem (@biblioitems) {
649
        next if $error == 1; # Means ok
650
        my $items = &GetItemsByBiblioitemnumber( $biblioitem->{biblioitemnumber} );
650
        push @errors,$error;
651
651
    }
652
        foreach my $item (@$items) {
652
    if ( @errors ) {
653
            $error =&DelItemCheck( $biblionumber, $item->{itemnumber} );
653
        $nextop="additem";
654
            $itemfail =$item;
654
    } else {
655
        if($error == 1){
655
        my $defaultview = C4::Context->preference('IntranetBiblioDefaultView');
656
            next
656
        my $views = { C4::Search::enabled_staff_search_views };
657
            }
657
        if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) {
658
        else {
658
            print $input->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber&searchid=$searchid");
659
            push @errors,$error;
659
        } elsif  ($defaultview eq 'marc' && $views->{can_view_MARC}) {
660
            $errortest++
660
            print $input->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid");
661
            }
661
        } elsif  ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) {
662
        }
662
            print $input->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid");
663
        if($errortest > 0){
663
        } else {
664
            $nextop="additem";
664
            print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
665
        } 
666
        else {
667
            my $defaultview = C4::Context->preference('IntranetBiblioDefaultView');
668
            my $views = { C4::Search::enabled_staff_search_views };
669
            if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) {
670
                print $input->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber&searchid=$searchid");
671
            } elsif  ($defaultview eq 'marc' && $views->{can_view_MARC}) {
672
                print $input->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid");
673
            } elsif  ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) {
674
                print $input->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid");
675
            } else {
676
                print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid");
677
            }
678
            exit;
679
        }
665
        }
680
	}
666
        exit;
667
    }
681
#-------------------------------------------------------------------------------
668
#-------------------------------------------------------------------------------
682
} elsif ($op eq "saveitem") {
669
} elsif ($op eq "saveitem") {
683
#-------------------------------------------------------------------------------
670
#-------------------------------------------------------------------------------
684
- 

Return to bug 18254