Bugzilla – Attachment 63123 Details for
Bug 18276
Koha::Biblio - Remove GetBiblioFromItemNumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18276: Remove GetBiblioFromItemNumber - circulation pages
Bug-18276-Remove-GetBiblioFromItemNumber---circula.patch (text/plain), 7.22 KB, created by
Jonathan Druart
on 2017-05-04 15:09:20 UTC
(
hide
)
Description:
Bug 18276: Remove GetBiblioFromItemNumber - circulation pages
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2017-05-04 15:09:20 UTC
Size:
7.22 KB
patch
obsolete
>From 15b5e1d70bf6e4889af7927c9c06ffd29c745362 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 15 Mar 2017 16:02:31 -0300 >Subject: [PATCH] Bug 18276: Remove GetBiblioFromItemNumber - circulation pages > >Test plan: >1. Checkout items in a batch >The information displayed should be ok (title, subtitles, author, >itemnotes, barcode) >2. Checkout an item using the standard checkout page >You should correctly see the information of the item that has been >checked out (title and author) >--- > circ/circulation.pl | 26 +++++++++++----------- > .../prog/en/modules/circ/circulation.tt | 2 +- > .../en/modules/circ/circulation_batch_checkouts.tt | 2 +- > 3 files changed, 15 insertions(+), 15 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index ebb8d8b..895d61c 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -49,6 +49,7 @@ use Koha::Patron::Debarments qw(GetDebarments); > use Koha::DateUtils; > use Koha::Database; > use Koha::BiblioFrameworks; >+use Koha::Items; > use Koha::Patron::Messages; > use Koha::Patron::Images; > use Koha::SearchEngine; >@@ -329,10 +330,10 @@ if (@$barcodes) { > $template_params->{alert} = $alerts; > $template_params->{messages} = $messages; > >- # Get the item title for more information >- my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode); >+ my $item = Koha::Items->find({ barcode => $barcode }); >+ my $biblio = $item->biblio; > >- my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.notforloan', authorised_value => { not => undef } }); >+ my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.notforloan', authorised_value => { not => undef } }); > $template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef; > > # Fix for bug 7494: optional checkout-time fallback search for a book >@@ -376,22 +377,21 @@ if (@$barcodes) { > $blocker = 1; > } > } >- my $iteminfo = GetBiblioFromItemNumber(undef, $barcode); > if( !$blocker || $force_allow_issue ){ > my $confirm_required = 0; > unless($issueconfirmed){ > # Get the item title for more information >- my $materials = $iteminfo->{'materials'}; >- my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.materials', authorised_value => $materials }); >+ my $materials = $item->materials; >+ my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.materials', authorised_value => $materials }); > $materials = $descriptions->{lib} // $materials; > $template_params->{additional_materials} = $materials; >- $template_params->{itemhomebranch} = $iteminfo->{'homebranch'}; >+ $template_params->{itemhomebranch} = $item->homebranch; > > # pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed. > foreach my $needsconfirmation ( keys %$question ) { > $template_params->{$needsconfirmation} = $$question{$needsconfirmation}; >- $template_params->{getTitleMessageIteminfo} = $iteminfo->{'title'}; >- $template_params->{getBarcodeMessageIteminfo} = $iteminfo->{'barcode'}; >+ $template_params->{getTitleMessageIteminfo} = $biblio->title; >+ $template_params->{getBarcodeMessageIteminfo} = $item->barcode; > $template_params->{NEEDSCONFIRMATION} = 1; > $template_params->{onsite_checkout} = $onsite_checkout; > $confirm_required = 1; >@@ -413,7 +413,7 @@ if (@$barcodes) { > } > > $template->param( >- itembiblionumber => $getmessageiteminfo->{'biblionumber'} >+ itembiblionumber => $biblio->biblionumber > ); > > >@@ -421,9 +421,9 @@ if (@$barcodes) { > $patron = Koha::Patrons->find( $borrowernumber ); > $template_params->{issuecount} = $patron->checkouts->count; > >- if ( $iteminfo ) { >- $iteminfo->{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($iteminfo->{biblionumber}), GetFrameworkCode($iteminfo->{biblionumber})); >- $template_params->{item} = $iteminfo; >+ if ( $item ) { >+ $template_params->{item} = $item; >+ $template_params->{biblio} = $biblio; > } > push @$checkout_infos, $template_params; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index e133b95..e4da8ce 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -287,7 +287,7 @@ $(document).ready(function() { > [% END %] > > [% IF PREVISSUE %] >- <li>Patron has previously checked out this title: <b>[% item.title %] [% IF item.author %] by [% item.author %][% END %]</b>. Check out anyway?</li> >+ <li>Patron has previously checked out this title: <b>[% biblio.title %] [% IF biblio.author %] by [% biblio.author %][% END %]</b>. Check out anyway?</li> > [% END %] > > [% IF BIBLIO_ALREADY_ISSUED %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >index 3fd88e3..1fc917f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt >@@ -134,7 +134,7 @@ $(document).ready(function() { > [% END %] > <td>[% checkout_info.barcode %]</td> > <td> >- <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout_info.item.biblionumber %]&type=intra"><strong>[% checkout_info.item.title |html %][% FOREACH subtitl IN checkout_info.item.subtitle %] [% subtitl.subfield %][% END %]</strong></a>[% IF checkout_info.item.author %], by [% checkout_info.item.author %][% END %][% IF ( checkout_info.itme.itemnotes ) %]- <span class="circ-hlt">[% checkout_info.item.itemnotes %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout_info.item.biblionumber %]&itemnumber=[% checkout_info.item.itemnumber %]#item[% checkout_info.item.itemnumber %]">[% checkout_info.item.barcode %]</a> >+ <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% checkout_info.biblio.biblionumber %]&type=intra"><strong>[% checkout_info.biblio.title |html %][% FOREACH subtitle IN checkout_info.biblio.subtitles %] [% subtitle.subfield %][% END %]</strong></a>[% IF checkout_info.biblio.author %], by [% checkout_info.biblio.author %][% END %][% IF ( checkout_info.item.itemnotes ) %]- <span class="circ-hlt">[% checkout_info.item.itemnotes %]</span>[% END %] <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout_info.biblio.biblionumber %]&itemnumber=[% checkout_info.item.itemnumber %]#item[% checkout_info.item.itemnumber %]">[% checkout_info.item.barcode %]</a> > </td> > <td> > [% IF checkout_info.NEEDSCONFIRMATION %] >-- >2.9.3
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 18276
:
61122
|
61123
|
61124
|
61125
|
61126
|
61177
|
61178
|
61179
|
61180
|
61181
|
62081
|
62082
|
62083
|
62084
|
62085
|
62476
|
62477
|
62478
|
62479
|
62480
|
62481
|
63121
|
63122
|
63123
|
63124
|
63125
|
63126
|
63166
|
63294
|
63295
|
63296
|
63297
|
63298
|
63299
|
63300
|
64748
|
64809
|
64810
|
64811
|
64812
|
64813
|
64814
|
64815
|
64816
|
64817
|
64878
|
64879
|
64880
|
64881
|
64882
|
64883
|
64884
|
64885
|
64886
|
64887
|
64974
|
64975