Recent Changes - Search:

Users

Developers

Wiki help.

The Sort Cookbook

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:

  1. Open config.php
  2. Find
    • "getitemsandparent" => "type ASC, ptitle ASC, title ASC, deadline ASC, dateCreated DESC",
  3. Replace with:
    • "getitemsandparent" => "DATEDIFF(CURDATE(),dateCompleted) ASC, DATEDIFF(CURDATE(),deadline) DESC, title ASC, type ASC, ptitle ASC",
Edit - History - Print - Recent Changes - Search
Page last modified on July 04, 2008, at 01:50 PM