only pass needsconfirmation to template if issuing is possible

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Ryan HIggins 2008-05-10 13:19:15 -05:00 committed by Joshua Ferraro
parent fc03a2510c
commit 92ca50980f
1 changed files with 16 additions and 14 deletions

View File

@ -120,7 +120,7 @@ $printer = C4::Context->userenv->{'branchprinter'};
my $barcode = $query->param('barcode') || '';
$barcode = barcodedecode($barcode) if(C4::Context->preference('itemBarcodeInputFilter'));
$barcode = barcodedecode($barcode) if( $barcode && C4::Context->preference('itemBarcodeInputFilter'));
my $year = $query->param('year');
my $month = $query->param('month');
my $day = $query->param('day');
@ -252,7 +252,6 @@ if ($borrowernumber) {
# STEP 3 : ISSUING
#
#
if ($barcode) {
# always check for blockers on issuing
my ( $error, $question ) =
@ -276,19 +275,22 @@ if ($barcode) {
else {
my $noquestion = 1;
# Get the item title for more information
my $getmessageiteminfo = GetBiblioFromItemNumber(undef,$barcode);
foreach my $needsconfirmation ( keys %$question ) {
$template->param(
$needsconfirmation => $$question{$needsconfirmation},
getTitleMessageIteminfo => $getmessageiteminfo->{'title'},
NEEDSCONFIRMATION => 1
);
$noquestion = 0;
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;
}
}
$template->param(
itemhomebranch => $getmessageiteminfo->{'homebranch'} ,
duedatespec => $duedatespec,
# only pass needsconfirmation to template if issuing is possible
$template->param(
itemhomebranch => $getmessageiteminfo->{'homebranch'} ,
duedatespec => $duedatespec,
);
if ( $noerror && ( $noquestion || $issueconfirmed ) ) {
AddIssue( $borrower, $barcode, $datedue );