+
+ if ($issueconfirmed && $noerror) {
+ # we have no blockers for issuing and any issues needing confirmation have been resolved
+ AddIssue( $borrower, $barcode, $datedue, $cancelreserve );
+ $inprocess = 1;
+ }
+ elsif ($issueconfirmed){ # FIXME: Do something? Or is this to *intentionally* do nothing?
+ if (C4::Context->preference("AllowNotForLoanOverride")){
+ AddIssue( $borrower, $barcode, $datedue, $cancelreserve );
+ $template->param(IMPOSSIBLE => 0);
+ $inprocess = 1;
+ }
+ }
+ else {
+ my $noquestion = 1;
+# Get the item title for more information
+ my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode);
+ if ($noerror) {
+ # only pass needsconfirmation to template if issuing is possible
+ foreach my $needsconfirmation ( keys %$question ) {
+ $template->param(
+ $needsconfirmation => $$question{$needsconfirmation},
+ getTitleMessageIteminfo => $getmessageiteminfo->{'title'},
+ NEEDSCONFIRMATION => 1
+ );
+ $noquestion = 0;
+ }
+ # Because of the weird conditional structure (empty elsif block),
+ # if we reached here, $issueconfirmed must be false.
+ # Also, since we moved inside the if ($noerror) conditional,
+ # this old chunky conditional can be simplified:
+ # if ( $noerror && ( $noquestion || $issueconfirmed ) ) {
+ if ($noquestion) {
+ AddIssue( $borrower, $barcode, $datedue );
+ $inprocess = 1;
+ }
+ }
+ $template->param(
+ itemhomebranch => $getmessageiteminfo->{'homebranch'} ,
+ duedatespec => $duedatespec,