fix the previous patch to add a syspref that permit to choose the renewal period...
authorNahuel Angelinetti <nahuel.angelinetti@biblibre.com>
Fri, 6 Mar 2009 10:38:04 +0000 (11:38 +0100)
committerGalen Charlton <galen.charlton@liblime.com>
Mon, 11 May 2009 20:20:09 +0000 (15:20 -0500)
This patch just check the syspref and use it as base date of renew.

Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
C4/Circulation.pm
installer/data/mysql/en/mandatory/sysprefs.sql
installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
kohaversion.pl

index 465913e..1c8052b 100644 (file)
@@ -2142,8 +2142,11 @@ sub AddRenewal {
                        $item->{homebranch}                     # item's homebranch determines loanlength OR do we want the branch specified by the AddRenewal argument?
         );
 
+        $datedue = (C4::Context->preference('RenewalPeriodBase') eq 'date_due') ?
+                                        C4::Dates->new($issuedata->{date_due}, 'iso') :
+                                        C4::Dates->new();
         #FIXME -- use circControl?
-        $datedue =  CalcDateDue(C4::Dates->new($issuedata->{date_due}, 'iso'),$loanlength,$branch);    # this branch is the transactional branch.
+        $datedue =  CalcDateDue($datedue,$loanlength,$branch); # this branch is the transactional branch.
         # The question of whether to use item's homebranch calendar is open.
     }
 
index b984f25..25b845c 100644 (file)
@@ -240,3 +240,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('L
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesEnabled','0','Enable or Disable Library Thing for Libraries Features','','YesNo'); 
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesTabbedView','0','Put LibraryThingForLibraries Content in Tabs.','','YesNo');
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'AllowNotForLoanOverride', '0', '', 'If ON, Koha will allow the librarian to loan a not for loan item.', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalPeriodBase', 'date_due', 'Set whether the renewal date should be counted from the date_due or from the moment the Patron asks for renewal ','date_due|now','Choice');
index 56f910b..08cbe11 100644 (file)
@@ -242,3 +242,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('L
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesEnabled','0','Enable or Disable Library Thing for Libraries Features','','YesNo'); 
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('LibraryThingForLibrariesTabbedView','0','Put LibraryThingForLibraries Content in Tabs.','','YesNo');
 INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'AllowNotForLoanOverride', '0', '', 'If ON, Koha will allow the librarian to loan a not for loan item.', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('RenewalPeriodBase', 'date_due', 'Permet de déterminer si la période de renouvellement doit être calculée sur la date de retour ou sur le jour du renouvellement','date_due|now','Choice');
index d5c0203..dbcc126 100644 (file)
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.01.00.031';
+    our $VERSION = '3.01.00.032';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install