[Kolab-devel] FW:  Kolab Date problem in resource handler
    Pieter Vanmeerbeek 
    pieter.vanmeerbeek at able.be
       
    Wed Feb 15 17:08:03 CET 2006
    
    
  
 
Sorry about previous posts in HTML (stupid outlook, I disabled it now).
Here's the request again in plain text
Kind regards,
Pieter
________________________________
From: kolab-devel-bounces at kolab.org [mailto:kolab-devel-bounces at kolab.org]
On Behalf Of Pieter Vanmeerbeek
Sent: woensdag 15 februari 2006 16:53
To: 'Kolab development coordination'
Subject: Re: [Kolab-devel] Kolab Date problem in resource handler
This does not seem to solve all problems. 
 
Can anyone tell me why the _parseDate function in iCalendar.php  should
return an array instead of epoch times?
 
The whole resmgr.php script counts on the fact that the returned values of
DTSTART and DTEND attributes are epochs nomatter if a date a time or both
are entered.
 
My first fix caused the date to be corect in the XML part of the calendar
event written in IMAP (-->now shows up in konsec).
 
But now the checking of the busy periods is still wrong in resmgr.php. It
compares an array of day/month/year to an epoch time.
I suppose converting the array to epoch will solve the problem. But why is
it needed to have this array?
 
Perhaps its better to always return epochs by the iCalendar :: getAttribute
function ?
 
kind regards,
Pieter
 
 
 
 
________________________________
From: kolab-devel-bounces at kolab.org [mailto:kolab-devel-bounces at kolab.org]
On Behalf Of kolab-devel-bounces at kolab.org
Sent: woensdag 15 februari 2006 15:42
To: 'Kolab development coordination'; 'Kolab issue tracker';
kolab-devel at intevation.org
Subject: Re: [Kolab-devel] Kolab Date problem in resource handler
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? 
--
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
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ATT00010.txt
URL: <http://lists.kolab.org/pipermail/devel/attachments/20060215/63f6a38e/attachment.txt>
    
    
More information about the devel
mailing list