|
Users
Developers
Wiki help.
|
Examples of customised sorts for gtd-php v0.8
For sorting items in the main list (listItems.php) and in the list of children on an item report (itemReport.php):
$sort["getitemsandparent"] => "DATEDIFF(CURDATE(),dateCompleted) ASC, DATEDIFF(CURDATE(),deadline) DESC, title ASC, type ASC, ptitle ASC"
will list the items with the oldest deadlines first, going through to the most recent ones to those furthest in the future, adn will then list the remaining items which have no deadline. On reports which mix incomplete and completed items, the incomplete items will all appear at the top, and the complete items will appear after that, sorted with the most recently completed items first.
How do I use the above code?
Answer:
- Open config.php
- Find
- "getitemsandparent" => "type ASC, ptitle ASC, title ASC, deadline ASC, dateCreated DESC",
- Replace with:
- "getitemsandparent" => "DATEDIFF(CURDATE(),dateCompleted) ASC, DATEDIFF(CURDATE(),deadline) DESC, title ASC, type ASC, ptitle ASC",
Example Sort Strings v0.8:
- Projects and someday/maybes on the summary page:
- Sort with Overdue items first, then everything else alphabetical
((ia.`deadline` < NOW()) AND (NOT(ISNULL(ia.`deadline`)))) DESC, i.`title` ASC
- Sort with Overdue items first, Due today items next, then everything else alphabetical
((ia.`deadline` < NOW()) AND (NOT(ISNULL(ia.`deadline`)))) DESC, ((ia.`deadline` < DATE_ADD(NOW(),INTERVAL 1 DAY)) AND (NOT(ISNULL(ia.`deadline`)))) DESC, i.`title` ASC
- Lists of items and their parents (ie List of all Actions, List of Next Actions, List of all projects):
- Sort with Overdue items at the top of the list sorting by due date, and with no due date at the bottom of the list (alphabetically sorted by title)
ISNULL(deadline) ASC, deadline ASC, ptitle ASC, type ASC,title ASC, dateCreated DESC
- Children in item view
- Sort by Date Completed with the most recent completed date first, then by deadline with the closest deadline at the top, the furthest deadline at the bottom, and no deadline always last
its.`dateCompleted` DESC, ISNULL(ia.`deadline`) ASC, ia.`deadline` ASC, i.`title` ASC
Example Sort Strings v0.9:
- Projects and someday/maybes on the summary page:
- Sort with Overdue items first, then everything else alphabetical
((`deadline` < NOW()) AND (NOT(ISNULL(`deadline`)))) DESC, `title` ASC
- Sort with Overdue items first, Due today items next, then everything else alphabetical
((`deadline` < NOW()) AND (NOT(ISNULL(`deadline`)))) DESC, ((`deadline` < DATE_ADD(NOW(),INTERVAL 1 DAY)) AND (NOT(ISNULL(`deadline`)))) DESC, `title` ASC
((`daysdue` < 0) AND NOT ISNULL(`deadline`)) ASC, (`daysdue` = 0) DESC,`title` ASC
- Lists of items and their parents (ie List of all Actions, List of Next Actions, List of all projects):
- Sort with Overdue items at the top of the list sorting by due date, and with no due date at the bottom of the list (alphabetically sorted by title)
ISNULL(`deadline`) ASC, `deadline` ASC, `type` ASC, `ptitle` ASC, `title` ASC, `dateCreated` DESC
- Children in item view
- Sort by Date Completed with the most recent completed date first, then by deadline with the closest deadline at the top, the furthest deadline at the bottom, and no deadline always last
`dateCompleted` DESC, ISNULL(`deadline`) ASC, `deadline` ASC, `title` ASC
|