mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-23 19:31:53 +02:00
"- storing and setting ROLE
- storing and setting resource quantity as X-EGROUPWARE-QUANTITY"
This commit is contained in:
parent
c29ab01e8d
commit
7742b606f8
@ -133,12 +133,11 @@ class calendar_ical extends calendar_boupdate
|
|||||||
var $vCalendar;
|
var $vCalendar;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Logging
|
* Set Logging
|
||||||
*
|
*
|
||||||
* @var
|
* @var boolean
|
||||||
* off = 0;
|
*/
|
||||||
*/
|
var $log = false;
|
||||||
var $log = 0;
|
|
||||||
var $logfile="/tmp/log-vcal";
|
var $logfile="/tmp/log-vcal";
|
||||||
|
|
||||||
|
|
||||||
@ -150,7 +149,7 @@ class calendar_ical extends calendar_boupdate
|
|||||||
function __construct(&$_clientProperties = array())
|
function __construct(&$_clientProperties = array())
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
if($this->log)$this->logfile = $GLOBALS['egw_info']['server']['temp_dir']."/log-vcal";
|
if($this->log) $this->logfile = $GLOBALS['egw_info']['server']['temp_dir']."/log-vcal";
|
||||||
$this->clientProperties = $_clientProperties;
|
$this->clientProperties = $_clientProperties;
|
||||||
$this->vCalendar = new Horde_iCalendar;
|
$this->vCalendar = new Horde_iCalendar;
|
||||||
}
|
}
|
||||||
@ -238,8 +237,8 @@ class calendar_ical extends calendar_boupdate
|
|||||||
$event['end'] = $event['end'] + $DSTCorrection;
|
$event['end'] = $event['end'] + $DSTCorrection;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if ($this->productManufacturer != 'file'
|
if ($this->productManufacturer != 'file' && $this->uidExtension)
|
||||||
&& $this->uidExtension) {
|
{
|
||||||
// Append UID to DESCRIPTION
|
// Append UID to DESCRIPTION
|
||||||
if (!preg_match('/\[UID:.+\]/m', $event['description'])) {
|
if (!preg_match('/\[UID:.+\]/m', $event['description'])) {
|
||||||
$event['description'] .= "\n[UID:" . $event['uid'] . "]";
|
$event['description'] .= "\n[UID:" . $event['uid'] . "]";
|
||||||
@ -271,8 +270,15 @@ class calendar_ical extends calendar_boupdate
|
|||||||
if ($uid == $event['owner']) continue; // Organizer
|
if ($uid == $event['owner']) continue; // Organizer
|
||||||
// RB: MAILTO href contains only the email-address, NO cn!
|
// RB: MAILTO href contains only the email-address, NO cn!
|
||||||
$attributes['ATTENDEE'][] = $info['email'] ? 'MAILTO:'.$info['email'] : '';
|
$attributes['ATTENDEE'][] = $info['email'] ? 'MAILTO:'.$info['email'] : '';
|
||||||
// ROLE={CHAIR|REQ-PARTICIPANT|OPT-PARTICIPANT|NON-PARTICIPANT} NOT used by eGW atm.
|
// ROLE={CHAIR|REQ-PARTICIPANT|OPT-PARTICIPANT|NON-PARTICIPANT|X-*}
|
||||||
$role = $uid == $event['owner'] ? 'CHAIR' : 'REQ-PARTICIPANT';
|
$role = 'REQ-PARTICIPANT';
|
||||||
|
$quantity = '';
|
||||||
|
if (strlen($status) > 1 && preg_match('/^.([0-9]*)(.*)$/',$status,$matches))
|
||||||
|
{
|
||||||
|
if ((int)$matches[1] > 1) $quantity = (int)$matches[1];
|
||||||
|
if ($matches[2]) $role = $matches[2];
|
||||||
|
$status = $status[0];
|
||||||
|
}
|
||||||
// RSVP={TRUE|FALSE} // resonse expected, not set in eGW => status=U
|
// RSVP={TRUE|FALSE} // resonse expected, not set in eGW => status=U
|
||||||
$rsvp = $status == 'U' ? 'TRUE' : 'FALSE';
|
$rsvp = $status == 'U' ? 'TRUE' : 'FALSE';
|
||||||
// PARTSTAT={NEEDS-ACTION|ACCEPTED|DECLINED|TENTATIVE|DELEGATED|COMPLETED|IN-PROGRESS} everything from delegated is NOT used by eGW atm.
|
// PARTSTAT={NEEDS-ACTION|ACCEPTED|DECLINED|TENTATIVE|DELEGATED|COMPLETED|IN-PROGRESS} everything from delegated is NOT used by eGW atm.
|
||||||
@ -301,13 +307,14 @@ class calendar_ical extends calendar_boupdate
|
|||||||
'PARTSTAT' => $status,
|
'PARTSTAT' => $status,
|
||||||
'CUTYPE' => $cutype,
|
'CUTYPE' => $cutype,
|
||||||
'RSVP' => $rsvp,
|
'RSVP' => $rsvp,
|
||||||
)+($info['type'] != 'e' ? array('X-EGROUPWARE-UID' => $uid) : array());
|
)+($info['type'] != 'e' ? array('X-EGROUPWARE-UID' => $uid) : array())+
|
||||||
|
($quantity ? array('X-EGROUPWARE-QUANTITY' => $quantity) : array());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'CLASS':
|
case 'CLASS':
|
||||||
$attributes['CLASS'] = $event['public'] ? 'PUBLIC' : 'CONFIDENTIAL';
|
$attributes['CLASS'] = $event['public'] ? 'PUBLIC' : 'CONFIDENTIAL';
|
||||||
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 ($event['owner'] != $this->user)
|
//if ($event['owner'] != $this->user)
|
||||||
@ -1847,8 +1854,8 @@ class calendar_ical extends calendar_boupdate
|
|||||||
$searcharray['n_fn'] = $cn;
|
$searcharray['n_fn'] = $cn;
|
||||||
}
|
}
|
||||||
if (($uid = $attributes['params']['X-EGROUPWARE-UID'])
|
if (($uid = $attributes['params']['X-EGROUPWARE-UID'])
|
||||||
&& ($info = $this->resource_info($uid))
|
&& ($info = $this->resource_info($uid))
|
||||||
&& (!$email || $info['email'] == $email))
|
&& (!$email || $info['email'] == $email))
|
||||||
{
|
{
|
||||||
// we use the (checked) X-EGROUPWARE-UID
|
// we use the (checked) X-EGROUPWARE-UID
|
||||||
}
|
}
|
||||||
@ -1896,6 +1903,9 @@ class calendar_ical extends calendar_boupdate
|
|||||||
{
|
{
|
||||||
$event['participants'][$uid] = ($uid == $event['owner'] ? 'A' : 'U');
|
$event['participants'][$uid] = ($uid == $event['owner'] ? 'A' : 'U');
|
||||||
}
|
}
|
||||||
|
// add quantiy and ROLE
|
||||||
|
if ((int)$attributes['params']['X-EGROUPWARE-QUANTITY'] > 1) $event['participants'][$uid] .= (int)$attributes['params']['X-EGROUPWARE-QUANTITY'];
|
||||||
|
if ($attributes['params']['ROLE']) $event['participants'][$uid] .= $attributes['params']['ROLE'];
|
||||||
break;
|
break;
|
||||||
case 'ORGANIZER':
|
case 'ORGANIZER':
|
||||||
if (is_numeric($uid))
|
if (is_numeric($uid))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user