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