steffen: server/kolab-resource-handlers/kolab-resource-handlers/freebusy freebusy.class.php, 1.9, 1.10
cvs at intevation.de
cvs at intevation.de
Tue Oct 26 02:33:06 CEST 2004
Author: steffen
Update of /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy
In directory doto:/tmp/cvs-serv15866/kolab-resource-handlers/freebusy
Modified Files:
freebusy.class.php
Log Message:
tried to handle timezone issues
Index: freebusy.class.php
===================================================================
RCS file: /kolabrepository/server/kolab-resource-handlers/kolab-resource-handlers/freebusy/freebusy.class.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- freebusy.class.php 21 Oct 2004 10:12:49 -0000 1.9
+++ freebusy.class.php 26 Oct 2004 00:33:04 -0000 1.10
@@ -160,7 +160,7 @@
$count = 0;
for( $t = $initial_start; $t < $endstamp; $t = strtotime( "+$interval weeks", $t) ) {
foreach( $rec['day'] as $day ) {
- $tmp = strtotime( $day, $t);// + $this->getTimePart( $t );
+ $tmp = strtotime( $day, $t);
if( $tmp < $endstamp ) {
myLog("Adding recurrence $tmp -> ".($tmp+$duration), RM_LOG_DEBUG );
$vFb->addBusyPeriod('BUSY', $tmp, null, $duration, $extra);
@@ -188,7 +188,8 @@
continue;
}
- $vFb->addBusyPeriod('BUSY', $initial_start, $initial_end, null, $extra);
+ $vFb->addBusyPeriod('BUSY', $initial_start + FreeBusy::tzOffset($initial_start),
+ $initial_end + FreeBusy::tzOffset($initial_end), null, $extra);
}
}
@@ -202,6 +203,11 @@
/********************** Private API below this line ********************/
+ function tzOffset( $ts ) {
+ $dstr = date('O',$ts);
+ return 3600 * substr( $dstr, 0, 3) + 60 * substr( $dstr, 3, 2);
+ }
+
// static function to compute foldername for imap
function imapFolderName( $user, $owner, $folder = false, $default_domain = false ) {
$userdom = false;
@@ -271,12 +277,6 @@
return @gmmktime($time['hour'], $time['minute'], $time['second'],
$date['month'], $date['mday'], $date['year']);
- }
-
- /* Return the time of day of a timestamp as seconds since midnight */
- function getTimePart( $ts ) {
- $a = getdate($ts);
- return mktime( $a['hour'], $a['minutes'], $a['seconds'],0,0,0,0 );
}
function getEventHash($xml_text) {
More information about the commits
mailing list