steffen: server/kolab-resource-handlers/kolab-resource-handlers/freebusy recurrence.class.php, 1.10, 1.11

cvs at intevation.de cvs at intevation.de
Fri Jan 21 04:01:01 CET 2005


Author: steffen

Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy
In directory doto:/tmp/cvs-serv6776/kolab-resource-handlers/freebusy

Modified Files:
	recurrence.class.php 
Log Message:
Recurrence stuff (Issue243 etc.)

Index: recurrence.class.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/recurrence.class.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- recurrence.class.php	21 Jan 2005 00:19:59 -0000	1.10
+++ recurrence.class.php	21 Jan 2005 03:00:59 -0000	1.11
@@ -148,11 +148,11 @@
 	for( $i = 0; $i < count($this->day); $i++ ) {
 	  $dayno = $this->daynumber[$i];
 	  $wday  = $this->dayname2number($this->day[$i]);
-	  if( $wday < $firstday ) $tmp2 = strtotime( '+'.($dayno+1)*7+$wday.' days', $tmp);
-	  else $tmp2 = strtotime( '+'.$dayno*7+$wday.' days', $tmp);
-	  //myLog("daynumber=$dayno, wday=$wday", RM_LOG_DEBUG);
-	  //myLog('tmp2 = '.gmdate('M d Y H:i:s',$tmp2), RM_LOG_DEBUG);
-	  if( $tmp2 >= $this->initial_start && $tmp2 < $endstamp ) {
+	  $tmp_month = gmdate('m',$tmp); // make sure same month
+	  if( $wday < $firstday ) $tmp2 = strtotime( '+'.($dayno*7+$wday-$firstday).' days', $tmp);
+	  else $tmp2 = strtotime( '+'.(($dayno-1)*7+$wday-$firstday).' days', $tmp);
+	  $tmp2_month = gmdate('m',$tmp2); // make sure same month
+	  if( $tmp_month == $tmp2_month && $tmp2 >= $this->initial_start && $tmp2 < $endstamp ) {
 	    myLog("Adding recurrence ".gmdate("D, M d Y H:i:s",$tmp2)." -> "
 		  .gmdate("D, M d Y H:i:s",$tmp2+$duration), RM_LOG_DEBUG );
 	    $this->setBusy( $tmp2, null, $duration );





More information about the commits mailing list