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)

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2017-03-15 16:02:31 -03:00
parent b2e305b10b
commit 1544f9a5d4
3 changed files with 15 additions and 15 deletions

View File

@ -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;
}

View File

@ -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 %]

View File

@ -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 %]&amp;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 %]&amp;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 %]&amp;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 %]&amp;itemnumber=[% checkout_info.item.itemnumber %]#item[% checkout_info.item.itemnumber %]">[% checkout_info.item.barcode %]</a>
</td>
<td>
[% IF checkout_info.NEEDSCONFIRMATION %]