From: Greg W. <gr...@gr...> - 2002-11-22 18:42:25
|
I just started thinking about sorting the todos, so that high priority todos show up at the top (and maybe those with pressing due dates), but am not sure how best to go about it. I figure that they should be sorted first by priority, but I tend to think that low priority items should go below those without any priority (is this sort of thing discussed in the iCalendar standard somewhere? Could someone point me in the right direction?). I think just a basic sort would put those without values last. I would then tend to sort things by due date within any given priority level. Does that seem reasonable? Also, I'm not sure about how this sort of sorting would be best accomplished, technically. A sort() or ksort() wouldn't work, because the sort happens many levels above the level of the things being compared. A comment on php.net suggested that usort() would be the best thing for this purpose. Looking at the usort() documentation, it actually looks like it should be fairly easy to write a function that does this sort of nontrivial comparison. I just wanted to see if anyone had any thoughts on this before I just went ahead with it. Greg --- gr...@gr... http://www.gregwestin.com/ Contact info: http://www.gregwestin.com/contact.php |
From: Chad <ch...@ch...> - 2002-11-22 19:38:47
|
From the spec I have gathered this: Priority 1-4 = High Priority 5 = Medium Priority 6-9 = Low Priority 0 or no Priority = No Priority. It would seem that Low Priority is more important than No Priority and should sort No priority to the very bottom. This is what I was working towards implementing before I was sidetracked by a nasty bug, hehe. I have since stopped working on that bug and have turned all my findings over to David, who will look into it a bit this weekend if he has time (thanks!). so i imagine the array would look something like: $master_array['-2']['priority']['due_date'] right now it looks like this: $master_array['-2']['priority']['uid'] I haven't gotten it that far yet, not sure when you last checked cvs, as there is basic sorting of events. I cheat a bit and give no priority events a "10" and completed events and "11" for sanity sorting sake. I also havent figured out what to do if there is no due date, for sorting sake I was just putting it one year after the start date. What would be nice to have (if you want to work on it) is a todo.php for the java popup. Since the information is different the popup should contain more information such as submitted time, due date, priority, and other things found in the spec not supported in iCal. Just my thoughts. -C On Friday, November 22, 2002, at 10:42 AM, Greg Westin wrote: > I just started thinking about sorting the todos, so that high priority > todos show up at the top (and maybe those with pressing due dates), but > am not sure how best to go about it. > > I figure that they should be sorted first by priority, but I tend to > think > that low priority items should go below those without any priority (is > this sort of thing discussed in the iCalendar standard somewhere? > Could > someone point me in the right direction?). I think just a basic sort > would put those without values last. I would then tend to sort things > by > due date within any given priority level. Does that seem reasonable? > > Also, I'm not sure about how this sort of sorting would be best > accomplished, technically. A sort() or ksort() wouldn't work, because > the > sort happens many levels above the level of the things being compared. > A > comment on php.net suggested that usort() would be the best thing for > this > purpose. Looking at the usort() documentation, it actually looks like > it > should be fairly easy to write a function that does this sort of > nontrivial comparison. > > I just wanted to see if anyone had any thoughts on this before I just > went > ahead with it. > > Greg > > --- > gr...@gr... > http://www.gregwestin.com/ > Contact info: http://www.gregwestin.com/contact.php > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Phpicalendar-devel mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpicalendar-devel |
From: Greg W. <gr...@gr...> - 2002-11-22 20:12:11
|
Dear Chad and other VTODO-concerned people, > It would seem that Low Priority is more important than No Priority and > should sort No priority to the very bottom. I think that's a shame, because I wish there were a way for me to indicate that certain events are unimportant, meaning they should go to the bottom of the heap, in addition to being able to push events to the top. As it stands, at least in the iCal implementation, I have to give every to-do a priority if I want certain ones at the bottom. I suppose this would be solved if iCal gave every event some sort of medial priority by default, and let you choose to either raise or lower that, but... alas. > I haven't gotten it that far yet, not sure when you last checked cvs, > as there is basic sorting of events. I cheat a bit and give no priority > events a "10" and completed events and "11" for sanity sorting sake. I > also havent figured out what to do if there is no due date, for sorting > sake I was just putting it one year after the start date. I think you could get around this hack if you used usort(). That way, you could specify in the comparison function how events without priority, events without due dates, and completed events should be treated. I think you're right, though, in putting events with no due dates later than those with, and events with no priority after those with priority, but before completed events. > What would be nice to have (if you want to work on it) is a todo.php > for the java popup. Since the information is different the popup should > contain more information such as submitted time, due date, priority, > and other things found in the spec not supported in iCal. I'll work on it. I'd noticed that the pop-up was basically useless for to-dos. Rock on, Greg --- gr...@gr... http://www.gregwestin.com/ Contact info: http://www.gregwestin.com/contact.php |