diff --git a/UI/Scheduler/UIxTaskEditor.m b/UI/Scheduler/UIxTaskEditor.m index 96d520810..0ec2370b9 100644 --- a/UI/Scheduler/UIxTaskEditor.m +++ b/UI/Scheduler/UIxTaskEditor.m @@ -64,12 +64,17 @@ [statusDate release]; [status release]; [statusPercent release]; + [todo release]; [super dealloc]; } /* template values */ - (iCalToDo *) todo { + if (!todo) { + todo = (iCalToDo *) [[self clientObject] component: NO secure: NO]; + [todo retain]; + } return todo; } @@ -432,10 +437,11 @@ - (id) changeStatusAction { SOGoTaskObject *clientObject; - NSString *newStatus, *iCalString; + NSString *newStatus; clientObject = [self clientObject]; todo = (iCalToDo *) [clientObject component: NO secure: NO]; + [todo retain]; if (todo) { newStatus = [self queryParameterForKey: @"status"]; @@ -447,12 +453,10 @@ [todo setPercentComplete: @"0"]; [todo setStatus: @"IN-PROCESS"]; } - - iCalString = [[clientObject calendar: NO secure: NO] versitString]; - [clientObject saveContentString: iCalString]; + [clientObject saveComponent: todo]; } - return self; + return [self responseWith204]; } @end diff --git a/UI/WebServerResources/SchedulerUI.js b/UI/WebServerResources/SchedulerUI.js index 9ae85df55..8740b5d97 100644 --- a/UI/WebServerResources/SchedulerUI.js +++ b/UI/WebServerResources/SchedulerUI.js @@ -980,7 +980,7 @@ function _loadTasksHref(href) { document.tasksListAjaxRequest.aborted = true; document.tasksListAjaxRequest.abort(); } - url = ApplicationBaseURL + "/" + href; + url = ApplicationBaseURL + href; var tasksList = $("tasksList"); var selectedIds; @@ -1215,7 +1215,7 @@ function updateTaskStatus(event) { newStatus = (newStatus ? 0 : 1); } - url = (ApplicationBaseURL + "/" + this.parentNode.calendar + url = (ApplicationBaseURL + this.parentNode.calendar + "/" + taskId + "/changeStatus?status=" + newStatus); if (http) { @@ -1223,7 +1223,7 @@ function updateTaskStatus(event) { http.open("POST", url, false /* not async */); http.url = url; http.send(""); - if (http.status == 200) + if (isHttpStatus204(http.status)) refreshTasks(); } else log ("no http client?");