Adding dates for display to circulation.pl Minor bug fixes.
authorPaul POULAIN <paul@koha-fr.org>
Tue, 9 Oct 2007 21:46:30 +0000 (16:46 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Tue, 9 Oct 2007 23:44:46 +0000 (18:44 -0500)
Signed-off-by: Chris Cormack <crc@liblime.com>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Circulation.pm
circ/circulation.pl
circ/overdue.pl

index 561a801..8cfba92 100644 (file)
@@ -762,8 +762,7 @@ sub CanBookBeIssued {
             $issuingimpossible{NO_MORE_RENEWALS} = 1;
         }
         else {
-
-            #        $needsconfirmation{RENEW_ISSUE} = 1;
+            $needsconfirmation{RENEW_ISSUE} = 1;
         }
     }
     elsif ($issue->{borrowernumber}) {
@@ -807,17 +806,14 @@ sub CanBookBeIssued {
 "$res->{'reservedate'} : $resborrower->{'firstname'} $resborrower->{'surname'} ($resborrower->{'cardnumber'})";
         }
     }
-    if ( C4::Context->preference("LibraryName") eq "Horowhenua Library Trust" )
-    {
+    if ( C4::Context->preference("LibraryName") eq "Horowhenua Library Trust" ) {
         if ( $borrower->{'categorycode'} eq 'W' ) {
             my %issuingimpossible;
             return ( \%issuingimpossible, \%needsconfirmation );
-        }
-        else {
+        } else {
             return ( \%issuingimpossible, \%needsconfirmation );
         }
-    }
-    else {
+    } else {
         return ( \%issuingimpossible, \%needsconfirmation );
     }
 }
@@ -985,13 +981,11 @@ if ($borrower and $barcode and $barcodecheck ne '0'){
         my $datedue  = time + ($loanlength) * 86400;
         my @datearr  = localtime($datedue);
         my $dateduef =
-            ( 1900 + $datearr[5] ) . "-"
-          . ( $datearr[4] + 1 ) . "-"
-          . $datearr[3];
+            sprintf("%04d-%02d-%02d", 1900 + $datearr[5], $datearr[4] + 1, $datearr[3]);
         if ($date) {
             $dateduef = $date;
         }
-       $dateduef=CheckValidDatedue($dateduef,$item->{'itemnumber'},C4::Context->userenv->{'branch'});
+       $dateduef=CheckValidDatedue($dateduef,$item->{'itemnumber'},C4::Context->userenv->{'branch'});
        # if ReturnBeforeExpiry ON the datedue can't be after borrower expirydate
         if ( C4::Context->preference('ReturnBeforeExpiry')
             && $dateduef gt $borrower->{dateexpiry} )
index 4717038..606a3c5 100755 (executable)
@@ -211,8 +211,8 @@ if ($borrowernumber) {
         #borrowercard expired or nearly expired, warn the librarian
         $template->param(
             flagged       => "1",
-            warndeparture => "1",
-            renewaldate   => "$renew_year-$renew_month-$renew_day"
+            warndeparture => format_date($borrower->{dateexpiry}),
+            renewaldate   => format_date("$renew_year-$renew_month-$renew_day")
         );
     }
     # check for NotifyBorrowerDeparture
@@ -221,7 +221,7 @@ if ($borrowernumber) {
             Date_to_Days(Add_Delta_Days($warning_year,$warning_month,$warning_day,- C4::Context->preference('NotifyBorrowerDeparture'))) <
             Date_to_Days( $today_year, $today_month, $today_day )) ) 
         {
-            $template->param("warndeparture" => 1);
+            $template->param("warndeparture" => format_date($borrower->{dateexpiry}));
         }
     $template->param(
         overduecount => $od,
index 33da5fe..81d3aa3 100755 (executable)
@@ -37,7 +37,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         query           => $input,
         type            => "intranet",
         authnotrequired => 0,
-        flagsrequired   => { reports => 1 },
+        flagsrequired   => { reports => 1, circulate => 1 },
         debug           => 1,
     }
 );