mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
fix PHP Fatal error when creating/updating entries
This commit is contained in:
parent
211d3a5438
commit
ca1bf71361
@ -12,6 +12,8 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use EGroupware\Api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iCal import and export via Horde iCalendar classes
|
* iCal import and export via Horde iCalendar classes
|
||||||
*
|
*
|
||||||
@ -474,7 +476,7 @@ class calendar_ical extends calendar_boupdate
|
|||||||
{
|
{
|
||||||
case 'g':
|
case 'g':
|
||||||
$cutype = 'GROUP';
|
$cutype = 'GROUP';
|
||||||
$participantURL = 'urn:uuid:'.common::generate_uid('accounts', $uid);
|
$participantURL = 'urn:uuid:'.Api\CalDAV::generate_uid('accounts', $uid);
|
||||||
if (!isset($event['participants'][$this->user]) &&
|
if (!isset($event['participants'][$this->user]) &&
|
||||||
($members = $GLOBALS['egw']->accounts->members($uid, true)) && in_array($this->user, $members))
|
($members = $GLOBALS['egw']->accounts->members($uid, true)) && in_array($this->user, $members))
|
||||||
{
|
{
|
||||||
@ -492,8 +494,8 @@ class calendar_ical extends calendar_boupdate
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
$participantURL = 'urn:uuid:'.common::generate_uid('resources', substr($uid, 1));
|
$participantURL = 'urn:uuid:'.Api\CalDAV::generate_uid('resources', substr($uid, 1));
|
||||||
$cutype = groupdav_principals::resource_is_location(substr($uid, 1)) ? 'ROOM' : 'RESOURCE';
|
$cutype = Api\CalDAV\Principals::resource_is_location(substr($uid, 1)) ? 'ROOM' : 'RESOURCE';
|
||||||
// unset resource email (email of responsible user) as iCal at least has problems,
|
// unset resource email (email of responsible user) as iCal at least has problems,
|
||||||
// if resonpsible is also pariticipant or organizer
|
// if resonpsible is also pariticipant or organizer
|
||||||
unset($info['email']);
|
unset($info['email']);
|
||||||
@ -510,7 +512,7 @@ class calendar_ical extends calendar_boupdate
|
|||||||
// generate urn:uuid, if we have no other participant URL
|
// generate urn:uuid, if we have no other participant URL
|
||||||
if (empty($participantURL) && $info && $info['app'])
|
if (empty($participantURL) && $info && $info['app'])
|
||||||
{
|
{
|
||||||
$participantURL = 'urn:uuid:'.common::generate_uid($info['app'], substr($uid, 1));
|
$participantURL = 'urn:uuid:'.Api\CalDAV::generate_uid($info['app'], substr($uid, 1));
|
||||||
}
|
}
|
||||||
// ROLE={CHAIR|REQ-PARTICIPANT|OPT-PARTICIPANT|NON-PARTICIPANT|X-*}
|
// ROLE={CHAIR|REQ-PARTICIPANT|OPT-PARTICIPANT|NON-PARTICIPANT|X-*}
|
||||||
$options = array();
|
$options = array();
|
||||||
@ -783,7 +785,7 @@ class calendar_ical extends calendar_boupdate
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'ATTACH':
|
case 'ATTACH':
|
||||||
groupdav::add_attach('calendar', $event['id'], $attributes, $parameters);
|
Api\CalDAV::add_attach('calendar', $event['id'], $attributes, $parameters);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -1149,7 +1151,7 @@ class calendar_ical extends calendar_boupdate
|
|||||||
if ($this->productManufacturer == 'groupdav' && $cal_id > 0 &&
|
if ($this->productManufacturer == 'groupdav' && $cal_id > 0 &&
|
||||||
$events[0]['recur_type'] != MCAL_RECUR_NONE)
|
$events[0]['recur_type'] != MCAL_RECUR_NONE)
|
||||||
{
|
{
|
||||||
calendar_groupdav::fix_series($events);
|
calendar_Api\CalDAV::fix_series($events);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->tzid)
|
if ($this->tzid)
|
||||||
@ -1207,7 +1209,7 @@ class calendar_ical extends calendar_boupdate
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!($exception = $this->read($id))) continue;
|
if (!($exception = $this->read($id))) continue;
|
||||||
$exception['uid'] = common::generate_uid('calendar', $id);
|
$exception['uid'] = Api\CalDAV::generate_uid('calendar', $id);
|
||||||
$exception['reference'] = $exception['recurrence'] = 0;
|
$exception['reference'] = $exception['recurrence'] = 0;
|
||||||
$this->update($exception, true,true,false,true,$msg,$skip_notification);
|
$this->update($exception, true,true,false,true,$msg,$skip_notification);
|
||||||
}
|
}
|
||||||
@ -1749,7 +1751,7 @@ class calendar_ical extends calendar_boupdate
|
|||||||
}
|
}
|
||||||
|
|
||||||
// handle ATTACH attribute for managed attachments
|
// handle ATTACH attribute for managed attachments
|
||||||
if ($updated_id && groupdav::handle_attach('calendar', $updated_id, $event['attach'], $event['attach-delete-by-put']) === false)
|
if ($updated_id && Api\CalDAV::handle_attach('calendar', $updated_id, $event['attach'], $event['attach-delete-by-put']) === false)
|
||||||
{
|
{
|
||||||
$return_id = null;
|
$return_id = null;
|
||||||
}
|
}
|
||||||
@ -2373,7 +2375,7 @@ class calendar_ical extends calendar_boupdate
|
|||||||
* @param array $component VEVENT
|
* @param array $component VEVENT
|
||||||
* @param string $version vCal version (1.0/2.0)
|
* @param string $version vCal version (1.0/2.0)
|
||||||
* @param array $supportedFields supported fields of the device
|
* @param array $supportedFields supported fields of the device
|
||||||
* @param string $principalURL ='' Used for CalDAV imports, no longer used in favor of groupdav_principals::url2uid()
|
* @param string $principalURL ='' Used for CalDAV imports, no longer used in favor of Api\CalDAV\Principals::url2uid()
|
||||||
* @param string $check_component ='Horde_Icalendar_Vevent'
|
* @param string $check_component ='Horde_Icalendar_Vevent'
|
||||||
* @param Horde_Icalendar $container =null container to access attributes on container
|
* @param Horde_Icalendar $container =null container to access attributes on container
|
||||||
* @return array|boolean event on success, false on failure
|
* @return array|boolean event on success, false on failure
|
||||||
@ -2839,7 +2841,7 @@ class calendar_ical extends calendar_boupdate
|
|||||||
$uid = $this->user;
|
$uid = $this->user;
|
||||||
}
|
}
|
||||||
// check principal url from CalDAV here after X-EGROUPWARE-UID and to get optional X-EGROUPWARE-QUANTITY
|
// check principal url from CalDAV here after X-EGROUPWARE-UID and to get optional X-EGROUPWARE-QUANTITY
|
||||||
if (!$uid) $uid = groupdav_principals::url2uid($attributes['value'], null, $cn);
|
if (!$uid) $uid = Api\CalDAV\Principals::url2uid($attributes['value'], null, $cn);
|
||||||
|
|
||||||
// try to find an email address
|
// try to find an email address
|
||||||
if (!$uid && $email && ($uid = $GLOBALS['egw']->accounts->name2id($email, 'account_email')))
|
if (!$uid && $email && ($uid = $GLOBALS['egw']->accounts->name2id($email, 'account_email')))
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
* @version $Id$
|
* @version $Id$
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use EGroupware\Api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* InfoLog: Create and parse iCal's
|
* InfoLog: Create and parse iCal's
|
||||||
*/
|
*/
|
||||||
@ -356,7 +358,7 @@ class infolog_ical extends infolog_bo
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$url = 'urn:uuid:'.common::generate_uid('accounts', $taskData['info_owner']);
|
$url = 'urn:uuid:'.Api\CalDAV::generate_uid('accounts', $taskData['info_owner']);
|
||||||
}
|
}
|
||||||
$vevent->setAttribute('ORGANIZER',$url,array(
|
$vevent->setAttribute('ORGANIZER',$url,array(
|
||||||
'CN' => $GLOBALS['egw']->accounts->id2name($taskData['info_owner'],'account_fullname'),
|
'CN' => $GLOBALS['egw']->accounts->id2name($taskData['info_owner'],'account_fullname'),
|
||||||
@ -370,7 +372,7 @@ class infolog_ical extends infolog_bo
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$url = 'urn:uuid:'.common::generate_uid('accounts', $responsible);
|
$url = 'urn:uuid:'.Api\CalDAV::generate_uid('accounts', $responsible);
|
||||||
}
|
}
|
||||||
if ($responsible > 0)
|
if ($responsible > 0)
|
||||||
{
|
{
|
||||||
@ -843,14 +845,14 @@ class infolog_ical extends infolog_bo
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'ATTENDEE':
|
case 'ATTENDEE':
|
||||||
if (($uid = groupdav_principals::url2uid($attribute['value'])) && is_numeric($uid))
|
if (($uid = Api\CalDAV\Principals::url2uid($attribute['value'])) && is_numeric($uid))
|
||||||
{
|
{
|
||||||
$taskData['info_responsible'][] = $uid;
|
$taskData['info_responsible'][] = $uid;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'ORGANIZER':
|
case 'ORGANIZER':
|
||||||
if (($uid = groupdav_principals::url2uid($attribute['value'])) && is_numeric($uid))
|
if (($uid = Api\CalDAV\Principals::url2uid($attribute['value'])) && is_numeric($uid))
|
||||||
{
|
{
|
||||||
$taskData['info_owner'] = $uid;
|
$taskData['info_owner'] = $uid;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user