steffen: server/kolab-resource-handlers/kolab-resource-handlers/freebusy freebusycache.class.php, 1.13, 1.14 recurrence.class.php, 1.7, 1.8
cvs at intevation.de
cvs at intevation.de
Fri Jan 14 05:41:15 CET 2005
Author: steffen
Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy
In directory doto:/tmp/cvs-serv13287/kolab-resource-handlers/kolab-resource-handlers/freebusy
Modified Files:
freebusycache.class.php recurrence.class.php
Log Message:
fixes for issues 243 (recurrence) and 616 (policy server/ldap)
Index: freebusycache.class.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/freebusycache.class.php,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- freebusycache.class.php 13 Jan 2005 02:41:31 -0000 1.13
+++ freebusycache.class.php 14 Jan 2005 04:41:13 -0000 1.14
@@ -127,7 +127,9 @@
if( file_exists($fbfilename) ) {
if( !is_null($ts)) $ts = filectime($fbfilename);
$acl = $this->loadACL($filename);
- myLog("FreeBusyCache::load(), ts=$ts, acl=".print_r($acl,true), RM_LOG_DEBUG);
+ myLog("FreeBusyCache::load(): ts=$ts acl=[ "
+ .str_replace("\n",", ",$this->aclToString($acl))
+ ."] )", RM_LOG_DEBUG);
return file_get_contents($fbfilename);
}
return false;
Index: recurrence.class.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/recurrence.class.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- recurrence.class.php 13 Jan 2005 02:41:31 -0000 1.7
+++ recurrence.class.php 14 Jan 2005 04:41:13 -0000 1.8
@@ -89,15 +89,16 @@
// Weekly recurrence, every 'interval' weeks
if( !$this->interval ) $this->interval = 1;
$count = 0;
- $delta_days = getdate($this->initial_start);
- $delta_days = $delta_days['mday'];
- for( $t = strtotime( "-$delta_days days", $this->initial_start ); $t < $endstamp; $t = strtotime( "+$interval months", $t) ) {
+ $delta_days = (int)gmdate('d',$this->initial_start);
+ for( $t = strtotime( '-'.($delta_days+15).' days', $this->initial_start ); $t < $endstamp; $t = strtotime( "+$interval months", $t)) {
+ myLog('t = '.gmdate('M d Y H:i:s',strtotime('-15 days', $t)), RM_LOG_DEBUG);
if( $this->type == 'daynumber') {
// On numbered days
foreach( $this->daynumber as $dayno ) {
- $tmp = strtotime( "+$dayno days", $t);
+ $tmp = strtotime( '+'.($dayno-16).' days', $t);
if( $tmp >= $this->initial_start && $tmp < $endstamp ) {
- //myLog("Adding recurrence $tmp -> ".($tmp+$duration), RM_LOG_DEBUG );
+ myLog("Adding recurrence ".gmdate("M d Y H:i:s",$tmp)." -> "
+ .gmdate("M d Y H:i:s",$tmp+$duration), RM_LOG_DEBUG );
$this->setBusy( $tmp, null, $duration );
} else {
break;
@@ -109,9 +110,10 @@
for( $i = 0; $i < count($this->daynumber); $i++ ) {
$dayno = $this->daynumber[$i];
$wday = $this->day[$i];
- $tmp = strtotime( "+$dayno $wday", $t);
+ $tmp = strtotime( "+$dayno $wday", strtotime('-15 days',$t));
if( $tmp >= $this->initial_start && $tmp < $endstamp ) {
- //myLog("Adding recurrence $tmp -> ".($tmp+$duration), RM_LOG_DEBUG );
+ myLog("Adding recurrence ".gmdate("M d Y H:i:s",$tmp)." -> "
+ .gmdate("M d Y H:i:s",$tmp+$duration), RM_LOG_DEBUG );
$this->setBusy( $tmp, null, $duration );
} else if($tmp >= $endstamp ) {
break;
@@ -121,15 +123,15 @@
}
if( $this->range_type == 'number' && $count > $this->range ) {
break;
- } else if( $this->range_type == 'date' && $t > strtotime( '+1 day',$this->range ) ) {
+ } else if( $this->range_type == 'date'
+ && strtotime('-15 days',$t) > strtotime( '+1 day',$this->range ) ) {
break;
}
}
case 'yearly':
if( !$this->interval ) $interval = 1;
$count = 0;
- $delta_days = getdate($this->initial_start);
- $delta_days = $delta_days['yday'];
+ $delta_days = (int)gmdate('z',$this->initial_start);
for( $t = strtotime( "-$delta_days days", $this->initial_start ); $t < $endstamp; $t = strtotime( "+$interval years", $t) ) {
if( $this->type == 'yearday') {
foreach( $this->daynumber as $dayno ) {
More information about the commits
mailing list