fix for bug 2371: Change fine block message behavior...
authorJesse Weaver <jesse.weaver@liblime.com>
Fri, 18 Jul 2008 17:54:03 +0000 (12:54 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Fri, 18 Jul 2008 18:15:13 +0000 (13:15 -0500)
This adds a variable to the checkout form, debt_confirmed, that is 1 when the de
bt block message has been canceled for this session.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl

index 3f35aa6..7cfa0c4 100755 (executable)
@@ -92,6 +92,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user (
         flagsrequired   => { circulate => 1 },
     }
 );
+
 my $branches = GetBranches();
 
 my $printers = GetPrinters();
@@ -130,6 +131,7 @@ my $cancelreserve  = $query->param('cancelreserve');
 my $organisation   = $query->param('organisations');
 my $print          = $query->param('print');
 my $newexpiry      = $query->param('dateexpiry');
+my $debt_confirmed = $query->param('debt_confirmed') || 0; # Don't show the debt error dialog twice
 
 #set up cookie.....
 # my $branchcookie;
@@ -261,6 +263,8 @@ if ($barcode) {
   my ( $error, $question ) =
     CanBookBeIssued( $borrower, $barcode, $datedue , $inprocess );
   my $noerror = $invalidduedate ? 0 : 1;
+
+  delete $question->{'DEBT'} if ($debt_confirmed);
   foreach my $impossible ( keys %$error ) {
             $template->param(
                 $impossible => $$error{$impossible},
@@ -452,7 +456,6 @@ if ($borrower) {
         # ADDED BY JF: NEW ITEMTYPE COUNT DISPLAY
         $issued_itemtypes_count->{ $it->{'itemtype'} }++;
 
-        warn "$todaysdate, $it->{'issuedate'}, $it->{'lastreneweddate'}, $it->{'barcode'}";
         if ( $todaysdate eq $it->{'issuedate'} or $todaysdate eq $it->{'lastreneweddate'} ) {
             push @todaysissues, $it;
         } else {
@@ -713,9 +716,10 @@ $template->param( picture => 1 ) if $picture;
 
 
 $template->param(
+    debt_confirmed           => $debt_confirmed,
     SpecifyDueDate           => C4::Context->preference("SpecifyDueDate"),
     CircAutocompl            => C4::Context->preference("CircAutocompl"),
-       dateformat            => C4::Context->preference("dateformat"),
+    dateformat               => C4::Context->preference("dateformat"),
     DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),
 );
 output_html_with_http_headers $query, $cookie, $template->output;
index cc32439..1229390 100755 (executable)
@@ -112,7 +112,8 @@ $.tablesorter.addParser({
     <input type="hidden" name="barcode" value="<!-- TMPL_VAR NAME="barcode" -->" />
     <input type="hidden" name="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
     <input type="hidden" name="issueconfirmed" value="1" />
-       <input type="hidden" name="duedatespec" value="<!-- TMPL_VAR NAME="duedatespec" -->" />
+    <!-- TMPL_IF NAME="DEBT" --><input type="hidden" name="debt_confirmed" value="1" /><!-- /TMPL_IF -->
+    <input type="hidden" name="duedatespec" value="<!-- TMPL_VAR NAME="duedatespec" -->" />
     <input type="hidden" name="day" value="<!-- TMPL_VAR name="day" -->" />
     <input type="hidden" name="month" value="<!-- TMPL_VAR name="month" -->" />
     <input type="hidden" name="year" value="<!-- TMPL_VAR name="year" -->" />
@@ -171,10 +172,10 @@ $.tablesorter.addParser({
         <!-- TMPL_IF NAME="EXPIRED" -->
             <li>Patron's card is expired</li>
         <!-- /TMPL_IF -->
-       
-       <!-- TMPL_IF NAME="NOTSAMEBRANCH" -->
-            <li>This item belongs to <!-- TMPL_VAR NAME="itemhomebranch" --> and cannot be issued from this location.</li>
-       <!-- /TMPL_IF -->        
+
+        <!-- TMPL_IF NAME="NOTSAMEBRANCH" -->
+            <li>This item belongs to <!-- TMPL_VAR NAME="itemhomebranch" --> and cannot be issued from this location.</li>
+        <!-- /TMPL_IF --> 
         </ul>
 
     <!-- TMPL_IF NAME="memberofinstution" -->
@@ -273,6 +274,7 @@ No patron matched <span class="ex"><!-- TMPL_VAR name="message" --></span>
           <input type="hidden" name="branch" value="<!-- TMPL_VAR NAME="branch" -->" />
           <input type="hidden" name="printer" value="<!-- TMPL_VAR NAME="printer" -->" />
           <input type="hidden" name="print" value="maybe" />
+          <input type="hidden" name="debt_confirmed" value="<!-- TMPL_VAR NAME="debt_confirmed" -->" />
                 <!-- TMPL_IF NAME="CHARGES" -->
                         <input type="hidden" name="charges" value="yes" />
                         <input type="hidden" name="oldamount" value="<!-- TMPL_VAR NAME="amountold" -->" />