koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/members moremember.pl [dev_week]


From: Kyle Hall
Subject: [Koha-cvs] koha/members moremember.pl [dev_week]
Date: Fri, 05 Jan 2007 15:27:12 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         dev_week
Changes by:     Kyle Hall <kylemhall>   07/01/05 15:27:12

Modified files:
        members        : moremember.pl 

Log message:
        

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/members/moremember.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.5.2.14.2.1&r2=1.5.2.14.2.2

Patches:
Index: moremember.pl
===================================================================
RCS file: /sources/koha/koha/members/moremember.pl,v
retrieving revision 1.5.2.14.2.1
retrieving revision 1.5.2.14.2.2
diff -u -b -r1.5.2.14.2.1 -r1.5.2.14.2.2
--- moremember.pl       19 Sep 2006 13:40:57 -0000      1.5.2.14.2.1
+++ moremember.pl       5 Jan 2007 15:27:12 -0000       1.5.2.14.2.2
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: moremember.pl,v 1.5.2.14.2.1 2006/09/19 13:40:57 oleonard Exp $
+# $Id: moremember.pl,v 1.5.2.14.2.2 2007/01/05 15:27:12 kylemhall Exp $
 
 # script to do a borrower enquiry/bring up borrower details etc
 # Displays all the details about a borrower
@@ -81,6 +81,26 @@
 $data->{'dateofbirth'} = format_date($data->{'dateofbirth'});
 $data->{'IS_ADULT'} = ($data->{'categorycode'} ne 'I');
 
+#Find the current date in the format MM/DD/YYYY to check if the account's 
expiry is past the current date.
+#If it *is* past the expiration date, add the Template variable 'expired' => 1
+#Note to other devs: If there is a simpler and cleaner way to do this, by all 
mean replace it.
+my ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, 
$dayOfYear, $daylightSavings) = localtime();
+my $year = 1900 + $yearOffset;
+$month++;
+if ($month < 10) {$month = '0' . $month;}
+if ($dayOfMonth < 10) {$dayOfMonth = '0' . $dayOfMonth;}
+my $currentDate = $dayOfMonth . $month . $year;
+
+my $expiry = format_date($data->{'expiry'});
+my @expArray = split('/', $expiry);
+my $expiryDate = $expArray[1] . $expArray[0] . $expArray[2];
+
+if ( $expiryDate > $currentDate ) {
+  $data->{'expired'} = 1;
+}
+#End of check for card expiration
+  
+
 if($data->{'debarred'} || $data->{'gonenoaddress'} || $data->{'lost'} || 
$data->{'borrowernotes'}){
        $template->param(flagged =>1);
 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]