my $checkout = $item->checkout;
my $biblio = $item->biblio;
$template->param(
- title => $biblio->title,
- homebranch => $item->homebranch,
- holdingbranch => $item->holdingbranch,
- returnbranch => $returnbranch,
- author => $biblio->author,
- itembarcode => $item->barcode,
- itemtype => $item->effective_itemtype,
- ccode => $item->ccode,
- itembiblionumber => $biblio->biblionumber,
- biblionumber => $biblio->biblionumber,
+ title => $biblio->title,
+ homebranch => $item->homebranch,
+ holdingbranch => $item->holdingbranch,
+ returnbranch => $returnbranch,
+ author => $biblio->author,
+ itembarcode => $item->barcode,
+ itemtype => $item->effective_itemtype,
+ ccode => $item->ccode,
+ itembiblionumber => $biblio->biblionumber,
+ biblionumber => $biblio->biblionumber,
additional_materials => $materials,
- issue => $checkout,
+ issue => $checkout,
);
} # FIXME else we should not call AddReturn but set BadBarcode directly instead
my $return_date = $dropboxmode ? $dropboxdate : $return_date_override_dt;
+ # Block return if multi-part and confirm has not been received
+ my $needs_confirm =
+ C4::Context->preference("CircConfirmItemParts")
+ && $item
+ && $item->materials
+ && !$query->param('multiple_confirm');
+ $template->param( 'multiple_confirmed' => 1 )
+ if $query->param('multiple_confirm');
+
# do the return
( $returned, $messages, $issue, $borrower ) =
- AddReturn( $barcode, $userenv_branch, $exemptfine, $return_date );
+ AddReturn( $barcode, $userenv_branch, $exemptfine, $return_date )
+ unless $needs_confirm;
if ($returned) {
my $time_now = dt_from_string()->truncate( to => 'minute');
);
}
}
- } elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} ) {
+ } elsif ( C4::Context->preference('ShowAllCheckins') and !$messages->{'BadBarcode'} and !$needs_confirm ) {
$input{duedate} = 0;
$returneditems{0} = $barcode;
$riduedate{0} = 0;
push( @inputloop, \%input );
}
$template->param( privacy => $borrower->{privacy} );
+
+ if ( $needs_confirm ) {
+ $template->param( needs_confirm => $needs_confirm );
+ }
}
$template->param( inputloop => \@inputloop );