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