<?php /** * Copyright (c) 2011 Bart Visscher <*****@*****.**> * This file is licensed under the Affero General Public License version 3 or * later. * See the COPYING-README file. */ OCP\JSON::checkLoggedIn(); OCP\JSON::checkAppEnabled('calendar'); $id = $_POST['id']; $access = OC_Calendar_App::getaccess($id, OC_Calendar_App::EVENT); if ($access != 'owner' && $access != 'rw') { OCP\JSON::error(array('message' => 'permission denied')); exit; } $result = OC_Calendar_Object::delete($id); OCP\JSON::success();
<?php /** * ownCloud - Addressbook * * @author Jakob Sack * @copyright 2011 Jakob Sack mail@jakobsack.de * * 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)));
public function import() { if (!$this->isValid()) { return false; } $numofcomponents = count($this->calobject->getComponents()); if ($this->overwrite) { foreach (OC_Calendar_Object::all($this->id) as $obj) { OC_Calendar_Object::delete($obj['id']); } } foreach ($this->calobject->getComponents() as $object) { if (!$object instanceof Sabre\VObject\Component\VEvent && !$object instanceof Sabre\VObject\Component\VJournal && !$object instanceof Sabre\VObject\Component\VTodo) { continue; } if (!is_null($object->DTSTART)) { $dtend = OC_Calendar_Object::getDTEndFromVEvent($object); if ($object->DTEND) { $object->DTEND->setDateTime($dtend->getDateTime(), $object->DTSTART->getDateType()); } } $vcalendar = $this->createVCalendar($object->serialize()); $insertid = OC_Calendar_Object::add($this->id, $vcalendar); $this->abscount++; if ($this->isDuplicate($insertid)) { OC_Calendar_Object::delete($insertid); } else { $this->count++; } $this->updateProgress(intval($this->abscount / $numofcomponents * 100)); } OC_Cache::remove($this->progresskey); return true; }
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); ?>
/** * @NoAdminRequired */ public function deleteTask() { $response = new JSONResponse(); $taskId = $this->params('taskID'); \OC_Calendar_Object::delete($taskId); return $response; }
/** * delete task by id * * @param int $taskID * @return bool */ public function delete($taskID) { return \OC_Calendar_Object::delete($taskID); }