Bug 295168 Task/todo list missing columns for Location, Status, Calendar Name

patch by gekacheka@yahoo.com (plus parts from me to make sorting by date work), r=mvl
This commit is contained in:
mvl%exedo.nl 2005-05-24 19:26:11 +00:00
Родитель af50a4f5ef
Коммит 092c6a6019
3 изменённых файлов: 36 добавлений и 3 удалений

Просмотреть файл

@ -596,6 +596,24 @@
persist="hidden ordinal width sortDirection sortActive"
hidden="true"
flex="1" label="&calendar.unifinder.tree.categories.label;"/>
<splitter class="tree-splitter"/>
<treecol id="unifinder-todo-tree-col-location"
persist="hidden ordinal width sortDirection sortActive"
flex="1"
hidden="true"
label="&calendar.unifinder.tree.location.label;"/>
<splitter class="tree-splitter"/>
<treecol id="unifinder-todo-tree-col-status"
persist="hidden ordinal width sortDirection sortActive"
flex="1"
hidden="true"
label="&calendar.unifinder.tree.status.label;"/>
<splitter class="tree-splitter"/>
<treecol id="unifinder-todo-tree-col-filename"
persist="hidden ordinal width sortDirection sortActive"
flex="1"
hidden="true"
label="&calendar.unifinder.tree.filename.label;"/>
</treecols>
<treechildren tooltip="taskTooltip"

Просмотреть файл

@ -532,11 +532,12 @@ function nullToEmpty(value) {
}
function compareMSTime(a, b) {
return a.compare(b);
return ((a < b) ? -1 :
(a > b) ? 1 : 0);
}
function msNextOrPreviousRecurrenceStart( calendarEvent ) {
return calendarEvent.startDate;
return calendarEvent.startDate.nativeTime;
// XXX reimplement the following
if (calendarEvent.recur && calendarEvent.start) {
treeView.outParameter.value = null; // avoid creating objects during sort
@ -551,7 +552,7 @@ function msNextOrPreviousRecurrenceStart( calendarEvent ) {
function msNextOrPreviousRecurrenceEnd(event) {
var msNextStart = msNextOrPreviousRecurrenceStart(event);
var msDuration=dateToMilliseconds(event.end)-dateToMilliseconds(event.start);
var msDuration=dateToMilliseconds(event.endDate)-dateToMilliseconds(event.startDate);
return msNextStart + msDuration;
}

Просмотреть файл

@ -49,6 +49,7 @@
*/
const ToDoUnifinderTreeName = "unifinder-todo-tree";
const kStatusOrder = ["NEEDS-ACTION", "IN-PROCESS", "COMPLETED", "CANCELLED"];
var gTaskArray = new Array();
@ -418,6 +419,12 @@ var toDoTreeView =
return( calendarToDo.percent+"%" );
case "unifinder-todo-tree-col-categories":
return( calendarToDo.categories );
case "unifinder-todo-tree-col-location":
return( calendarToDo.getProperty("LOCATION") );
case "unifinder-todo-tree-col-status":
return getToDoStatusString(calendarToDo);
case "unifinder-todo-tree-col-filename":
return( calendarToDo.parent.name );
default:
return false;
}
@ -456,6 +463,13 @@ function compareTasks( taskA, taskB )
case "unifinder-todo-tree-col-categories":
return compareString(taskA.categories, taskB.categories) * modifier;
case "unifinder-todo-tree-col-location":
return compareString(taskA.getProperty("LOCATION"), taskB.getProperty("LOCATION")) * modifier;
case "unifinder-todo-tree-col-status":
return compareNumber(kStatusOrder.indexOf(taskA.status), kStatusOrder.indexOf(taskB.status)) * modifier;
case "unifinder-todo-tree-col-filename":
return compareString(taskA.parent.name, taskB.parent.name) * modifier;
default:
return 0;
}