[Koha-patches] [PATCH] only pass needsconfirmation to template if issuing is possible

Ryan Higgins rch at liblime.com
Sat May 10 20:19:15 CEST 2008


From: Ryan HIggins <rch at false.(none)>

---
 circ/circulation.pl |   24 +++++++++++++-----------
 1 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/circ/circulation.pl b/circ/circulation.pl
index 390370d..823ba80 100755
--- a/circ/circulation.pl
+++ b/circ/circulation.pl
@@ -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 ) =
@@ -277,16 +276,19 @@ if ($barcode) {
         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;
+		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(
+			# only pass needsconfirmation to template if issuing is possible 
+		$template->param(
 			 itemhomebranch => $getmessageiteminfo->{'homebranch'} ,	             
 			 duedatespec => $duedatespec,
         );
-- 
1.5.4.2




More information about the Koha-patches mailing list