read debugdir from egw config

This commit is contained in:
Lars Kneschke 2005-12-25 16:41:35 +00:00
parent afaa6f2815
commit 6f05e93e26
4 changed files with 95 additions and 70 deletions

View File

@ -160,9 +160,11 @@
); );
} }
break; break;
case 'CLASS': case 'CLASS':
$attributes['CLASS'] = $event['public'] ? 'PUBLIC' : 'PRIVATE'; $attributes['CLASS'] = $event['public'] ? 'PUBLIC' : 'PRIVATE';
break; break;
case 'ORGANIZER': // according to iCalendar standard, ORGANIZER not used for events in the own calendar case 'ORGANIZER': // according to iCalendar standard, ORGANIZER not used for events in the own calendar
if (!isset($event['participants'][$event['owner']]) || count($event['participants']) > 1) if (!isset($event['participants'][$event['owner']]) || count($event['participants']) > 1)
{ {
@ -172,10 +174,12 @@
$GLOBALS['egw']->accounts->id2name($event['owner'],'account_lastname')); $GLOBALS['egw']->accounts->id2name($event['owner'],'account_lastname'));
} }
break; break;
case 'DTEND': case 'DTEND':
if(date('H:i:s',$event['end']) == '23:59:59') $event['end']++; if(date('H:i:s',$event['end']) == '23:59:59') $event['end']++;
$attributes[$icalFieldName] = $event['end']; $attributes[$icalFieldName] = $event['end'];
break; break;
case 'RRULE': case 'RRULE':
if ($event['recur_type'] == MCAL_RECUR_NONE) break; // no recuring event if ($event['recur_type'] == MCAL_RECUR_NONE) break; // no recuring event
$rrule = array('FREQ' => $this->recur_egw2ical[$event['recur_type']]); $rrule = array('FREQ' => $this->recur_egw2ical[$event['recur_type']]);
@ -189,9 +193,11 @@
} }
$rrule['BYDAY'] = implode(',',$days); $rrule['BYDAY'] = implode(',',$days);
break; break;
case MCAL_RECUR_MONTHLY_MDAY: // date of the month: BYMONTDAY={1..31} case MCAL_RECUR_MONTHLY_MDAY: // date of the month: BYMONTDAY={1..31}
$rrule['BYMONTHDAY'] = (int) date('d',$event['start']); $rrule['BYMONTHDAY'] = (int) date('d',$event['start']);
break; break;
case MCAL_RECUR_MONTHLY_WDAY: // weekday of the month: BDAY={1..5}{MO..SO} case MCAL_RECUR_MONTHLY_WDAY: // weekday of the month: BDAY={1..5}{MO..SO}
$rrule['BYDAY'] = (1 + (int) ((date('d',$event['start'])-1) / 7)). $rrule['BYDAY'] = (1 + (int) ((date('d',$event['start'])-1) / 7)).
strtoupper(substr(date('l',$event['start']),0,2)); strtoupper(substr(date('l',$event['start']),0,2));
@ -208,6 +214,7 @@
} }
$attributes['RRULE'] = implode(';',$attributes['RRULE']); $attributes['RRULE'] = implode(';',$attributes['RRULE']);
break; break;
case 'EXDATE': case 'EXDATE':
if ($event['recur_exception']) if ($event['recur_exception'])
{ {
@ -220,12 +227,15 @@
$parameters['EXDATE']['VALUE'] = 'DATE'; $parameters['EXDATE']['VALUE'] = 'DATE';
} }
break; break;
case 'PRIORITY': case 'PRIORITY':
$attributes['PRIORITY'] = (int) $this->priority_egw2ical[$event['priority']]; $attributes['PRIORITY'] = (int) $this->priority_egw2ical[$event['priority']];
break; break;
case 'TRANSP': case 'TRANSP':
$attributes['TRANSP'] = $event['non_blocking'] ? 'TRANSPARENT' : 'OPAQUE'; $attributes['TRANSP'] = $event['non_blocking'] ? 'TRANSPARENT' : 'OPAQUE';
break; break;
case 'CATEGORIES': case 'CATEGORIES':
if ($event['category']) if ($event['category'])
{ {
@ -280,6 +290,7 @@
function importVCal($_vcalData, $cal_id=-1) function importVCal($_vcalData, $cal_id=-1)
{ {
error_log('CALENDAR('.__LINE__.") $cal_id");
// our (patched) horde classes, do NOT unfold folded lines, which causes a lot trouble in the import // our (patched) horde classes, do NOT unfold folded lines, which causes a lot trouble in the import
$_vcalData = preg_replace("/[\r\n]+ /",'',$_vcalData); $_vcalData = preg_replace("/[\r\n]+ /",'',$_vcalData);
@ -541,7 +552,9 @@
switch(strtolower($_productName)) switch(strtolower($_productName))
{ {
default: default:
$this->supportedFields = $defaultFields + array('participants' => 'participants'); # participants disabled until working correctly
#$this->supportedFields = $defaultFields + array('participants' => 'participants');
$this->supportedFields = $defaultFields;
break; break;
} }
break; break;

View File

@ -69,6 +69,10 @@ class Horde_RPC_syncml extends Horde_RPC {
// that's not part of the valid response. // that's not part of the valid response.
ob_start(); ob_start();
if(isset($GLOBALS['config_syncml']['syncml_debug_dir']))
{
$this->_debugDir = $GLOBALS['config_syncml']['syncml_debug_dir'];
}
// Very useful for debugging. Logs XML packets to // Very useful for debugging. Logs XML packets to
// $this->_debugDir. // $this->_debugDir.
if (!empty($this->_debugDir) && is_dir($this->_debugDir)) { if (!empty($this->_debugDir) && is_dir($this->_debugDir)) {

View File

@ -37,6 +37,10 @@ class Horde_RPC_syncml_wbxml extends Horde_RPC_syncml {
// that's not part of the valid response. // that's not part of the valid response.
ob_start(); ob_start();
if(isset($GLOBALS['config_syncml']['syncml_debug_dir']))
{
$this->_debugDir = $GLOBALS['config_syncml']['syncml_debug_dir'];
}
// Very useful for debugging. Logs WBXML packets to // Very useful for debugging. Logs WBXML packets to
// $this->_debugDir. // $this->_debugDir.
if (!empty($this->_debugDir) && is_dir($this->_debugDir)) { if (!empty($this->_debugDir) && is_dir($this->_debugDir)) {

View File

@ -26,10 +26,14 @@ include('./header.inc.php');
// SyncML works currently only with PHP sessions // SyncML works currently only with PHP sessions
if($GLOBALS['egw_info']['server']['sessions_type'] == 'db') if($GLOBALS['egw_info']['server']['sessions_type'] == 'db')
{ {
error_log('SyncML support is not available with DB sessions. Please switch to PHP4 sessions in header.inc.php.'); error_log('SyncML support is currently not available with DB sessions. Please switch to PHP4 sessions in header.inc.php.');
exit; exit;
} }
$config =& CreateObject('phpgwapi.config','syncml');
$config->read_repository();
$GLOBALS['config_syncml'] =& $config->config_data;
unset($config);
/* Look at the Content-type of the request, if it is available, to try /* Look at the Content-type of the request, if it is available, to try
* and determine what kind of request this is. */ * and determine what kind of request this is. */