Bugzilla – Attachment 64329 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.20 KB, created by
Kyle M Hall (khall)
on 2017-06-15 14:31:53 UTC
(
hide
)
Description:
Bug 18254: Remove call to GetItemsByBiblioitemnumber call from additem.pl
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2017-06-15 14:31:53 UTC
Size:
4.20 KB
patch
obsolete
>From e05d0159651d53af4d051a253fde8d50d1dbe64c 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> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > cataloguing/additem.pl | 55 +++++++++++++++++++------------------------------- > 1 file changed, 21 insertions(+), 34 deletions(-) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 1ee8d82..c986b19 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.10.2
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