[Kolab-devel] Kolab Date problem in resource handler

Pieter Vanmeerbeek pieter.vanmeerbeek at able.be
Wed Feb 15 15:47:44 CET 2006


This seems to fix the problem for me, however I'm not sure if other software
components use this routine which might now be broken : 

resmgr.php

function iCalDate2Kolab($ical_date)
{
    myLog("Converting ".print_r($ical_date,true),RM_LOG_DEBUG);
   
    if (is_array($ical_date)) {
	# going to create date again
	$temp['zone']   = array_key_exists('zone',$ical_date) ?
$ical_date['zone'] :  'UTC';
	$temp['hour']   = array_key_exists('hour',$ical_date) ?
$ical_date['hour'] :  '00';
	$temp['minute']   = array_key_exists('minute',$ical_date) ?
$ical_date['minute'] :  '00';
	$temp['second']   = array_key_exists('second',$ical_date) ?
$ical_date['second'] :  '00';
	$temp['year']   = array_key_exists('year',$ical_date) ?
$ical_date['year'] :  '0000';
	$temp['month']   = array_key_exists('month',$ical_date) ?
$ical_date['month'] :  '00';
	$temp['mday']   = array_key_exists('mday',$ical_date) ?
$ical_date['mday'] :  '00';
	$time = sprintf('%02d:%02d:%02d',
                        $temp['hour'], $temp['minute'], $temp['second']);
        if ($temp['zone'] == 'UTC') {
            $time .= 'Z';
        }
        $date= sprintf('%04d-%02d-%02d',$temp['year'], $temp['month'],
$temp['mday']). "T".$time;
    }  else {
	  // $ical_date should be a timestamp
        $date = gmstrftime('%Y-%m-%dT%H:%M:%SZ', $ical_date);
    }
    myLog("To <$date>",RM_LOG_DEBUG);
     return $date;
}


Kind regards,
Pieter


 

-----Original Message-----
From: kolab-devel-bounces at kolab.org [mailto:kolab-devel-bounces at kolab.org]
On Behalf Of Pieter Vanmeerbeek
Sent: woensdag 15 februari 2006 15:24
To: 'Kolab issue tracker'; 'Kolab development coordination';
kolab-devel at intevation.org
Subject: [Kolab-devel] Kolab Date problem in resource handler

 Hi,

I'm currenlty running kolab 2.0.1 , I know some bugfixes are applied to
2.0.3.
However, I think this problem is still there in version 2.0.3 as I cannot
find any differnce in the CVS tree (file of 5/2).

The problem is that automatic accepted calendar items of a resource are
generated with a start and date in 1970 : 

  <start-date>2006-01-01T00:00:01Z</start-date>
  <end-date>2006-01-01T00:00:01Z</end-date>


This is due to format problem in the time indications --> array of
day/month/year instead of one timestring.
Tracing this in the code, leads me to the resmgr.php script, routine
iCalDate2Kolab : 

function iCalDate2Kolab($ical_date)
{
    // $ical_date should be a timestamp
    return gmstrftime('%Y-%m-%dT%H:%M:%SZ', $ical_date); }


As indicated in the coment ,it expects a timestamp and not an array -->
gives 1/1/1970 --> all-day calendar items of reousrce are not visible in
Konsec konnector and do not show up in freebusy file.

Is there a fix for this available?



Kind regards,
Pieter

--
Able - aXs GUARD on Infosecurity Brussels 22 & 23 march 2006
(http://www.infosecurity.be)
---------------------------------------------------
aXs GUARD Training Center
more info at http://www.axsguard.com/indextraining.htm

aXs GUARD has completed security and anti-virus checks on this e-mail
(http://www.axsguard.com)
---------------------------------------------------
Able NV: ond.nr 0457.938.087

_______________________________________________
Kolab-devel mailing list
Kolab-devel at kolab.org
https://kolab.org/mailman/listinfo/kolab-devel


--
Able - aXs GUARD on Infosecurity Brussels 22 & 23 march 2006 (http://www.infosecurity.be)
---------------------------------------------------
aXs GUARD Training Center 
more info at http://www.axsguard.com/indextraining.htm

aXs GUARD has completed security and anti-virus checks on this e-mail (http://www.axsguard.com)
---------------------------------------------------
Able NV: ond.nr 0457.938.087




More information about the devel mailing list