Bugzilla – Attachment 62207 Details for
Bug 18254
Remove C4::Items::GetItemsByBiblioitemnumber call from additem.pl
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18254: Remove call to GetItemsByBiblioitemnumber call from additem.pl
Bug-18254-Remove-call-to-GetItemsByBiblioitemnumbe.patch (text/plain), 4.15 KB, created by
Alex Buckley
on 2017-04-17 09:56:42 UTC
(
hide
)
Description:
Bug 18254: Remove call to GetItemsByBiblioitemnumber call from additem.pl
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-04-17 09:56:42 UTC
Size:
4.15 KB
patch
obsolete
>From 69701f20405f41f42ed244c01196162f31ea0b26 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Sun, 12 Mar 2017 22:56:19 -0300 >Subject: [PATCH] Bug 18254: Remove call to GetItemsByBiblioitemnumber call > from additem.pl > >The code from additem to delete all the items of a bibliographic record >is very ackward. >This patch simplifies the algorithm and make the code more readable. > >Test plan: >Remove all the items of a bibliographic records >If at least 1 item is checked out you should get an error. > >No change with the current behavior is expected. > >Signed-off-by: Alex Buckley <alexbuckley@catalyst.net.nz> >--- > cataloguing/additem.pl | 55 +++++++++++++++++++------------------------------- > 1 file changed, 21 insertions(+), 34 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 669fa4a..f49d254 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -644,41 +644,28 @@ if ($op eq "additem") { > #------------------------------------------------------------------------------- > } elsif ($op eq "delallitems") { > #------------------------------------------------------------------------------- >- my @biblioitems = &GetBiblioItemByBiblioNumber($biblionumber); >- my $errortest=0; >- my $itemfail; >- foreach my $biblioitem (@biblioitems) { >- my $items = &GetItemsByBiblioitemnumber( $biblioitem->{biblioitemnumber} ); >- >- foreach my $item (@$items) { >- $error =&DelItemCheck( $biblionumber, $item->{itemnumber} ); >- $itemfail =$item; >- if($error == 1){ >- next >- } >- else { >- push @errors,$error; >- $errortest++ >- } >- } >- if($errortest > 0){ >- $nextop="additem"; >- } >- else { >- my $defaultview = C4::Context->preference('IntranetBiblioDefaultView'); >- my $views = { C4::Search::enabled_staff_search_views }; >- if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) { >- print $input->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber&searchid=$searchid"); >- } elsif ($defaultview eq 'marc' && $views->{can_view_MARC}) { >- print $input->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid"); >- } elsif ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) { >- print $input->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid"); >- } else { >- print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid"); >- } >- exit; >+ my $itemnumbers = C4::Items::GetItemnumbersForBiblio( $biblionumber ); >+ foreach my $itemnumber ( @$itemnumbers ) { >+ $error = C4::Items::DelItemCheck( $biblionumber, $itemnumber ); >+ next if $error == 1; # Means ok >+ push @errors,$error; >+ } >+ if ( @errors ) { >+ $nextop="additem"; >+ } else { >+ my $defaultview = C4::Context->preference('IntranetBiblioDefaultView'); >+ my $views = { C4::Search::enabled_staff_search_views }; >+ if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) { >+ print $input->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber&searchid=$searchid"); >+ } elsif ($defaultview eq 'marc' && $views->{can_view_MARC}) { >+ print $input->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid"); >+ } elsif ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) { >+ print $input->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid"); >+ } else { >+ print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid"); > } >- } >+ exit; >+ } > #------------------------------------------------------------------------------- > } elsif ($op eq "saveitem") { > #------------------------------------------------------------------------------- >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18254
:
61041
|
62207
|
64329