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

Kyle Hall kyle.m.hall at gmail.com
Mon Mar 19 18:03:39 CET 2007


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Kyle Hall <kylemhall>	07/03/19 17:03:39

Modified files:
	members        : moremember.pl 

Log message:
	Added alert for failed renewals from moremember.pl

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.3&r2=1.5.2.14.2.4

Patches:
Index: moremember.pl
===================================================================
RCS file: /sources/koha/koha/members/moremember.pl,v
retrieving revision 1.5.2.14.2.3
retrieving revision 1.5.2.14.2.4
diff -u -b -r1.5.2.14.2.3 -r1.5.2.14.2.4
--- moremember.pl	9 Jan 2007 14:55:41 -0000	1.5.2.14.2.3
+++ moremember.pl	19 Mar 2007 17:03:39 -0000	1.5.2.14.2.4
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-# $Id: moremember.pl,v 1.5.2.14.2.3 2007/01/09 14:55:41 kylemhall Exp $
+# $Id: moremember.pl,v 1.5.2.14.2.4 2007/03/19 17:03:39 kylemhall Exp $
 
 # script to do a borrower enquiry/bring up borrower details etc
 # Displays all the details about a borrower
@@ -69,6 +69,27 @@
 			     debug => 1,
 			     });
 
+#Script recieves failed renewals in the syntax renewFailure1 = itemnumber, renewFailure2 = itemnumber, etc.
+#Loop through renewal failures and push them on the array @renewFailures
+my @renewFailures;
+my $renewFailuresCount = 0;
+my $renewFailuresIndex = 1; #Starts with 1 because screwy things can happen with string comparisons and 0
+my $keepGoing = 1;
+if ( $keepGoing ) {
+  my $renewFailure = $input->param('renewFailure' . $renewFailuresIndex);
+  if ( $renewFailure ) {
+    push( @renewFailures, $renewFailure );
+    $renewFailuresCount++;
+    $renewFailuresIndex++;
+  } else {
+    $keepGoing = 0;
+  }
+}
+if ( $renewFailuresCount ) {
+  $template->param( failedrenewals => 1 );
+}
+
+
 my $bornum=$input->param('bornum');
 
 #start the page and read in includes
@@ -187,6 +208,17 @@
 	$row{'itemtype'}=&ItemType($itemtype);
 	$row{'charge'}= sprintf("%.2f",$charge);
 
+	# Check to see if this item was a failed attempted renewal
+        my $itemnumber = $issue->[$i]{'itemnumber'};
+        my $found = 0;
+        foreach my $renewItemnumber ( @renewFailures ) {
+          if ( $itemnumber == $renewItemnumber ) {
+            $found = 1;
+            last;
+          }
+        }
+        $row{'failedrenewal'} = $found;
+
 	#check item is not reserved
 	my ($restype,$reserves)=CheckReserves($issue->[$i]{'itemnumber'});
 	if ($restype){





More information about the Koha-cvs mailing list