Bugzilla – Attachment 64893 Details for
Bug 18277
Koha::Biblio - Remove GetBiblionumberFromItemnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18277: Remove GetBiblionumberFromItemnumber - linkitem
Bug-18277-Remove-GetBiblionumberFromItemnumber---l.patch (text/plain), 3.79 KB, created by
Marcel de Rooy
on 2017-07-07 08:35:43 UTC
(
hide
)
Description:
Bug 18277: Remove GetBiblionumberFromItemnumber - linkitem
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2017-07-07 08:35:43 UTC
Size:
3.79 KB
patch
obsolete
>From 3ce3ab592f6ba7f71b658684f8a59fc1ff7b0d46 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 15 Mar 2017 12:30:53 -0300 >Subject: [PATCH] Bug 18277: Remove GetBiblionumberFromItemnumber - linkitem >Content-Type: text/plain; charset=utf-8 > >Test plan: >Enable EasyAnalyticalRecords and link an item to another one (Edit > >link to host item) > >Signed-off-by: Josef Moravec <josef.moravec@gmail.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > cataloguing/linkitem.pl | 69 +++++++++++----------- > .../prog/en/modules/cataloguing/linkitem.tt | 1 - > 2 files changed, 34 insertions(+), 36 deletions(-) > >diff --git a/cataloguing/linkitem.pl b/cataloguing/linkitem.pl >index 082c7b0..5f33c16 100755 >--- a/cataloguing/linkitem.pl >+++ b/cataloguing/linkitem.pl >@@ -56,43 +56,42 @@ if ($marcflavour eq 'MARC21' || $marcflavour eq 'NORMARC') { > > $template->param(biblionumber => $biblionumber); > >-if ($barcode && $biblionumber) { >- >- # We get the host itemnumber >- my $hostitemnumber = GetItemnumberFromBarcode($barcode); >- >- if ($hostitemnumber) { >- my $hostbiblionumber = GetBiblionumberFromItemnumber($hostitemnumber); >- >- if ($hostbiblionumber) { >- my $field = PrepHostMarcField($hostbiblionumber, $hostitemnumber,$marcflavour); >- $biblio->append_fields($field); >- >- my $modresult = ModBiblio($biblio, $biblionumber, ''); >- if ($modresult) { >- $template->param(success => 1); >- } else { >- $template->param(error => 1, >- errornomodbiblio => 1); >- } >- } else { >- $template->param(error => 1, >- errornohostbiblionumber => 1); >- } >- } else { >- $template->param(error => 1, >- errornohostitemnumber => 1); >- >+if ( $barcode && $biblionumber ) { >+ >+ my $item = Koha::Items->find( { barcode => $barcode } ); >+ >+ if ($item) { >+ my $field = PrepHostMarcField( $item->biblio->biblionumber, $item->itemnumber, $marcflavour ); >+ $biblio->append_fields($field); >+ >+ my $modresult = ModBiblio( $biblio, $biblionumber, '' ); >+ if ($modresult) { >+ $template->param( success => 1 ); >+ } >+ else { >+ $template->param( >+ error => 1, >+ errornomodbiblio => 1 >+ ); >+ } >+ } >+ else { >+ $template->param( >+ error => 1, >+ errornohostitemnumber => 1, >+ ); > } >+ > $template->param( >- barcode => $barcode, >- hostitemnumber => $hostitemnumber, >- ); >- >-} else { >- $template->param(missingparameter => 1); >- if (!$barcode) { $template->param(missingbarcode => 1); } >- if (!$biblionumber) { $template->param(missingbiblionumber => 1); } >+ barcode => $barcode, >+ hostitemnumber => $item->itemnumber, >+ ); >+ >+} >+else { >+ $template->param( missingparameter => 1 ); >+ if ( !$barcode ) { $template->param( missingbarcode => 1 ); } >+ if ( !$biblionumber ) { $template->param( missingbiblionumber => 1 ); } > } > > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/linkitem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/linkitem.tt >index 4261554..0741fce 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/linkitem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/linkitem.tt >@@ -11,7 +11,6 @@ > [% IF ( error ) %] > <div class="dialog alert"> > [% IF ( errornomodbiblio ) %]ERROR: Unable to modify the bibliographic record.[% END %] >- [% IF ( errornohostbiblionumber ) %]ERROR: Unable to get the biblio number of host item.[% END %] > [% IF ( errornohostitemnumber ) %]ERROR: Unable to get the item number from this barcode.[% END %] > </div> > <form action="/cgi-bin/koha/catalogue/MARCdetail.pl" method="post"> >-- >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 18277
:
61127
|
61128
|
61129
|
61130
|
63301
|
63302
|
63303
|
63304
|
64819
|
64820
|
64821
|
64822
|
64892
| 64893 |
64894
|
64895
|
64896