Class Nag_Task

Description

Nag_Task handles as single task as well as a list of tasks and implements a recursive iterator to handle a (hierarchical) list of tasks.

Located in /lib/Driver.php (line 476)


	
			
Variable Summary
 integer $alarm
 string $assignee
 string $category
 array $children
 boolean $completed
 integer $completed_date
 string $delete_link
 string $desc
 integer $due
 string $edit_link
 float $estimate
 string $id
 integer $indent
 boolean $lastChild
 string $name
 string $owner
 string $parent_id
 integer $priority
 boolean $private
 integer $start
 string $tasklist
 string $uid
 string $view_link
 array $_dict
 boolean $_inlist
 integer $_pointer
Method Summary
 Nag_Task Nag_Task ([array $task = null])
 void add ( &$task, Nag_Task $task)
 boolean childrenCompleted ()
 integer count ()
 void &each ()
 integer estimation ()
 void fromiCalendar (Horde_iCalendar_vtodo $vTodo)
 Nag_Task &get (string $key)
 boolean hasSubTasks ()
 boolean hasTasks ()
 void loadChildren ()
 void merge (array $task)
 void mergeChildren (array $children)
 void process ([integer $indent = 0])
 void reset ()
 void save ()
 void sort (string $sortby, integer $sortdir, string $altsortby)
 array toAlarm ([string $user = null], [Prefs $prefs = null])
 array toHash ()
 Horde_iCalendar_vtodo toiCalendar ( &$calendar, Horde_iCalendar $calendar)
 string treeIcons ()
Variables
integer $alarm (line 581)

The task alarm threshold.

string $assignee (line 511)

The task assignee.

string $category (line 574)

The task category

array $children = array() (line 637)

The sub-tasks.

boolean $completed (line 560)

Whether the task is completed.

integer $completed_date (line 567)

The completion date timestamp.

string $complete_link (line 602)

URL to complete the task.

string $delete_link (line 616)

URL to delete the task.

string $desc (line 525)

The task decription.

integer $due (line 539)

The due date timestamp.

string $edit_link (line 609)

URL to edit the task.

float $estimate (line 553)

The estimated task length.

string $id (line 483)

The task id.

integer $indent = 0 (line 644)

This task's idention (child) level.

boolean $lastChild (line 651)

Whether this is the last sub-task.

string $name (line 518)

The task title.

string $owner (line 504)

The task owner.

Nag_Task $parent (line 630)

The parent task.

string $parent_id = '' (line 623)

The parent task's id.

integer $priority (line 546)

The task priority.

boolean $private (line 588)

Whether the task is private.

integer $start (line 532)

The start date timestamp.

string $tasklist (line 490)

This task's tasklist id.

string $uid (line 497)

The task uid.

string $view_link (line 595)

URL to view the task.

array $_dict = array() (line 674)

Task id => pointer dictionary.

boolean $_inlist = false (line 659)

Internal flag.

integer $_pointer (line 667)

Internal pointer.

Methods
Constructor Nag_Task (line 683)

Constructor.

Takes a hash and returns a nice wrapper around it.

Nag_Task Nag_Task ([array $task = null])
  • array $task: A task hash.
add (line 751)

Adds a sub task to this task.

void add ( &$task, Nag_Task $task)
childrenCompleted (line 837)

Returns whether all sub tasks are completed.

  • return: True if all sub tasks are completed.
boolean childrenCompleted ()
count (line 852)

Returns the number of tasks including this and any sub tasks.

  • return: The number of tasks and sub tasks.
integer count ()
each (line 916)

Returns the next task iterating through all tasks and sub tasks.

Call reset() each time before looping through the tasks:

void &each ()
estimation (line 866)

Returns the estimated length for this and any sub tasks.

  • return: The estimated length sum.
integer estimation ()
fromiCalendar (line 1278)

Creates a task from a Horde_iCalendar_vtodo object.

void fromiCalendar (Horde_iCalendar_vtodo $vTodo)
  • Horde_iCalendar_vtodo $vTodo: The iCalendar data to update from.
get (line 793)

Returns a sub task by its id.

The methods goes recursively through all sub tasks until it finds the searched task.

  • return: The searched task or null.
Nag_Task &get (string $key)
  • string $key: A task id.
getFormattedDescription (line 880)

Format the description - link URLs, etc.

string getFormattedDescription ()
getParent (line 738)

Returns the parent task of this task, if one exists.

  • return: The parent task, null if none exists, PEAR_Error on failure.
Nag_Task getParent ()
hasSubTasks (line 822)

Returns whether this task contains any sub tasks.

  • return: True if this task has sub tasks.
boolean hasSubTasks ()
hasTasks (line 809)

Returns whether this is a task (not a container) or contains any sub tasks.

  • return: True if this is a task or has sub tasks.
boolean hasTasks ()
loadChildren (line 761)

Loads all sub-tasks.

void loadChildren ()
merge (line 695)

Merges a task hash into this task object.

void merge (array $task)
  • array $task: A task hash.
mergeChildren (line 776)

Merges an array of tasks into this task's children.

void mergeChildren (array $children)
  • array $children: A list of Nag_Tasks.
process (line 940)

Processes a list of tasks by adding action links, obscuring details of private tasks and calculating indentation.

void process ([integer $indent = 0])
  • integer $indent: The indention level of the tasks.
reset (line 895)

Resets the tasks iterator.

Call this each time before looping through the tasks.

void reset ()
save (line 712)

Saves this task in the storage backend.

void save ()
sort (line 1029)

Sorts sub tasks by the given criteria.

void sort (string $sortby, integer $sortdir, string $altsortby)
  • string $sortby: The field by which to sort (NAG_SORT_PRIORITY, NAG_SORT_NAME NAG_SORT_DUE, NAG_SORT_COMPLETION).
  • integer $sortdir: The direction by which to sort (NAG_SORT_ASCEND, NAG_SORT_DESCEND).
  • string $altsortby: The secondary sort field.
toAlarm (line 1113)

Returns an alarm hash of this task suitable for Horde_Alarm.

  • return: Alarm hash or null.
array toAlarm ([string $user = null], [Prefs $prefs = null])
  • string $user: The user to return alarms for.
  • Prefs $prefs: A Prefs instance.
toHash (line 1084)

Returns a hash representation for this task.

  • return: A task hash.
array toHash ()
toiCalendar (line 1179)

Exports this task in iCalendar format.

  • return: A vtodo component of this task.
Horde_iCalendar_vtodo toiCalendar ( &$calendar, Horde_iCalendar $calendar)
  • Horde_iCalendar $calendar: A Horde_iCalendar object that acts as the container.
  • &$calendar
treeIcons (line 994)

Returns the HTML code for any tree icons, when displaying this task in a tree view.

  • return: The HTML code for necessary tree icons.
string treeIcons ()

Documentation generated on Sun, 30 Jan 2011 05:35:02 +0000 by phpDocumentor 1.4.3