koha-devel
[Top][All Lists]
Advanced

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

[Koha-devel] new patch for renewscript.pl


From: Ernesto Silva - Webmaster
Subject: [Koha-devel] new patch for renewscript.pl
Date: Tue Mar 8 07:47:08 2005
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913

Hi,
this patch overrides the one sent by Andrés last week, I've killed some bugs ;)

Ernesto.


--- /usr/local/src/packages/koha/koha-2.2.1/intranet-cgi/renewscript.pl.orig 2005-03-04 09:27:45.007947848 -0300
+++ renewscript.pl      2005-03-08 13:49:32.898799512 -0300
@@ -23,44 +23,57 @@
# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
 # Suite 330, Boston, MA  02111-1307 USA

+# Revision History:
+# 2005-04-03 E. Silva and A. Tarallo: We added a local customization to allow +# borrowing a book to an arbitry choosen date, overriding the issuing rules. +# To use this feature you must pass as parameters both stickyduedate_$itemno
+# (a chek box) and date_$itemno (due date) for each item you want to renew.
+# This CGI might be called from moremember.pl or circulation.pl; if you call
+# it from circulation.pl you must pass the parameter destination with the
+# value circ and cardnunber with the user cardnumber.
+
 use CGI;
-# use C4::Circulation::Renewals2;
 use C4::Circulation::Circ2;
 #get input
 my $input= new CGI;
-#print $input->header;
-
-#print $input->dump;

 my @names=$input->param();
 my address@hidden;
 my %data;
+my %date;

 for (my $i=0;$i<$count;$i++){
   if ($names[$i] =~ /renew/){
     my $temp=$names[$i];
-    $temp=~ s/renew_item_//;
-    $data{$temp}=$input->param($names[$i]);
+    $temp=~ s/renew_item_//; # $temp contains the itemnumber
+ $data{$temp} = $input->param($names[$i]); # $data{$temp} contains 'y' or 'n' + $date{$temp} = $input->param("year_$temp")."-".$input->param("month_$temp")."-".$input->param("day_$temp");
   }
 }
+
 my %env;
 my $destination = $input->param("destination");
 my $cardnumber = $input->param("cardnumber");
 my $bornum=$input->param("bornum");
 while ( my ($itemno, $value) = each %data) {
-#    warn "$itemno = $value\n";
-   if ($value eq 'y'){
-     #means we want to renew this item
-     #check its status
-     my $status=renewstatus(\%env,$bornum,$itemno);
-     if ($status == 1){
-       renewbook(\%env,$bornum,$itemno);
-     }
-   }
+       if ($value eq 'y'){
+#means we want to renew this item
+#check its status
+               my $status=renewstatus(\%env,$bornum,$itemno);
+               if ($status == 1){
+# ORT: We enabled a way to override standard issuing rules. Items could be
+# borrowed till a date filled by the operator.
+                       if ($input->param("stickyduedate_$itemno")) {
+ renewbook(\%env,$bornum,$itemno,$date{$itemno});
+                       } else {
+                               renewbook(\%env,$bornum,$itemno);
+                       }
+               }
+       }
 }

 if($destination eq "circ"){
print $input->redirect("/cgi-bin/koha/circ/circulation.pl?findborrower=$cardnumber");
 } else {
print $input->redirect("/cgi-bin/koha/members/moremember.pl?bornum=$bornum");
-}
\ No newline at end of file
+}



reply via email to

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