From 314e818294787fec631cdcb36831d11c0de9227f Mon Sep 17 00:00:00 2001 From: Nahuel Angelinetti Date: Fri, 6 Mar 2009 11:38:04 +0100 Subject: [PATCH] fix the previous patch to add a syspref that permit to choose the renewal period(day or date_due). This patch just check the syspref and use it as base date of renew. Signed-off-by: Henri-Damien LAURENT Signed-off-by: Galen Charlton --- C4/Circulation.pm | 5 ++++- installer/data/mysql/en/mandatory/sysprefs.sql | 1 + .../data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql | 1 + kohaversion.pl | 2 +- 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 465913ebf1..1c8052b8f5 100644 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -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. } diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index b984f25765..25b845c48c 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -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'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index 56f910bcc7..08cbe11a62 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -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'); diff --git a/kohaversion.pl b/kohaversion.pl index d5c0203d17..dbcc126684 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -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 -- 2.11.0