diff --git a/apps/tasks/ajax/addtask.php b/apps/tasks/ajax/addtask.php index 0c8cb89e7f..3f129a0eb9 100644 --- a/apps/tasks/ajax/addtask.php +++ b/apps/tasks/ajax/addtask.php @@ -5,8 +5,6 @@ require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('tasks'); -$l10n = new OC_L10N('tasks'); - $cid = $_POST['id']; $calendar = OC_Calendar_App::getCalendar( $cid ); diff --git a/apps/tasks/ajax/addtaskform.php b/apps/tasks/ajax/addtaskform.php index f56549cd74..48e1bc8d89 100644 --- a/apps/tasks/ajax/addtaskform.php +++ b/apps/tasks/ajax/addtaskform.php @@ -5,10 +5,8 @@ require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('tasks'); -$l10n = new OC_L10N('tasks'); - $calendars = OC_Calendar_Calendar::allCalendars(OC_User::getUser(), true); -$category_options = OC_Calendar_App::getCategoryOptions($l10n); +$category_options = OC_Calendar_App::getCategoryOptions(); $percent_options = range(0, 100, 10); $priority_options = OC_Task_App::getPriorityOptions(); $tmpl = new OC_Template('tasks','part.addtaskform'); diff --git a/apps/tasks/ajax/delete.php b/apps/tasks/ajax/delete.php index 03c8a7e92e..ce80191a56 100644 --- a/apps/tasks/ajax/delete.php +++ b/apps/tasks/ajax/delete.php @@ -25,20 +25,8 @@ require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('tasks'); -$l10n = new OC_L10N('tasks'); - $id = $_GET['id']; -$task = OC_Calendar_Object::find( $id ); -if( $task === false ){ - OC_JSON::error(array('data' => array( 'message' => $l10n->t('Can not find Task!')))); - exit(); -} - -$calendar = OC_Calendar_Calendar::findCalendar( $task['calendarid'] ); -if( $calendar === false || $calendar['userid'] != OC_USER::getUser()){ - OC_JSON::error(array('data' => array( 'message' => $l10n->t('This is not your task!')))); - exit(); -} +$task = OC_Calendar_App::getEventObject( $id ); OC_Calendar_Object::delete($id); OC_JSON::success(array('data' => array( 'id' => $id ))); diff --git a/apps/tasks/ajax/edittaskform.php b/apps/tasks/ajax/edittaskform.php index e23eb21824..42a4bfead8 100644 --- a/apps/tasks/ajax/edittaskform.php +++ b/apps/tasks/ajax/edittaskform.php @@ -5,13 +5,11 @@ require_once('../../../lib/base.php'); OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('tasks'); -$l10n = new OC_L10N('tasks'); - $id = $_GET['id']; $details = OC_Calendar_App::getVCalendar($id)->VTODO; $categories = $details->getAsString('CATEGORIES'); -$category_options = OC_Calendar_App::getCategoryOptions($l10n); +$category_options = OC_Calendar_App::getCategoryOptions(); $percent_options = range(0, 100, 10); $priority_options = OC_Task_App::getPriorityOptions();