diff --git a/calendar/resources/content/calendar.js b/calendar/resources/content/calendar.js
index 11969dc4330c..3061c552a819 100644
--- a/calendar/resources/content/calendar.js
+++ b/calendar/resources/content/calendar.js
@@ -943,6 +943,13 @@ function editEvent( calendarEvent )
null);
}
+function editToDo( calendarTodo )
+{
+ openEventDialog(calendarTodo,
+ "edit",
+ self.modifyEventDialogResponse,
+ null);
+}
/**
* Called when the user clicks OK in the edit event dialog
diff --git a/calendar/resources/content/calendar.xul b/calendar/resources/content/calendar.xul
index 7f0bad4e0bc2..3f396d6ace3b 100644
--- a/calendar/resources/content/calendar.xul
+++ b/calendar/resources/content/calendar.xul
@@ -559,7 +559,7 @@
- 0 )
- checkboxClick( calendarToDo, false ) ;
+ if (calendarToDo.completedDate.isValid)
+ checkboxClick( calendarToDo, false ) ;
else
- checkboxClick( calendarToDo, true ) ;
+ checkboxClick( calendarToDo, true ) ;
}
},
cycleHeader : function(col, element) // element parameter used in Moz1.7-
@@ -539,20 +527,7 @@ function refreshToDoTree( taskArray )
function getTaskTable( )
{
- var taskTable;
-
- gICalLib.resetFilter();
-
- if( document.getElementById( "only-completed-checkbox" ).getAttribute( "checked" ) == "true" )
- {
- var now = new Date();
-
- gICalLib.filter.completed.setTime( now );
- }
-
- taskTable = gEventSource.getAllToDos();
-
- return( taskTable );
+ return gTaskArray;
}
@@ -562,11 +537,13 @@ function contextChangeProgress( event, Progress )
if (tree.view.selection.count > 0)
{
- var toDoItem = tree.taskView.getCalendarTaskAtRow( tree.currentIndex );
- if(toDoItem)
+ var todoItem = tree.taskView.getCalendarTaskAtRow( tree.currentIndex );
+ if(todoItem)
{
- toDoItem.percent = Progress;
- gICalLib.modifyTodo( toDoItem );
+ var newItem = todoItem.clone().QueryInterface(Components.interfaces.calITodo);
+ newItem.percentComplete = Progress;
+ var calendar = createCalendar();
+ calendar.modifyItem (newItem, null);
}
}
}
@@ -578,11 +555,13 @@ function contextChangePriority( event, Priority )
if (tree.view.selection.count > 0)
{
- var toDoItem = tree.taskView.getCalendarTaskAtRow( tree.currentIndex );
- if(toDoItem)
+ var todoItem = tree.taskView.getCalendarTaskAtRow( tree.currentIndex );
+ if(todoItem)
{
- toDoItem.priority = Priority;
- gICalLib.modifyTodo( toDoItem );
+ var newItem = todoItem.clone().QueryInterface(Components.interfaces.calITodo);
+ newItem.priority = Priority;
+ var calendar = createCalendar();
+ calendar.modifyItem (newItem, null);
}
}
}