本文整理汇总了PHP中OC_Calendar_Object类的典型用法代码示例。如果您正苦于以下问题:PHP OC_Calendar_Object类的具体用法?PHP OC_Calendar_Object怎么用?PHP OC_Calendar_Object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了OC_Calendar_Object类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: generateEvent
/**
* @brief generates the VEVENT/VTODO/VJOURNAL with UTC dates
* @param array $event
* @return string
*/
private static function generateEvent($event)
{
$object = OC_VObject::parse($event['calendardata']);
if (!$object) {
return false;
}
$sharedAccessClassPermissions = OC_Calendar_Object::getAccessClassPermissions($object);
if (OC_Calendar_Object::getowner($event['id']) !== OCP\User::getUser()) {
if (!($sharedAccessClassPermissions & OCP\PERMISSION_READ)) {
return '';
}
}
$object = OC_Calendar_Object::cleanByAccessClass($event['id'], $object);
if ($object->VEVENT) {
$dtstart = $object->VEVENT->DTSTART;
$start_dt = $dtstart->getDateTime();
$dtend = OC_Calendar_Object::getDTEndFromVEvent($object->VEVENT);
$end_dt = $dtend->getDateTime();
if ($dtstart->getDateType() !== Sabre\VObject\Property\DateTime::DATE) {
$start_dt->setTimezone(new DateTimeZone('UTC'));
$end_dt->setTimezone(new DateTimeZone('UTC'));
$object->VEVENT->setDateTime('DTSTART', $start_dt, Sabre\VObject\Property\DateTime::UTC);
$object->VEVENT->setDateTime('DTEND', $end_dt, Sabre\VObject\Property\DateTime::UTC);
}
return $object->VEVENT->serialize();
}
if ($object->VTODO) {
return $object->VTODO->serialize();
}
if ($object->VJOURNAL) {
return $object->VJOURNAL->serialize();
}
return '';
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:39,代码来源:export.php
示例2: generateEvent
/**
* @brief generates the VEVENT with UTC dates
* @param array $event
* @return string
*/
private static function generateEvent($event)
{
$object = OC_VObject::parse($event['calendardata']);
if (!$object) {
return false;
}
if ($object->VEVENT) {
$dtstart = $object->VEVENT->DTSTART;
$start_dt = $dtstart->getDateTime();
$dtend = OC_Calendar_Object::getDTEndFromVEvent($object->VEVENT);
$end_dt = $dtend->getDateTime();
if ($dtstart->getDateType() !== Sabre\VObject\Property\DateTime::DATE) {
$start_dt->setTimezone(new DateTimeZone('UTC'));
$end_dt->setTimezone(new DateTimeZone('UTC'));
$object->VEVENT->setDateTime('DTSTART', $start_dt, Sabre\VObject\Property\DateTime::UTC);
$object->VEVENT->setDateTime('DTEND', $end_dt, Sabre\VObject\Property\DateTime::UTC);
}
return $object->VEVENT->serialize();
}
if ($object->VTODO) {
return $object->VTODO->serialize();
}
if ($object->VJOURNAL) {
return $object->VJOURNAL->serialize();
}
return '';
}
开发者ID:netcon-source,项目名称:apps,代码行数:32,代码来源:export.php
示例3: formatItems
public function formatItems($items, $format, $parameters = null)
{
$events = array();
if ($format == self::FORMAT_EVENT) {
foreach ($items as $item) {
$event = OC_Calendar_Object::find($item['item_source']);
$event['summary'] = $item['item_target'];
$event['permissions'] = $item['permissions'];
$events[] = $event;
}
}
return $events;
}
开发者ID:blablubli,项目名称:owncloudapps,代码行数:13,代码来源:event.php
示例4: search
/**
* Search for query in tasks
*
* @param string $query
* @return array list of \OCA\Tasks\Controller\Task
*/
function search($query)
{
$calendars = \OC_Calendar_Calendar::allCalendars(\OC::$server->getUserSession()->getUser()->getUID(), true);
$user_timezone = \OC_Calendar_App::getTimezone();
// check if the calenar is enabled
if (count($calendars) == 0 || !\OCP\App::isEnabled('tasks')) {
return array();
}
$results = array();
foreach ($calendars as $calendar) {
// $calendar_entries = \OC_Calendar_Object::all($calendar['id']);
$objects = \OC_Calendar_Object::all($calendar['id']);
// $date = strtotime($query);
// // search all calendar objects, one by one
foreach ($objects as $object) {
// skip non-todos
if ($object['objecttype'] != 'VTODO') {
continue;
}
if (!($vtodo = Helper::parseVTODO($object))) {
continue;
}
$id = $object['id'];
$calendarId = $object['calendarid'];
// check these properties
$properties = array('SUMMARY', 'DESCRIPTION', 'LOCATION', 'CATEGORIES');
foreach ($properties as $property) {
$string = $vtodo->{$property};
if (stripos($string, $query) !== false) {
// $results[] = new \OCA\Tasks\Controller\Task($id,$calendarId,$vtodo,$property,$query,$user_timezone);
$results[] = Helper::arrayForJSON($id, $vtodo, $user_timezone, $calendarId);
continue 2;
}
}
$comments = $vtodo->COMMENT;
if ($comments) {
foreach ($comments as $com) {
if (stripos($com->getValue(), $query) !== false) {
// $results[] = new \OCA\Tasks\Controller\Task($id,$calendarId,$vtodo,'COMMENTS',$query,$user_timezone);
$results[] = Helper::arrayForJSON($id, $vtodo, $user_timezone, $calendarId);
continue 2;
}
}
}
}
}
usort($results, array($this, 'sort_completed'));
return $results;
}
开发者ID:sbambach,项目名称:tasks,代码行数:55,代码来源:searchcontroller.php
示例5: generateEvent
/**
* @brief generates the VEVENT with UTC dates
* @param array $event
* @return string
*/
private static function generateEvent($event)
{
$object = OC_VObject::parse($event['calendardata']);
$dtstart = $object->VEVENT->DTSTART;
$start_dt = $dtstart->getDateTime();
$dtend = OC_Calendar_Object::getDTEndFromVEvent($object->VEVENT);
$end_dt = $dtend->getDateTime();
if ($dtstart->getDateType() !== Sabre_VObject_Element_DateTime::DATE) {
$start_dt->setTimezone(new DateTimeZone('UTC'));
$end_dt->setTimezone(new DateTimeZone('UTC'));
$object->VEVENT->setDateTime('DTSTART', $start_dt, Sabre_VObject_Property_DateTime::UTC);
$object->VEVENT->setDateTime('DTEND', $end_dt, Sabre_VObject_Property_DateTime::UTC);
}
return $object->VEVENT->serialize();
}
开发者ID:blablubli,项目名称:owncloudapps,代码行数:20,代码来源:export.php
示例6: search
function search($query)
{
$calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), true);
if (count($calendars) == 0 || !OCP\App::isEnabled('calendar')) {
//return false;
}
$results = array();
$searchquery = array();
if (substr_count($query, ' ') > 0) {
$searchquery = explode(' ', $query);
} else {
$searchquery[] = $query;
}
$user_timezone = OC_Calendar_App::getTimezone();
$l = new OC_l10n('calendar');
foreach ($calendars as $calendar) {
$objects = OC_Calendar_Object::all($calendar['id']);
foreach ($objects as $object) {
if ($object['objecttype'] != 'VEVENT') {
continue;
}
if (substr_count(strtolower($object['summary']), strtolower($query)) > 0) {
$calendardata = OC_VObject::parse($object['calendardata']);
$vevent = $calendardata->VEVENT;
$dtstart = $vevent->DTSTART;
$dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
$start_dt = $dtstart->getDateTime();
$start_dt->setTimezone(new DateTimeZone($user_timezone));
$end_dt = $dtend->getDateTime();
$end_dt->setTimezone(new DateTimeZone($user_timezone));
if ($dtstart->getDateType() == Sabre\VObject\Property\DateTime::DATE) {
$end_dt->modify('-1 sec');
if ($start_dt->format('d.m.Y') != $end_dt->format('d.m.Y')) {
$info = $l->t('Date') . ': ' . $start_dt->format('d.m.Y') . ' - ' . $end_dt->format('d.m.Y');
} else {
$info = $l->t('Date') . ': ' . $start_dt->format('d.m.Y');
}
} else {
$info = $l->t('Date') . ': ' . $start_dt->format('d.m.y H:i') . ' - ' . $end_dt->format('d.m.y H:i');
}
$link = OCP\Util::linkTo('calendar', 'index.php') . '?showevent=' . urlencode($object['id']);
$results[] = new OC_Search_Result($object['summary'], $info, $link, (string) $l->t('Cal.'));
//$name,$text,$link,$type
}
}
}
return $results;
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:48,代码来源:search.php
示例7: parseVTODO
public static function parseVTODO($task)
{
$object = \Sabre\VObject\Reader::read($task['calendardata']);
if (!$object) {
return false;
}
$sharedAccessClassPermissions = \OC_Calendar_Object::getAccessClassPermissions($object);
if (\OC_Calendar_Object::getowner($task['id']) !== \OC::$server->getUserSession()->getUser()->getUID()) {
if (!($sharedAccessClassPermissions & \OCP\Constants::PERMISSION_READ)) {
return false;
}
}
$object = \OC_Calendar_Object::cleanByAccessClass($task['id'], $object);
$vtodo = $object->VTODO;
return $vtodo;
}
开发者ID:sbambach,项目名称:tasks,代码行数:16,代码来源:helper.php
示例8: formatItems
public function formatItems($items, $format, $parameters = null)
{
$events = array();
if ($format == self::FORMAT_EVENT) {
foreach ($items as $item) {
$event = OC_Calendar_Object::find($item['item_source']);
if ($event == False) {
\OCP\Util::writeLog('calendar', __METHOD__ . ', Missing event: ' . $item['item_target'], \OCP\Util::DEBUG);
} else {
$event['summary'] = $item['item_target'];
$event['permissions'] = $item['permissions'];
$events[] = $event;
}
}
}
return $events;
}
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:17,代码来源:event.php
示例9: getACL
/**
* Returns a list of ACE's for this node.
*
* Each ACE has the following properties:
* * 'privilege', a string such as {DAV:}read or {DAV:}write. These are
* currently the only supported privileges
* * 'principal', a url to the principal who owns the node
* * 'protected' (optional), indicating that this ACE is not allowed to
* be updated.
*
* @return array
*/
public function getACL()
{
$readprincipal = $this->getOwner();
$writeprincipal = $this->getOwner();
$uid = OC_Calendar_Calendar::extractUserID($this->getOwner());
if ($uid != OCP\USER::getUser()) {
if ($uid === 'contact_birthdays') {
$readprincipal = 'principals/' . OCP\User::getUser();
} else {
$object = OC_VObject::parse($this->objectData['calendardata']);
$sharedCalendar = OCP\Share::getItemSharedWithBySource('calendar', $this->calendarInfo['id']);
$sharedAccessClassPermissions = OC_Calendar_Object::getAccessClassPermissions($object);
if ($sharedCalendar && $sharedCalendar['permissions'] & OCP\PERMISSION_READ && $sharedAccessClassPermissions & OCP\PERMISSION_READ) {
$readprincipal = 'principals/' . OCP\USER::getUser();
}
if ($sharedCalendar && $sharedCalendar['permissions'] & OCP\PERMISSION_UPDATE && $sharedAccessClassPermissions & OCP\PERMISSION_UPDATE) {
$writeprincipal = 'principals/' . OCP\USER::getUser();
}
}
}
return array(array('privilege' => '{DAV:}read', 'principal' => $readprincipal, 'protected' => true), array('privilege' => '{DAV:}write', 'principal' => $writeprincipal, 'protected' => true), array('privilege' => '{DAV:}read', 'principal' => $readprincipal . '/calendar-proxy-write', 'protected' => true), array('privilege' => '{DAV:}write', 'principal' => $writeprincipal . '/calendar-proxy-write', 'protected' => true), array('privilege' => '{DAV:}read', 'principal' => $readprincipal . '/calendar-proxy-read', 'protected' => true));
}
开发者ID:omusico,项目名称:isle-web-framework,代码行数:34,代码来源:object.php
示例10: generateEvent
/**
* @brief generates the VEVENT/VTODO/VJOURNAL with UTC dates
* @param array $event
* @return string
*/
private static function generateEvent($event)
{
$object = OC_VObject::parse($event['calendardata']);
if (!$object) {
return false;
}
$sharedAccessClassPermissions = OC_Calendar_Object::getAccessClassPermissions($object);
if (OC_Calendar_Object::getowner($event['id']) !== OCP\User::getUser()) {
if (!($sharedAccessClassPermissions & OCP\PERMISSION_READ)) {
return '';
}
}
$object = OC_Calendar_Object::cleanByAccessClass($event['id'], $object);
if ($object->VEVENT) {
return $object->VEVENT->serialize();
}
if ($object->VTODO) {
return $object->VTODO->serialize();
}
if ($object->VJOURNAL) {
return $object->VJOURNAL->serialize();
}
return '';
}
开发者ID:WYSAC,项目名称:oregon-owncloud,代码行数:29,代码来源:export.php
示例11: __construct
/**
* Constructor
*
* @param array $data
* @return \OCA\Calendar\Search\Event
*/
public function __construct(array $data = null)
{
// set default properties
$this->id = $data['id'];
$this->name = $data['summary'];
$this->link = \OCP\Util::linkTo('calendar', 'index.php') . '?showevent=' . urlencode($data['id']);
// do calendar-specific setup
$l = new \OC_l10n('calendar');
$calendar_data = \Sabre\VObject\Reader::read($data['calendardata']);
$vevent = $calendar_data->VEVENT;
// get start time
$dtstart = $vevent->DTSTART;
$start_dt = $dtstart->getDateTime();
$start_dt->setTimezone($this->getUserTimezone());
$this->start_time = $start_dt->format('r');
// get end time
$dtend = \OC_Calendar_Object::getDTEndFromVEvent($vevent);
$end_dt = $dtend->getDateTime();
$end_dt->setTimezone($this->getUserTimezone());
$this->end_time = $end_dt->format('r');
// create text description
if (!$dtstart->hasTime()) {
$end_dt->modify('-1 sec');
if ($start_dt->format('d.m.Y') != $end_dt->format('d.m.Y')) {
$this->text = $l->t('Date') . ': ' . $start_dt->format('d.m.Y') . ' - ' . $end_dt->format('d.m.Y');
} else {
$this->text = $l->t('Date') . ': ' . $start_dt->format('d.m.Y');
}
} else {
$this->text = $l->t('Date') . ': ' . $start_dt->format('d.m.y H:i') . ' - ' . $end_dt->format('d.m.y H:i');
}
// set last modified time
$this->modified = date('r', $data['lastmodified']);
// set repeating property
$this->repeating = (bool) $data['repeating'];
}
开发者ID:enoch85,项目名称:owncloud-testserver,代码行数:42,代码来源:event.php
示例12: array
<?php
/**
* ownCloud - Addressbook
*
* @author Jakob Sack
* @copyright 2011 Jakob Sack [email protected]
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*/
// Init owncloud
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('tasks');
OCP\JSON::callCheck();
$id = $_POST['id'];
$task = OC_Calendar_App::getEventObject($id);
OC_Calendar_Object::delete($id);
OCP\JSON::success(array('data' => array('id' => $id)));
开发者ID:omusico,项目名称:isle-web-framework,代码行数:30,代码来源:delete.php
示例13: deleteComment
/**
* @NoAdminRequired
*/
public function deleteComment()
{
$taskId = $this->params('taskID');
$commentId = $this->params('commentID');
$response = new JSONResponse();
try {
$vcalendar = \OC_Calendar_App::getVCalendar($taskId);
$vtodo = $vcalendar->VTODO;
$commentIndex = $this->getCommentById($vtodo, $commentId);
$comment = $vtodo->children[$commentIndex];
if ($comment['USERID'] == $this->userId) {
unset($vtodo->children[$commentIndex]);
\OC_Calendar_Object::edit($taskId, $vcalendar->serialize());
} else {
throw new \Exception('Not allowed.');
}
} catch (\Exception $e) {
// throw new BusinessLayerException($e->getMessage());
}
return $response;
}
开发者ID:msbt,项目名称:tasks,代码行数:24,代码来源:taskscontroller.php
示例14: explode
}
if ($_GET["path"] != "") {
$filename = $_GET["path"] . "/" . $_GET["file"];
} else {
$filename = "/" . $_GET["file"];
}
} else {
$id = OC_Calendar_Calendar::addCalendar(OC_User::getUser(), $_POST['calname']);
OC_Calendar_Calendar::setCalendarActive($id, 1);
$calid = $id;
if ($_POST["path"] != "") {
$filename = $_POST["path"] . "/" . $_POST["file"];
} else {
$filename = "/" . $_POST["file"];
}
}
$vcalendar = OC_Filesystem::file_get_contents($filename);
$vcalendar = explode("BEGIN:VEVENT", $vcalendar);
for ($i = 1; $i < count($vcalendar); $i++) {
$vcalendar[$i] = "BEGIN:VEVENT" . $vcalendar[$i];
}
for ($i = 1; $i < count($vcalendar) - 1; $i++) {
$vcalendar[$i] = $vcalendar[$i] . "END:VCALENDAR";
}
for ($i = 1; $i < count($vcalendar); $i++) {
$vcalendar[$i] = $vcalendar[0] . $vcalendar[$i];
}
for ($i = 1; $i < count($vcalendar); $i++) {
OC_Calendar_Object::add($calid, $vcalendar[$i]);
}
OC_JSON::success();
开发者ID:Teino1978-Corp,项目名称:Teino1978-Corp-owncloud_.htaccess-,代码行数:31,代码来源:owncloud_apps_calendar_import.php
示例15: generateEventOutput
/**
* @brief generates the output for an event which will be readable for our js
* @param (mixed) $event - event object / array
* @param (int) $start - DateTime object of start
* @param (int) $end - DateTime object of end
* @return (array) $output - readable output
*/
public static function generateEventOutput(array $event, $start, $end)
{
if (!isset($event['calendardata']) && !isset($event['vevent'])) {
return false;
}
if (!isset($event['calendardata']) && isset($event['vevent'])) {
$event['calendardata'] = "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:ownCloud's Internal iCal System\n" . $event['vevent']->serialize() . "END:VCALENDAR";
}
try {
$object = OC_VObject::parse($event['calendardata']);
if (!$object) {
\OCP\Util::writeLog('calendar', __METHOD__ . ' Error parsing event: ' . print_r($event, true), \OCP\Util::DEBUG);
return array();
}
$output = array();
if ($object->name === 'VEVENT') {
$vevent = $object;
} elseif (isset($object->VEVENT)) {
$vevent = $object->VEVENT;
} else {
\OCP\Util::writeLog('calendar', __METHOD__ . ' Object contains not event: ' . print_r($event, true), \OCP\Util::DEBUG);
return $output;
}
$id = $event['id'];
if (OC_Calendar_Object::getowner($id) !== OCP\USER::getUser()) {
// do not show events with private or unknown access class
if (isset($vevent->CLASS) && ($vevent->CLASS->value === 'PRIVATE' || $vevent->CLASS->value === '')) {
return $output;
}
$object = OC_Calendar_Object::cleanByAccessClass($id, $object);
}
$allday = $vevent->DTSTART->getDateType() == Sabre\VObject\Property\DateTime::DATE ? true : false;
$last_modified = @$vevent->__get('LAST-MODIFIED');
$lastmodified = $last_modified ? $last_modified->getDateTime()->format('U') : 0;
$staticoutput = array('id' => (int) $event['id'], 'title' => !is_null($vevent->SUMMARY) && $vevent->SUMMARY->value != '' ? strtr($vevent->SUMMARY->value, array('\\,' => ',', '\\;' => ';')) : self::$l10n->t('unnamed'), 'description' => isset($vevent->DESCRIPTION) ? strtr($vevent->DESCRIPTION->value, array('\\,' => ',', '\\;' => ';')) : '', 'lastmodified' => $lastmodified, 'allDay' => $allday);
if (OC_Calendar_Object::isrepeating($id) && OC_Calendar_Repeat::is_cached_inperiod($event['id'], $start, $end)) {
$cachedinperiod = OC_Calendar_Repeat::get_inperiod($id, $start, $end);
foreach ($cachedinperiod as $cachedevent) {
$dynamicoutput = array();
if ($allday) {
$start_dt = new DateTime($cachedevent['startdate'], new DateTimeZone('UTC'));
$end_dt = new DateTime($cachedevent['enddate'], new DateTimeZone('UTC'));
$dynamicoutput['start'] = $start_dt->format('Y-m-d');
$dynamicoutput['end'] = $end_dt->format('Y-m-d');
} else {
$start_dt = new DateTime($cachedevent['startdate'], new DateTimeZone('UTC'));
$end_dt = new DateTime($cachedevent['enddate'], new DateTimeZone('UTC'));
$start_dt->setTimezone(new DateTimeZone(self::$tz));
$end_dt->setTimezone(new DateTimeZone(self::$tz));
$dynamicoutput['start'] = $start_dt->format('Y-m-d H:i:s');
$dynamicoutput['end'] = $end_dt->format('Y-m-d H:i:s');
}
$output[] = array_merge($staticoutput, $dynamicoutput);
}
} else {
if (OC_Calendar_Object::isrepeating($id) || $event['repeating'] == 1) {
$object->expand($start, $end);
}
foreach ($object->getComponents() as $singleevent) {
if (!$singleevent instanceof Sabre\VObject\Component\VEvent) {
continue;
}
$dynamicoutput = OC_Calendar_Object::generateStartEndDate($singleevent->DTSTART, OC_Calendar_Object::getDTEndFromVEvent($singleevent), $allday, self::$tz);
$output[] = array_merge($staticoutput, $dynamicoutput);
}
}
return $output;
} catch (Exception $e) {
$uid = 'unknown';
if (isset($event['uri'])) {
$uid = $event['uri'];
}
\OCP\Util::writeLog('calendar', 'Event (' . $uid . ') contains invalid data: ' . $e->getMessage(), \OCP\Util::WARN);
}
}
开发者ID:yheric455042,项目名称:owncloud82,代码行数:82,代码来源:app.php
示例16: isDuplicate
private function isDuplicate($insertid)
{
$newobject = OC_Calendar_Object::find($insertid);
$stmt = OCP\DB::prepare('SELECT COUNT(*) AS `count` FROM `*PREFIX*clndr_objects`
INNER JOIN `*PREFIX*clndr_calendars` ON `calendarid`=`*PREFIX*clndr_calendars`.`id`
WHERE `objecttype`=? AND `startdate`=? AND `enddate`=? AND `repeating`=? AND `summary`=? AND `calendardata`=? AND `userid` = ?');
$result = $stmt->execute(array($newobject['objecttype'], $newobject['startdate'], $newobject['enddate'], $newobject['repeating'], $newobject['summary'], $newobject['calendardata'], $this->userid));
$result = $result->fetchRow();
if ($result['count'] >= 2) {
return true;
}
return false;
}
开发者ID:CDN-Sparks,项目名称:owncloud,代码行数:13,代码来源:import.php
示例17: is_calendar_cached
/**
* @brief checks if a whole calendar is already cached
* @param (int) id - id of the calendar
* @return (bool)
*/
public static function is_calendar_cached($id)
{
$cachedevents = count(self::getCalendar($id));
$repeatingevents = 0;
$allevents = OC_Calendar_Object::all($id);
foreach ($allevents as $event) {
if ($event['repeating'] === 1) {
$repeatingevents++;
}
}
if ($cachedevents < $repeatingevents) {
return false;
} else {
return true;
}
}
开发者ID:netcon-source,项目名称:apps,代码行数:21,代码来源:repeat.php
示例18: deleteCalendarObject
/**
* Deletes an existing calendar object.
*
* @param string $calendarId
* @param string $objectUri
* @return void
*/
public function deleteCalendarObject($calendarId, $objectUri)
{
OC_Calendar_Object::deleteFromDAVData($calendarId, $objectUri);
}
开发者ID:AlfredoCubitos,项目名称:calendar,代码行数:11,代码来源:backend.php
示例19: p
p($_['task']);
?>
" />
<input type="hidden" name="title" value="<?php
p($_POST['title']);
?>
" />
</form>
<?php
if (strcmp($_['permission_granted'], 'true') == 0) {
$event_id = OC_Collaboration_Calendar::getEventId($_POST['tid']);
if (!isset($_POST['status'])) {
$_POST['member'] = "";
}
if (isset($_POST['status']) && strcasecmp($_POST['status'], 'Cancelled') == 0) {
OC_Calendar_Object::delete($event_id);
} else {
$start = new DateTime(OC_Collaboration_Calendar::getEventStartTime($event_id));
$start->setTimezone(new DateTimeZone('Asia/Kolkata'));
$start_date = $start->format('d-m-Y');
$start_time = $start->format('H:i:s');
$deadline = new DateTime(OC_Collaboration_Time::convertUITimeShortToDBTimeShort($_POST['deadline_time']));
$deadline_date = $deadline->format('d-m-Y');
$deadline_time = $deadline->format('H:i:s');
$last_modified = new DateTime();
?>
<form id="ev_form" action="" method="post" >
<input type="hidden" name="create_new" value="false" id="create_new" />
<input type="hidden" name="id" value="<?php
p($event_id);
?>
开发者ID:TheAgentK,项目名称:owncloud-collaboration,代码行数:31,代码来源:event_edit_form.php
示例20: foreach
$taskId = $task['id'];
$comments = $vtodo->COMMENT;
if ($comments) {
foreach ($comments as $com) {
$idx = 0;
foreach ($children as $i => &$property) {
if ($property->name == 'COMMENT' && $property['ID']->value == (int) $com['ID']->value) {
unset($vtodo->children[$idx]);
}
$idx += 1;
}
$vtodo->addProperty('COMMENT', $com->value, array('X-OC-ID' => (int) $com['ID']->value, 'X-OC-USERID' => $com['USERID']->value, 'X-OC-DATE-TIME' => $com['DATE-TIME']->value));
OCP\Util::emitHook('OC_Calendar', 'editEvent', $taskId);
}
$data = $vcalendar->serialize();
$oldobject = \OC_Calendar_Object::find($taskId);
$object = \OC_VObject::parse($data);
$type = 'VTODO';
$startdate = null;
$enddate = null;
$summary = '';
$repeating = 0;
$uid = null;
foreach ($object->children as $property) {
if ($property->name == 'VTODO') {
foreach ($property->children as &$element) {
if ($element->name == 'SUMMARY') {
$summary = $element->value;
} elseif ($element->name == 'UID') {
$uid = $element->value;
}
开发者ID:WeatherellTechnology,项目名称:weatherstorm7,代码行数:31,代码来源:update.php
注:本文中的OC_Calendar_Object类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论