Tasks: Code cleanup

This commit is contained in:
Bart Visscher 2012-04-15 15:38:44 +02:00
parent 029e1aced7
commit 19d81068f6
4 changed files with 3 additions and 21 deletions

View File

@ -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 );

View File

@ -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');

View File

@ -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 )));

View File

@ -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();