Fix time-range parser for CalDAV

This commit is contained in:
Jörg Lehrke 2010-10-23 11:42:22 +00:00
parent aa2e9a18c4
commit da2669103c

View File

@ -11,6 +11,8 @@
* @version $Id$ * @version $Id$
*/ */
require_once EGW_SERVER_ROOT.'/phpgwapi/inc/horde/lib/core.php';
/** /**
* eGroupWare: GroupDAV access: calendar handler * eGroupWare: GroupDAV access: calendar handler
*/ */
@ -22,7 +24,14 @@ class calendar_groupdav extends groupdav_handler
* @var calendar_boupdate * @var calendar_boupdate
*/ */
var $bo; var $bo;
/**
* vCalendar Instance for parsing
*
* @var array
*/
var $vCalendar;
var $filter_prop2cal = array( var $filter_prop2cal = array(
'SUMMARY' => 'cal_title', 'SUMMARY' => 'cal_title',
'UID' => 'cal_uid', 'UID' => 'cal_uid',
@ -65,6 +74,7 @@ class calendar_groupdav extends groupdav_handler
parent::__construct($app,$debug,$base_uri,$principalURL); parent::__construct($app,$debug,$base_uri,$principalURL);
$this->bo = new calendar_boupdate(); $this->bo = new calendar_boupdate();
$this->vCalendar = new Horde_iCalendar;
} }
/** /**
@ -295,8 +305,14 @@ error_log(__METHOD__."($path,,".array2string($start).") filter=".array2string($f
break; break;
case 'time-range': case 'time-range':
if ($this->debug > 1) error_log(__FILE__ . __METHOD__."($options[path],...) time-range={$filter['attrs']['start']}-{$filter['attrs']['end']}"); if ($this->debug > 1) error_log(__FILE__ . __METHOD__."($options[path],...) time-range={$filter['attrs']['start']}-{$filter['attrs']['end']}");
$cal_filters['start'] = $filter['attrs']['start']; if (!empty($filter['attrs']['start']))
$cal_filters['end'] = $filter['attrs']['end']; {
$cal_filters['start'] = $this->vCalendar->_parseDateTime($filter['attrs']['start']);
}
if (!empty($filter['attrs']['end']))
{
$cal_filters['end'] = $this->vCalendar->_parseDateTime($filter['attrs']['end']);
}
break; break;
default: default:
if ($this->debug) error_log(__METHOD__."($options[path],".array2string($options).",...) unknown filter --> ignored"); if ($this->debug) error_log(__METHOD__."($options[path],".array2string($options).",...) unknown filter --> ignored");