From 47321d0068dd51053a3f6cc209fe7ffa4adc5d14 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Tue, 9 Oct 2007 16:46:30 -0500 Subject: [PATCH] Adding dates for display to circulation.pl Minor bug fixes. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- C4/Circulation.pm | 18 ++++++------------ circ/circulation.pl | 6 +++--- circ/overdue.pl | 2 +- 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 561a801853..8cfba9213e 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -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} ) diff --git a/circ/circulation.pl b/circ/circulation.pl index 4717038d32..606a3c5451 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -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, diff --git a/circ/overdue.pl b/circ/overdue.pl index 33da5fe2e2..81d3aa37d1 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -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, } ); -- 2.39.5