koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] koha/C4 Calendar.pm [rel_2_2]


From: Ryan Higgins
Subject: [Koha-cvs] koha/C4 Calendar.pm [rel_2_2]
Date: Mon, 09 Apr 2007 17:33:51 +0000

CVSROOT:        /sources/koha
Module name:    koha
Branch:         rel_2_2
Changes by:     Ryan Higgins <rych>     07/04/09 17:33:51

Modified files:
        C4             : Calendar.pm 

Log message:
        change syspref choice & pod

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/C4/Calendar.pm?cvsroot=koha&only_with_tag=rel_2_2&r1=1.2.2.3&r2=1.2.2.4

Patches:
Index: Calendar.pm
===================================================================
RCS file: /sources/koha/koha/C4/Calendar.pm,v
retrieving revision 1.2.2.3
retrieving revision 1.2.2.4
diff -u -b -r1.2.2.3 -r1.2.2.4
--- Calendar.pm 9 Apr 2007 17:14:34 -0000       1.2.2.3
+++ Calendar.pm 9 Apr 2007 17:33:50 -0000       1.2.2.4
@@ -473,6 +473,12 @@
 
 C<$offset> Is the number of days that this function has to count from $date.
 
+System Preference 'useDaysMode' controls behavior:
+Days -> ignore holidays.
+Datedue -> if normally calculated date due falls on a holiday, extend the loan 
length
+to the next non-holiday.
+Calendar (default) -> only non-holiday dates count toward the loan length.
+
 =cut
 
 sub addDate {
@@ -482,15 +488,14 @@
        }
     
        my $daysMode = C4::Context->preference('useDaysMode');
-    warn $daysMode;
-       if ($daysMode eq 'normal') {
+       if ($daysMode eq 'Days') {
         ($year, $month, $day) = Add_Delta_Days($year, $month, $day, $offset );
-    } elsif ($daysMode eq 'datedue') {
+    } elsif ($daysMode eq 'Datedue') {
         ($year, $month, $day) = Add_Delta_Days($year, $month, $day, $offset );
         while ($self->isHoliday($day, $month, $year)) {
                 ($year, $month, $day) = Add_Delta_Days($year, $month, $day, 1);
         }
-    } else {            ### ($daysMode eq 'length') {
+    } else {            ### ($daysMode eq 'Calendar') {
         while ($offset > 0) {
                 ($year, $month, $day) = Add_Delta_Days($year, $month, $day, 1);
             if (!($self->isHoliday($day, $month, $year))) {




reply via email to

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