<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Re: [Kolab-devel] Kolab Date problem in resource handler</TITLE>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2>This does not seem to solve all problems.
</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2>Can anyone tell me why the _parseDate function in
iCalendar.php should return an array instead of epoch
times?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2>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).</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2>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.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2>I suppose converting the array to epoch will solve the
problem. But why is it needed to have this array?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2>Perhaps its better to always return epochs by the iCalendar
:: getAttribute function ?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2>kind regards,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2>Pieter</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=199544015-15022006><FONT face=Arial
color=#0000ff size=2></FONT></SPAN> </DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> kolab-devel-bounces@kolab.org
[mailto:kolab-devel-bounces@kolab.org] <B>On Behalf Of
</B>kolab-devel-bounces@kolab.org<BR><B>Sent:</B> woensdag 15 februari 2006
15:42<BR><B>To:</B> 'Kolab development coordination'; 'Kolab issue tracker';
kolab-devel@intevation.org<BR><B>Subject:</B> Re: [Kolab-devel] Kolab Date
problem in resource handler<BR></FONT><BR></DIV>
<DIV></DIV><!-- Converted from text/plain format -->
<P><FONT size=2>This seems to fix the problem for me, however I'm not sure if
other software</FONT> <BR><FONT size=2>components use this routine which might
now be broken : </FONT></P>
<P><FONT size=2>resmgr.php</FONT> </P>
<P><FONT size=2>function iCalDate2Kolab($ical_date)</FONT> <BR><FONT
size=2>{</FONT> <BR><FONT size=2> myLog("Converting
".print_r($ical_date,true),RM_LOG_DEBUG);</FONT> <BR><FONT size=2>
</FONT><BR><FONT size=2> if (is_array($ical_date)) {</FONT>
<BR> <FONT size=2># going to create
date again</FONT> <BR> <FONT
size=2>$temp['zone'] = array_key_exists('zone',$ical_date) ?</FONT>
<BR><FONT size=2>$ical_date['zone'] : 'UTC';</FONT>
<BR> <FONT
size=2>$temp['hour'] = array_key_exists('hour',$ical_date) ?</FONT>
<BR><FONT size=2>$ical_date['hour'] : '00';</FONT>
<BR> <FONT
size=2>$temp['minute'] = array_key_exists('minute',$ical_date)
?</FONT> <BR><FONT size=2>$ical_date['minute'] : '00';</FONT>
<BR> <FONT
size=2>$temp['second'] = array_key_exists('second',$ical_date)
?</FONT> <BR><FONT size=2>$ical_date['second'] : '00';</FONT>
<BR> <FONT
size=2>$temp['year'] = array_key_exists('year',$ical_date) ?</FONT>
<BR><FONT size=2>$ical_date['year'] : '0000';</FONT>
<BR> <FONT
size=2>$temp['month'] = array_key_exists('month',$ical_date)
?</FONT> <BR><FONT size=2>$ical_date['month'] : '00';</FONT>
<BR> <FONT
size=2>$temp['mday'] = array_key_exists('mday',$ical_date) ?</FONT>
<BR><FONT size=2>$ical_date['mday'] : '00';</FONT>
<BR> <FONT size=2>$time =
sprintf('%02d:%02d:%02d',</FONT> <BR><FONT
size=2>
$temp['hour'], $temp['minute'], $temp['second']);</FONT> <BR><FONT
size=2> if ($temp['zone'] == 'UTC')
{</FONT> <BR><FONT
size=2> $time
.= 'Z';</FONT> <BR><FONT size=2>
}</FONT> <BR><FONT size=2> $date=
sprintf('%04d-%02d-%02d',$temp['year'], $temp['month'],</FONT> <BR><FONT
size=2>$temp['mday']). "T".$time;</FONT> <BR><FONT size=2>
} else {</FONT> <BR> <FONT
size=2> // $ical_date should be a timestamp</FONT> <BR><FONT
size=2> $date =
gmstrftime('%Y-%m-%dT%H:%M:%SZ', $ical_date);</FONT> <BR><FONT
size=2> }</FONT> <BR><FONT size=2> myLog("To
<$date>",RM_LOG_DEBUG);</FONT> <BR><FONT size=2>
return $date;</FONT> <BR><FONT size=2>}</FONT> </P><BR>
<P><FONT size=2>Kind regards,</FONT> <BR><FONT size=2>Pieter</FONT> </P><BR>
<P><FONT size=2></FONT> </P>
<P><FONT size=2>-----Original Message-----</FONT> <BR><FONT size=2>From:
kolab-devel-bounces@kolab.org [<A
href="mailto:kolab-devel-bounces@kolab.org">mailto:kolab-devel-bounces@kolab.org</A>]</FONT>
<BR><FONT size=2>On Behalf Of Pieter Vanmeerbeek</FONT> <BR><FONT size=2>Sent:
woensdag 15 februari 2006 15:24</FONT> <BR><FONT size=2>To: 'Kolab issue
tracker'; 'Kolab development coordination';</FONT> <BR><FONT
size=2>kolab-devel@intevation.org</FONT> <BR><FONT size=2>Subject: [Kolab-devel]
Kolab Date problem in resource handler</FONT> </P>
<P><FONT size=2> Hi,</FONT> </P>
<P><FONT size=2>I'm currenlty running kolab 2.0.1 , I know some bugfixes are
applied to</FONT> <BR><FONT size=2>2.0.3.</FONT> <BR><FONT size=2>However, I
think this problem is still there in version 2.0.3 as I cannot</FONT> <BR><FONT
size=2>find any differnce in the CVS tree (file of 5/2).</FONT> </P>
<P><FONT size=2>The problem is that automatic accepted calendar items of a
resource are</FONT> <BR><FONT size=2>generated with a start and date in 1970 :
</FONT></P>
<P><FONT size=2>
<start-date>2006-01-01T00:00:01Z</start-date></FONT> <BR><FONT
size=2> <end-date>2006-01-01T00:00:01Z</end-date></FONT>
</P><BR>
<P><FONT size=2>This is due to format problem in the time indications -->
array of</FONT> <BR><FONT size=2>day/month/year instead of one
timestring.</FONT> <BR><FONT size=2>Tracing this in the code, leads me to the
resmgr.php script, routine</FONT> <BR><FONT size=2>iCalDate2Kolab : </FONT></P>
<P><FONT size=2>function iCalDate2Kolab($ical_date)</FONT> <BR><FONT
size=2>{</FONT> <BR><FONT size=2> // $ical_date should be a
timestamp</FONT> <BR><FONT size=2> return
gmstrftime('%Y-%m-%dT%H:%M:%SZ', $ical_date); }</FONT> </P><BR>
<P><FONT size=2>As indicated in the coment ,it expects a timestamp and not an
array --></FONT> <BR><FONT size=2>gives 1/1/1970 --> all-day calendar
items of reousrce are not visible in</FONT> <BR><FONT size=2>Konsec konnector
and do not show up in freebusy file.</FONT> </P>
<P><FONT size=2>Is there a fix for this available?</FONT> </P><BR><BR>
<P><FONT size=2>Kind regards,</FONT> <BR><FONT size=2>Pieter</FONT> </P>
<P><FONT size=2>--</FONT> <BR><FONT size=2>Able - aXs GUARD on Infosecurity
Brussels 22 & 23 march 2006</FONT> <BR><FONT size=2>(<A
href="http://www.infosecurity.be">http://www.infosecurity.be</A>)</FONT>
<BR><FONT size=2>---------------------------------------------------</FONT>
<BR><FONT size=2>aXs GUARD Training Center</FONT> <BR><FONT size=2>more info at
<A
href="http://www.axsguard.com/indextraining.htm">http://www.axsguard.com/indextraining.htm</A></FONT>
</P>
<P><FONT size=2>aXs GUARD has completed security and anti-virus checks on this
e-mail</FONT> <BR><FONT size=2>(<A
href="http://www.axsguard.com">http://www.axsguard.com</A>)</FONT> <BR><FONT
size=2>---------------------------------------------------</FONT> <BR><FONT
size=2>Able NV: ond.nr 0457.938.087</FONT> </P>
<P><FONT size=2>_______________________________________________</FONT> <BR><FONT
size=2>Kolab-devel mailing list</FONT> <BR><FONT
size=2>Kolab-devel@kolab.org</FONT> <BR><FONT size=2><A
href="https://kolab.org/mailman/listinfo/kolab-devel">https://kolab.org/mailman/listinfo/kolab-devel</A></FONT>
</P><BR>
<P><FONT size=2>--</FONT> <BR><FONT size=2>Able - aXs GUARD on Infosecurity
Brussels 22 & 23 march 2006 (<A
href="http://www.infosecurity.be">http://www.infosecurity.be</A>)</FONT>
<BR><FONT size=2>---------------------------------------------------</FONT>
<BR><FONT size=2>aXs GUARD Training Center </FONT><BR><FONT size=2>more info at
<A
href="http://www.axsguard.com/indextraining.htm">http://www.axsguard.com/indextraining.htm</A></FONT>
</P>
<P><FONT size=2>aXs GUARD has completed security and anti-virus checks on this
e-mail (<A href="http://www.axsguard.com">http://www.axsguard.com</A>)</FONT>
<BR><FONT size=2>---------------------------------------------------</FONT>
<BR><FONT size=2>Able NV: ond.nr 0457.938.087</FONT> </P>
<P><FONT size=2>_______________________________________________</FONT> <BR><FONT
size=2>Kolab-devel mailing list</FONT> <BR><FONT
size=2>Kolab-devel@kolab.org</FONT> <BR><FONT size=2><A
href="https://kolab.org/mailman/listinfo/kolab-devel">https://kolab.org/mailman/listinfo/kolab-devel</A></FONT>
</P><BR>
<HR><BR><p><font face="Arial" size="2">
<a target="_blank" href="http://www.infosecurity.be">Able - aXs GUARD on Infosecurity Brussels 22 & 23
march 2006</a><br>
---------------------------------------------------<br>
aXs GUARD Training Center <br>
more info at <a target="_blank" href="http://www.axsguard.com/indextraining.htm">http://www.axsguard.com/indextraining.htm</a><br>
<br>
aXs GUARD has completed security and anti-virus checks on this e-mail<br>
(http://www.axsguard.com)<br>
---------------------------------------------------<br>
Able NV: ond.nr 0457.938.087</font></p>
<BR>
</BODY></HTML>