Lines 87-92
if (!C4::Context->userenv && !$branch){
Link Here
|
87 |
} |
87 |
} |
88 |
} |
88 |
} |
89 |
|
89 |
|
|
|
90 |
my $barcodes = []; |
91 |
if ( my $barcode = $query->param('barcode') ) { |
92 |
$barcodes = [ $barcode ]; |
93 |
} |
94 |
|
90 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( |
95 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user ( |
91 |
{ |
96 |
{ |
92 |
template_name => 'circ/circulation.tt', |
97 |
template_name => 'circ/circulation.tt', |
Lines 131-140
if (C4::Context->preference("DisplayClearScreenButton")) {
Link Here
|
131 |
$template->param(DisplayClearScreenButton => 1); |
136 |
$template->param(DisplayClearScreenButton => 1); |
132 |
} |
137 |
} |
133 |
|
138 |
|
134 |
my $barcode = $query->param('barcode') || q{}; |
139 |
for my $barcode ( @$barcodes ) { |
135 |
$barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace |
140 |
$barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace |
|
|
141 |
$barcode = barcodedecode($barcode) |
142 |
if( $barcode && C4::Context->preference('itemBarcodeInputFilter')); |
143 |
} |
136 |
|
144 |
|
137 |
$barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter')); |
|
|
138 |
my $stickyduedate = $query->param('stickyduedate') || $session->param('stickyduedate'); |
145 |
my $stickyduedate = $query->param('stickyduedate') || $session->param('stickyduedate'); |
139 |
my $duedatespec = $query->param('duedatespec') || $session->param('stickyduedate'); |
146 |
my $duedatespec = $query->param('duedatespec') || $session->param('stickyduedate'); |
140 |
my $issueconfirmed = $query->param('issueconfirmed'); |
147 |
my $issueconfirmed = $query->param('issueconfirmed'); |
Lines 144-150
my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt
Link Here
|
144 |
my $charges = $query->param('charges') || q{}; |
151 |
my $charges = $query->param('charges') || q{}; |
145 |
|
152 |
|
146 |
# Check if stickyduedate is turned off |
153 |
# Check if stickyduedate is turned off |
147 |
if ( $barcode ) { |
154 |
if ( @$barcodes ) { |
148 |
# was stickyduedate loaded from session? |
155 |
# was stickyduedate loaded from session? |
149 |
if ( $stickyduedate && ! $query->param("stickyduedate") ) { |
156 |
if ( $stickyduedate && ! $query->param("stickyduedate") ) { |
150 |
$session->clear( 'stickyduedate' ); |
157 |
$session->clear( 'stickyduedate' ); |
Lines 177-188
if( $onsite_checkout && !$duedatespec_allow ) {
Link Here
|
177 |
our $todaysdate = C4::Dates->new->output('iso'); |
184 |
our $todaysdate = C4::Dates->new->output('iso'); |
178 |
|
185 |
|
179 |
# check and see if we should print |
186 |
# check and see if we should print |
180 |
if ( $barcode eq '' && $print eq 'maybe' ) { |
187 |
if ( @$barcodes == 0 && $print eq 'maybe' ) { |
181 |
$print = 'yes'; |
188 |
$print = 'yes'; |
182 |
} |
189 |
} |
183 |
|
190 |
|
184 |
my $inprocess = ($barcode eq '') ? '' : $query->param('inprocess'); |
191 |
my $inprocess = (@$barcodes == 0) ? '' : $query->param('inprocess'); |
185 |
if ( $barcode eq '' && $charges eq 'yes' ) { |
192 |
if ( @$barcodes == 0 && $charges eq 'yes' ) { |
186 |
$template->param( |
193 |
$template->param( |
187 |
PAYCHARGES => 'yes', |
194 |
PAYCHARGES => 'yes', |
188 |
borrowernumber => $borrowernumber |
195 |
borrowernumber => $borrowernumber |
Lines 294-318
if ($borrowernumber) {
Link Here
|
294 |
# STEP 3 : ISSUING |
301 |
# STEP 3 : ISSUING |
295 |
# |
302 |
# |
296 |
# |
303 |
# |
297 |
if ($barcode) { |
304 |
if (@$barcodes) { |
|
|
305 |
my $checkout_infos; |
306 |
for my $barcode ( @$barcodes ) { |
307 |
my $template_params = { barcode => $barcode }; |
298 |
# always check for blockers on issuing |
308 |
# always check for blockers on issuing |
299 |
my ( $error, $question, $alerts ) = |
309 |
my ( $error, $question, $alerts ) = |
300 |
CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess ); |
310 |
CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess ); |
301 |
my $blocker = $invalidduedate ? 1 : 0; |
311 |
my $blocker = $invalidduedate ? 1 : 0; |
302 |
|
312 |
|
303 |
$template->param( alert => $alerts ); |
313 |
$template_params->{alert} = $alerts; |
304 |
|
314 |
|
305 |
# Get the item title for more information |
315 |
# Get the item title for more information |
306 |
my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode); |
316 |
my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode); |
307 |
$template->param( |
317 |
$template_params->{authvalcode_notforloan} = |
308 |
authvalcode_notforloan => C4::Koha::GetAuthValCode('items.notforloan', $getmessageiteminfo->{'frameworkcode'}), |
318 |
C4::Koha::GetAuthValCode('items.notforloan', $getmessageiteminfo->{'frameworkcode'}); |
309 |
); |
319 |
|
310 |
# Fix for bug 7494: optional checkout-time fallback search for a book |
320 |
# Fix for bug 7494: optional checkout-time fallback search for a book |
311 |
|
321 |
|
312 |
if ( $error->{'UNKNOWN_BARCODE'} |
322 |
if ( $error->{'UNKNOWN_BARCODE'} |
313 |
&& C4::Context->preference("itemBarcodeFallbackSearch") ) |
323 |
&& C4::Context->preference("itemBarcodeFallbackSearch") |
|
|
324 |
) |
314 |
{ |
325 |
{ |
315 |
$template->param( FALLBACK => 1 ); |
326 |
$template_params->{FALLBACK} = 1; |
316 |
|
327 |
|
317 |
my $query = "kw=" . $barcode; |
328 |
my $query = "kw=" . $barcode; |
318 |
my ( $searcherror, $results, $total_hits ) = SimpleSearch($query); |
329 |
my ( $searcherror, $results, $total_hits ) = SimpleSearch($query); |
Lines 334-370
if ($barcode) {
Link Here
|
334 |
} |
345 |
} |
335 |
} |
346 |
} |
336 |
} |
347 |
} |
337 |
$template->param( options => \@options ); |
348 |
$template_params->{options} = \@options; |
338 |
} |
349 |
} |
339 |
} |
350 |
} |
340 |
|
351 |
|
341 |
unless( $onsite_checkout and C4::Context->preference("OnSiteCheckoutsForce") ) { |
352 |
unless( $onsite_checkout and C4::Context->preference("OnSiteCheckoutsForce") ) { |
342 |
delete $question->{'DEBT'} if ($debt_confirmed); |
353 |
delete $question->{'DEBT'} if ($debt_confirmed); |
343 |
foreach my $impossible ( keys %$error ) { |
354 |
foreach my $impossible ( keys %$error ) { |
344 |
$template->param( |
355 |
$template_params->{$impossible} = $$error{$impossible}; |
345 |
$impossible => $$error{$impossible}, |
356 |
$template_params->{IMPOSSIBLE} = 1; |
346 |
IMPOSSIBLE => 1 |
|
|
347 |
); |
348 |
$blocker = 1; |
357 |
$blocker = 1; |
349 |
} |
358 |
} |
350 |
} |
359 |
} |
|
|
360 |
my $iteminfo = GetBiblioFromItemNumber(undef, $barcode); |
351 |
if( !$blocker || $force_allow_issue ){ |
361 |
if( !$blocker || $force_allow_issue ){ |
352 |
my $confirm_required = 0; |
362 |
my $confirm_required = 0; |
353 |
unless($issueconfirmed){ |
363 |
unless($issueconfirmed){ |
354 |
# Get the item title for more information |
364 |
# Get the item title for more information |
355 |
my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode); |
365 |
$template_params->{additional_materials} = $iteminfo->{'materials'}; |
356 |
$template->{VARS}->{'additional_materials'} = $getmessageiteminfo->{'materials'}; |
366 |
$template_params->{itemhomebranch} = $iteminfo->{'homebranch'}; |
357 |
$template->param( itemhomebranch => $getmessageiteminfo->{'homebranch'} ); |
|
|
358 |
|
367 |
|
359 |
# pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed. |
368 |
# pass needsconfirmation to template if issuing is possible and user hasn't yet confirmed. |
360 |
foreach my $needsconfirmation ( keys %$question ) { |
369 |
foreach my $needsconfirmation ( keys %$question ) { |
361 |
$template->param( |
370 |
$template_params->{$needsconfirmation} = $$question{$needsconfirmation}; |
362 |
$needsconfirmation => $$question{$needsconfirmation}, |
371 |
$template_params->{getTitleMessageIteminfo} = $iteminfo->{'title'}; |
363 |
getTitleMessageIteminfo => $getmessageiteminfo->{'title'}, |
372 |
$template_params->{getBarcodeMessageIteminfo} = $iteminfo->{'barcode'}; |
364 |
getBarcodeMessageIteminfo => $getmessageiteminfo->{'barcode'}, |
373 |
$template_params->{NEEDSCONFIRMATION} = 1; |
365 |
NEEDSCONFIRMATION => 1, |
374 |
$template_params->{onsite_checkout} => $onsite_checkout, |
366 |
onsite_checkout => $onsite_checkout, |
|
|
367 |
); |
368 |
$confirm_required = 1; |
375 |
$confirm_required = 1; |
369 |
} |
376 |
} |
370 |
} |
377 |
} |
Lines 374-382
if ($barcode) {
Link Here
|
374 |
$inprocess = 1; |
381 |
$inprocess = 1; |
375 |
} |
382 |
} |
376 |
} |
383 |
} |
377 |
|
384 |
|
378 |
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines($borrowernumber); |
385 |
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines($borrowernumber); |
379 |
$template->param( issuecount => $issue ); |
386 |
|
|
|
387 |
# FIXME If the issue is confirmed, we launch another time GetMemberIssuesAndFines, now display the issue count after issue |
388 |
my ( $od, $issue, $fines ) = GetMemberIssuesAndFines( $borrowernumber ); |
389 |
$iteminfo->{issuecount} = $issue; |
390 |
|
391 |
if ( $iteminfo ) { |
392 |
$iteminfo->{subtitle} = GetRecordValue('subtitle', GetMarcBiblio($iteminfo->{biblionumber}), GetFrameworkCode($iteminfo->{biblionumber})); |
393 |
$template_params->{item} = $iteminfo; |
394 |
} |
395 |
push @$checkout_infos, $template_params; |
396 |
} |
397 |
|
398 |
$template->param( %{$checkout_infos->[0]} ); |
399 |
$template->param( barcode => $barcodes->[0] ); |
380 |
} |
400 |
} |
381 |
|
401 |
|
382 |
# reload the borrower info for the sake of reseting the flags..... |
402 |
# reload the borrower info for the sake of reseting the flags..... |
Lines 585-591
$template->param(
Link Here
|
585 |
cardnumber => $borrower->{'cardnumber'}, |
605 |
cardnumber => $borrower->{'cardnumber'}, |
586 |
othernames => $borrower->{'othernames'}, |
606 |
othernames => $borrower->{'othernames'}, |
587 |
amountold => $amountold, |
607 |
amountold => $amountold, |
588 |
barcode => $barcode, |
608 |
barcodes => $barcodes, |
589 |
stickyduedate => $stickyduedate, |
609 |
stickyduedate => $stickyduedate, |
590 |
duedatespec => $duedatespec, |
610 |
duedatespec => $duedatespec, |
591 |
message => $message, |
611 |
message => $message, |
592 |
- |
|
|