Sunbird is now requesting VTODO and VEVENT correctly in REPORTs. This fixes

the handling of those cases.
This commit is contained in:
Andrew McMillan 2007-03-06 14:58:45 +13:00
parent 936bd1ad4d
commit c8bbcc1df6

View File

@ -95,12 +95,7 @@ foreach( $request->xml_tags AS $k => $v ) {
if ( $v['type'] == "close" ) {
break;
}
if ( $v['type'] == "complete" ) {
$filter_name = $xmltag;
}
else {
$filter_name = $v['attributes']['NAME'];
}
$filter_name = $v['attributes']['NAME'];
dbg_log_array( "REPORT", "COMP-FILTER", $v, true );
if ( isset($filters) ) {
dbg_error_log( "REPORT", "Adding filter '%s'", $filter_name );
@ -333,6 +328,18 @@ for ( $i=0; $i <= $reportnum; $i++ ) {
if ( isset( $report[$i]['end'] ) ) {
$where .= "AND dtstart <= ".qpg($report[$i]['end'])."::timestamp with time zone ";
}
if ( isset( $report[$i]['filters'] ) ) {
/**
* Only report on the filtered types that were specified
*/
$filters = "";
foreach( $report[$i]['filters'] AS $k => $v ) {
$filters .= ($filters == "" ? "" : ", ") . " '$k'";
}
if ( $filters != "" ) {
$where .= "AND caldav_data.caldav_type IN ( $filters ) ";
}
}
break;
case 'CALENDAR-MULTIGET':