diff options
Diffstat (limited to 'apps/tasks/ajax')
-rw-r--r-- | apps/tasks/ajax/update_property.php (renamed from apps/tasks/ajax/complete.php) | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/apps/tasks/ajax/complete.php b/apps/tasks/ajax/update_property.php index 22c65c0bc83..1916a2eb7b1 100644 --- a/apps/tasks/ajax/complete.php +++ b/apps/tasks/ajax/update_property.php @@ -12,11 +12,23 @@ OC_JSON::checkLoggedIn(); OC_JSON::checkAppEnabled('tasks'); $id = $_POST['id']; -$checked = $_POST['checked']; +$property = $_POST['type']; $vcalendar = OC_Calendar_App::getVCalendar( $id ); $vtodo = $vcalendar->VTODO; -OC_Task_App::setComplete($vtodo, $checked ? '100' : '0', null); +switch($property) { + case 'summary': + $summary = $_POST['summary']; + $vtodo->setString('SUMMARY', $summary); + break; + case 'complete': + $checked = $_POST['checked']; + OC_Task_App::setComplete($vtodo, $checked ? '100' : '0', null); + break; + default: + OC_JSON::error(array('data'=>array('message'=>'Unknown type'))); + exit(); +} OC_Calendar_Object::edit($id, $vcalendar->serialize()); $user_timezone = OC_Preferences::getValue(OC_USER::getUser(), 'calendar', 'timezone', date_default_timezone_get()); |