修改文件注释
This commit is contained in:
parent
566954dfcf
commit
3b992432f7
|
@ -392,15 +392,15 @@ class CalDAV extends \Sabre\CalDAV\Backend\AbstractBackend
|
||||||
{
|
{
|
||||||
$extraData = $this->getDenormalizedData($calendarData);
|
$extraData = $this->getDenormalizedData($calendarData);
|
||||||
$data = array(
|
$data = array(
|
||||||
'calendarid' => $calendarId,
|
'calendarid' => $calendarId,
|
||||||
'uri' => $objectUri,
|
'calendardata' => $calendarData,
|
||||||
'calendardata' => $calendarData,
|
'uri' => $objectUri,
|
||||||
'lastmodified' => time(),
|
'etag' => $extraData['etag'],
|
||||||
'etag' => $extraData['etag'],
|
'size' => $extraData['size'],
|
||||||
'size' => $extraData['size'],
|
'componenttype' => $extraData['componentType'],
|
||||||
'componenttype' => $extraData['componentType'],
|
|
||||||
'firstoccurence' => $extraData['firstOccurence'],
|
'firstoccurence' => $extraData['firstOccurence'],
|
||||||
'lastoccurence' => $extraData['lastOccurence'],
|
'lastoccurence' => $extraData['lastOccurence'],
|
||||||
|
'lastmodified' => time(),
|
||||||
);
|
);
|
||||||
CalendarObject::insert($data);
|
CalendarObject::insert($data);
|
||||||
CalendarService::touchCalendar($calendarId);
|
CalendarService::touchCalendar($calendarId);
|
||||||
|
@ -427,13 +427,13 @@ class CalDAV extends \Sabre\CalDAV\Backend\AbstractBackend
|
||||||
{
|
{
|
||||||
$extraData = $this->getDenormalizedData($calendarData);
|
$extraData = $this->getDenormalizedData($calendarData);
|
||||||
$update = array(
|
$update = array(
|
||||||
'calendardata' => $calendarData,
|
'calendardata' => $calendarData,
|
||||||
'lastmodified' => time(),
|
'etag' => $extraData['etag'],
|
||||||
'etag' => $extraData['etag'],
|
'size' => $extraData['size'],
|
||||||
'size' => $extraData['size'],
|
'componenttype' => $extraData['componentType'],
|
||||||
'componenttype' => $extraData['componentType'],
|
|
||||||
'firstoccurence' => $extraData['firstOccurence'],
|
'firstoccurence' => $extraData['firstOccurence'],
|
||||||
'lastoccurence' => $extraData['lastOccurence'],
|
'lastoccurence' => $extraData['lastOccurence'],
|
||||||
|
'lastmodified' => time(),
|
||||||
);
|
);
|
||||||
CalendarObject::where('calendarid', $calendarId)->where('uri', $objectUri)->update($update);
|
CalendarObject::where('calendarid', $calendarId)->where('uri', $objectUri)->update($update);
|
||||||
CalendarService::touchCalendar($calendarId);
|
CalendarService::touchCalendar($calendarId);
|
||||||
|
|
|
@ -1,14 +1,5 @@
|
||||||
<?php namespace Gdoo\Calendar\Services;
|
<?php namespace Gdoo\Calendar\Services;
|
||||||
|
|
||||||
/**
|
|
||||||
* Copyright (c) 2011 Jakob Sack <mail@jakobsack.de>
|
|
||||||
* Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl>
|
|
||||||
* Copyright (c) 2012 Georg Ehrke <ownclouddev at georgswebsite dot de>
|
|
||||||
* This file is licensed under the Affero General Public License version 3 or
|
|
||||||
* later.
|
|
||||||
* See the COPYING-README file.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class manages our calendar objects
|
* This class manages our calendar objects
|
||||||
*/
|
*/
|
||||||
|
@ -183,9 +174,9 @@ class CalendarService
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Returns all objects of a calendar between $start and $end
|
* @brief Returns all objects of a calendar between $start and $end
|
||||||
* @param integer $id
|
* @param array $id
|
||||||
* @param DateTime $start
|
* @param int $start
|
||||||
* @param DateTime $end
|
* @param int $end
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
* The objects are associative arrays. You'll find the original vObject
|
* The objects are associative arrays. You'll find the original vObject
|
||||||
|
@ -194,7 +185,7 @@ class CalendarService
|
||||||
public static function getRangeEvents($id, $start, $end, $shared = false)
|
public static function getRangeEvents($id, $start, $end, $shared = false)
|
||||||
{
|
{
|
||||||
$start = strtotime($start);
|
$start = strtotime($start);
|
||||||
$end = strtotime($end);
|
$end = strtotime($end);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
$model = CalendarObject::where(function ($q) use ($start, $end) {
|
$model = CalendarObject::where(function ($q) use ($start, $end) {
|
||||||
|
@ -240,13 +231,13 @@ class CalendarService
|
||||||
$allday = ($vcalendar->VEVENT->DTSTART->getDateType() == \Sabre\VObject\Property\DateTime::DATE) ? true : false;
|
$allday = ($vcalendar->VEVENT->DTSTART->getDateType() == \Sabre\VObject\Property\DateTime::DATE) ? true : false;
|
||||||
|
|
||||||
$output = array(
|
$output = array(
|
||||||
'id' => (int)$row->id,
|
'id' => (int)$row->id,
|
||||||
'calendarid' => (int)$row->calendarid,
|
'calendarid' => (int)$row->calendarid,
|
||||||
'title' => (isset($vevent->SUMMARY) && $vevent->SUMMARY->value) ? strtr($vevent->SUMMARY->value, array('\,' => ',', '\;' => ';')) : 'unnamed',
|
'title' => (isset($vevent->SUMMARY) && $vevent->SUMMARY->value) ? strtr($vevent->SUMMARY->value, array('\,' => ',', '\;' => ';')) : 'unnamed',
|
||||||
'description' => (isset($vevent->DESCRIPTION) && $vevent->DESCRIPTION->value) ? strtr($vevent->DESCRIPTION->value, array('\,' => ',', '\;' => ';')) : '',
|
'description' => (isset($vevent->DESCRIPTION) && $vevent->DESCRIPTION->value) ? strtr($vevent->DESCRIPTION->value, array('\,' => ',', '\;' => ';')) : '',
|
||||||
'location' => (isset($vevent->LOCATION) && $vevent->LOCATION->value) ? strtr($vevent->LOCATION->value, array('\,' => ',', '\;' => ';')) : '',
|
'location' => (isset($vevent->LOCATION) && $vevent->LOCATION->value) ? strtr($vevent->LOCATION->value, array('\,' => ',', '\;' => ';')) : '',
|
||||||
'lastmodified' => $row->lastmodified,
|
'lastmodified' => $row->lastmodified,
|
||||||
'allDay' => $allday,
|
'allDay' => $allday,
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($vcalendar->VEVENT->RRULE) {
|
if ($vcalendar->VEVENT->RRULE) {
|
||||||
|
@ -296,19 +287,19 @@ class CalendarService
|
||||||
|
|
||||||
$extraData = self::getDenormalizedData($calendardata);
|
$extraData = self::getDenormalizedData($calendardata);
|
||||||
$uri = self::createURI().'.ics';
|
$uri = self::createURI().'.ics';
|
||||||
$data = array(
|
$data = [
|
||||||
'calendarid' => $id,
|
'calendarid' => $id,
|
||||||
'uri' => $uri,
|
'calendardata' => $calendardata,
|
||||||
'calendardata' => $calendardata,
|
'attachment' => $attachment,
|
||||||
'lastmodified' => time(),
|
'rrule' => $extraData['rrule'],
|
||||||
'attachment' => $attachment,
|
'etag' => $extraData['etag'],
|
||||||
'rrule' => $extraData['rrule'],
|
'size' => $extraData['size'],
|
||||||
'etag' => $extraData['etag'],
|
'uri' => $uri,
|
||||||
'size' => $extraData['size'],
|
'componenttype' => $extraData['componentType'],
|
||||||
'componenttype' => $extraData['componentType'],
|
|
||||||
'firstoccurence' => $extraData['firstOccurence'],
|
'firstoccurence' => $extraData['firstOccurence'],
|
||||||
'lastoccurence' => $extraData['lastOccurence'],
|
'lastoccurence' => $extraData['lastOccurence'],
|
||||||
);
|
'lastmodified' => time(),
|
||||||
|
];
|
||||||
$objectId = CalendarObject::insertGetId($data);
|
$objectId = CalendarObject::insertGetId($data);
|
||||||
self::touchCalendar($id);
|
self::touchCalendar($id);
|
||||||
return $objectId;
|
return $objectId;
|
||||||
|
@ -334,17 +325,17 @@ class CalendarService
|
||||||
}
|
}
|
||||||
|
|
||||||
$extraData = self::getDenormalizedData($calendardata);
|
$extraData = self::getDenormalizedData($calendardata);
|
||||||
$data = array(
|
$data = [
|
||||||
'calendardata' => $calendardata,
|
'calendardata' => $calendardata,
|
||||||
'lastmodified' => time(),
|
'attachment' => $attachment,
|
||||||
'attachment' => $attachment,
|
'rrule' => $extraData['rrule'],
|
||||||
'rrule' => $extraData['rrule'],
|
'etag' => $extraData['etag'],
|
||||||
'etag' => $extraData['etag'],
|
'size' => $extraData['size'],
|
||||||
'size' => $extraData['size'],
|
'componenttype' => $extraData['componentType'],
|
||||||
'componenttype' => $extraData['componentType'],
|
|
||||||
'firstoccurence' => $extraData['firstOccurence'],
|
'firstoccurence' => $extraData['firstOccurence'],
|
||||||
'lastoccurence' => $extraData['lastOccurence'],
|
'lastoccurence' => $extraData['lastOccurence'],
|
||||||
);
|
'lastmodified' => time(),
|
||||||
|
];
|
||||||
CalendarObject::where('id', $id)->update($data);
|
CalendarObject::where('id', $id)->update($data);
|
||||||
self::touchCalendar($event['calendarid']);
|
self::touchCalendar($event['calendarid']);
|
||||||
return true;
|
return true;
|
||||||
|
@ -449,14 +440,14 @@ class CalendarService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return [
|
||||||
'etag' => md5($calendarData),
|
'etag' => md5($calendarData),
|
||||||
'size' => strlen($calendarData),
|
'size' => strlen($calendarData),
|
||||||
'rrule' => $rrule,
|
'rrule' => $rrule,
|
||||||
'componentType' => $componentType,
|
'componentType' => $componentType,
|
||||||
'firstOccurence' => $firstOccurence,
|
'firstOccurence' => $firstOccurence,
|
||||||
'lastOccurence' => $lastOccurence,
|
'lastOccurence' => $lastOccurence,
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1112,7 +1103,6 @@ class CalendarService
|
||||||
|
|
||||||
if ($allday) {
|
if ($allday) {
|
||||||
$return['start'] = $start_dt->format('Y-m-d');
|
$return['start'] = $start_dt->format('Y-m-d');
|
||||||
//$end_dt->modify('-1 minute');
|
|
||||||
while ($start_dt >= $end_dt) {
|
while ($start_dt >= $end_dt) {
|
||||||
$end_dt->modify('+1 day');
|
$end_dt->modify('+1 day');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue