Lines 49-54
use Koha::Patron::Debarments qw(GetDebarments);
Link Here
|
49 |
use Koha::DateUtils; |
49 |
use Koha::DateUtils; |
50 |
use Koha::Database; |
50 |
use Koha::Database; |
51 |
use Koha::BiblioFrameworks; |
51 |
use Koha::BiblioFrameworks; |
|
|
52 |
use Koha::Items; |
52 |
use Koha::Patron::Messages; |
53 |
use Koha::Patron::Messages; |
53 |
use Koha::Patron::Images; |
54 |
use Koha::Patron::Images; |
54 |
use Koha::SearchEngine; |
55 |
use Koha::SearchEngine; |
Lines 329-338
if (@$barcodes) {
Link Here
|
329 |
$template_params->{alert} = $alerts; |
330 |
$template_params->{alert} = $alerts; |
330 |
$template_params->{messages} = $messages; |
331 |
$template_params->{messages} = $messages; |
331 |
|
332 |
|
332 |
# Get the item title for more information |
333 |
my $item = Koha::Items->find({ barcode => $barcode }); |
333 |
my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode); |
334 |
my $biblio = $item->biblio; |
334 |
|
335 |
|
335 |
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.notforloan', authorised_value => { not => undef } }); |
336 |
my $mss = Koha::MarcSubfieldStructures->search({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.notforloan', authorised_value => { not => undef } }); |
336 |
$template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef; |
337 |
$template_params->{authvalcode_notforloan} = $mss->count ? $mss->next->authorised_value : undef; |
337 |
|
338 |
|
338 |
# Fix for bug 7494: optional checkout-time fallback search for a book |
339 |
# Fix for bug 7494: optional checkout-time fallback search for a book |
Lines 376-397
if (@$barcodes) {
Link Here
|
376 |
$blocker = 1; |
377 |
$blocker = 1; |
377 |
} |
378 |
} |
378 |
} |
379 |
} |
379 |
my $iteminfo = GetBiblioFromItemNumber(undef, $barcode); |
|
|
380 |
if( !$blocker || $force_allow_issue ){ |
380 |
if( !$blocker || $force_allow_issue ){ |
381 |
my $confirm_required = 0; |
381 |
my $confirm_required = 0; |
382 |
unless($issueconfirmed){ |
382 |
unless($issueconfirmed){ |
383 |
# Get the item title for more information |
383 |
# Get the item title for more information |
384 |
my $materials = $iteminfo->{'materials'}; |
384 |
my $materials = $item->materials; |
385 |
my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({ frameworkcode => $getmessageiteminfo->{frameworkcode}, kohafield => 'items.materials', authorised_value => $materials }); |
385 |
my $descriptions = Koha::AuthorisedValues->get_description_by_koha_field({ frameworkcode => $biblio->frameworkcode, kohafield => 'items.materials', authorised_value => $materials }); |
386 |
$materials = $descriptions->{lib} // ''; |
386 |
$materials = $descriptions->{lib} // ''; |
387 |
$template_params->{additional_materials} = $materials; |
387 |
$template_params->{additional_materials} = $materials; |
388 |
$template_params->{itemhomebranch} = $iteminfo->{'homebranch'}; |
388 |
$template_params->{itemhomebranch} = $item->homebranch; |
389 |
|
389 |
|
390 |
# pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed. |
390 |
# pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed. |
391 |
foreach my $needsconfirmation ( keys %$question ) { |
391 |
foreach my $needsconfirmation ( keys %$question ) { |
392 |
$template_params->{$needsconfirmation} = $$question{$needsconfirmation}; |
392 |
$template_params->{$needsconfirmation} = $$question{$needsconfirmation}; |
393 |
$template_params->{getTitleMessageIteminfo} = $iteminfo->{'title'}; |
393 |
$template_params->{getTitleMessageIteminfo} = $biblio->title; |
394 |
$template_params->{getBarcodeMessageIteminfo} = $iteminfo->{'barcode'}; |
394 |
$template_params->{getBarcodeMessageIteminfo} = $item->barcode; |
395 |
$template_params->{NEEDSCONFIRMATION} = 1; |
395 |
$template_params->{NEEDSCONFIRMATION} = 1; |
396 |
$template_params->{onsite_checkout} = $onsite_checkout; |
396 |
$template_params->{onsite_checkout} = $onsite_checkout; |
397 |
$confirm_required = 1; |
397 |
$confirm_required = 1; |
Lines 413-419
if (@$barcodes) {
Link Here
|
413 |
} |
413 |
} |
414 |
|
414 |
|
415 |
$template->param( |
415 |
$template->param( |
416 |
itembiblionumber => $getmessageiteminfo->{'biblionumber'} |
416 |
itembiblionumber => $biblio->biblionumber |
417 |
); |
417 |
); |
418 |
|
418 |
|
419 |
|
419 |
|
Lines 421-429
if (@$barcodes) {
Link Here
|
421 |
$patron = Koha::Patrons->find( $borrowernumber ); |
421 |
$patron = Koha::Patrons->find( $borrowernumber ); |
422 |
$template_params->{issuecount} = $patron->checkouts->count; |
422 |
$template_params->{issuecount} = $patron->checkouts->count; |
423 |
|
423 |
|
424 |
if ( $iteminfo ) { |
424 |
if ( $item ) { |
425 |
$iteminfo->{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($iteminfo->{biblionumber}), GetFrameworkCode($iteminfo->{biblionumber})); |
425 |
$template_params->{item} = $item; |
426 |
$template_params->{item} = $iteminfo; |
426 |
$template_params->{biblio} = $biblio; |
427 |
} |
427 |
} |
428 |
push @$checkout_infos, $template_params; |
428 |
push @$checkout_infos, $template_params; |
429 |
} |
429 |
} |