backport to 1.6: implemented different priority values for funambol/outlook clients since outlook does not support the RFC defined PRIORITY values, fixed some typos

This commit is contained in:
Christian Binder 2010-01-02 13:19:32 +00:00
parent 84a1412c53
commit d899be3124

View File

@ -57,7 +57,7 @@ class calendar_ical extends calendar_boupdate
); );
/** /**
* @var array $status_ical2egw conversion of the priority egw => ical * @var array $priority_egw2ical conversion of the priority egw => ical
*/ */
var $priority_egw2ical = array( var $priority_egw2ical = array(
0 => 0, // undefined 0 => 0, // undefined
@ -67,7 +67,7 @@ class calendar_ical extends calendar_boupdate
); );
/** /**
* @var array $status_ical2egw conversion of the priority ical => egw * @var array $priority_ical2egw conversion of the priority ical => egw
*/ */
var $priority_ical2egw = array( var $priority_ical2egw = array(
0 => 0, // undefined 0 => 0, // undefined
@ -76,6 +76,25 @@ class calendar_ical extends calendar_boupdate
4 => 3, 3 => 3, 2 => 3, 1 => 3, // high 4 => 3, 3 => 3, 2 => 3, 1 => 3, // high
); );
/**
* @var array $priority_egw2funambol conversion of the priority egw => funambol
*/
var $priority_egw2funambol = array(
0 => 1, // undefined (mapped to normal since undefined does not exist)
1 => 0, // low
2 => 1, // normal
3 => 2, // high
);
/**
* @var array $priority_funambol2egw conversion of the priority funambol => egw
*/
var $priority_funambol2egw = array(
0 => 1, // low
1 => 2, // normal
2 => 3, // high
);
/** /**
* @var array $recur_egw2ical_2_0 converstaion of egw recur-type => ical FREQ * @var array $recur_egw2ical_2_0 converstaion of egw recur-type => ical FREQ
*/ */
@ -536,7 +555,14 @@ class calendar_ical extends calendar_boupdate
break; break;
case 'PRIORITY': case 'PRIORITY':
if($this->productManufacturer == 'funambol')
{
$attributes['PRIORITY'] = (int) $this->priority_egw2funambol[$event['priority']];
}
else
{
$attributes['PRIORITY'] = (int) $this->priority_egw2ical[$event['priority']]; $attributes['PRIORITY'] = (int) $this->priority_egw2ical[$event['priority']];
}
break; break;
case 'TRANSP': case 'TRANSP':
@ -1860,7 +1886,14 @@ class calendar_ical extends calendar_boupdate
} }
break; break;
case 'PRIORITY': case 'PRIORITY':
if($this->productManufacturer == 'funambol')
{
$vcardData['priority'] = (int) $this->priority_funambol2egw[$attributes['value']];
}
else
{
$vcardData['priority'] = (int) $this->priority_ical2egw[$attributes['value']]; $vcardData['priority'] = (int) $this->priority_ical2egw[$attributes['value']];
}
break; break;
case 'CATEGORIES': case 'CATEGORIES':
if ($attributes['value']) if ($attributes['value'])