Overview

Packages

  • Nag
  • None

Classes

  • Horde_Core_Ui_VarRenderer_Nag
  • Nag
  • Nag_Ajax_Application
  • Nag_Api
  • Nag_Driver
  • Nag_Driver_Kolab
  • Nag_Driver_Sql
  • Nag_Exception
  • Nag_Factory_Tasklists
  • Nag_Form_CreateTaskList
  • Nag_Form_DeleteTaskList
  • Nag_Form_EditTaskList
  • Nag_Form_Renderer_Task
  • Nag_Form_Task
  • Nag_Form_Type_NagAlarm
  • Nag_Form_Type_NagDue
  • Nag_Form_Type_NagMethod
  • Nag_Form_Type_NagStart
  • Nag_Task
  • Nag_Tasklists_Base
  • Nag_Tasklists_Default
  • Nag_Tasklists_Kolab
  • Overview
  • Package
  • Class
  • Tree

Class Nag_Task

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.

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.

Package: Nag
Author: Jan Schneider jan@horde.org
Located at Task.php
Methods summary
public
# __construct( array $task = null )

Constructor.

Constructor.

Takes a hash and returns a nice wrapper around it.

Parameters

$task
A task hash.
public
# merge( array $task )

Merges a task hash into this task object.

Merges a task hash into this task object.

Parameters

$task
A task hash.
public
# save( )

Saves this task in the storage backend.

Saves this task in the storage backend.

public mixed
# getParent( )

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

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

Returns

mixed
The parent task, null if none exists
public
# add( Nag_Task $task )

Adds a sub task to this task.

Adds a sub task to this task.

Parameters

$task
A sub task.
public
# loadChildren( )

Loads all sub-tasks.

Loads all sub-tasks.

public
# mergeChildren( array $children )

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

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

Parameters

$children
A list of Nag_Tasks.
public Nag_Task
# get( string $key )

Returns a sub task by its id.

Returns a sub task by its id.

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

Parameters

$key
A task id.

Returns

Nag_Task
The searched task or null.
public boolean
# hasTasks( )

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

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

Returns

boolean
True if this is a task or has sub tasks.
public boolean
# hasSubTasks( )

Returns whether this task contains any sub tasks.

Returns whether this task contains any sub tasks.

Returns

boolean
True if this task has sub tasks.
public boolean
# childrenCompleted( )

Returns whether all sub tasks are completed.

Returns whether all sub tasks are completed.

Returns

boolean
True if all sub tasks are completed.
public integer
# count( )

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

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

Returns

integer
The number of tasks and sub tasks.
public integer
# estimation( )

Returns the estimated length for this and any sub tasks.

Returns the estimated length for this and any sub tasks.

Returns

integer
The estimated length sum.
public string
# getFormattedDescription( )

Format the description - link URLs, etc.

Format the description - link URLs, etc.

Returns

string
public
# reset( )

Resets the tasks iterator.

Resets the tasks iterator.

Call this each time before looping through the tasks.

See

Nag_Task::each()
public
# each( )

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

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

Call reset() each time before looping through the tasks: $tasks->reset(); while ($task = $tasks->each() { ... }

See

Nag_Task::reset()
public
# process( integer $indent = 0 )

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

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

Parameters

$indent
The indention level of the tasks.
public string
# treeIcons( )

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

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

Returns

string
The HTML code for necessary tree icons.
public
# sort( string $sortby, integer $sortdir, string $altsortby )

Sorts sub tasks by the given criteria.

Sorts sub tasks by the given criteria.

Parameters

$sortby
<p>The field by which to sort (Nag::SORT_PRIORITY, Nag::SORT_NAME Nag::SORT_DUE, Nag::SORT_COMPLETION).</p>
$sortdir
<p>The direction by which to sort (Nag::SORT_ASCEND, Nag::SORT_DESCEND).</p>
$altsortby
The secondary sort field.
public array
# toHash( )

Returns a hash representation for this task.

Returns a hash representation for this task.

Returns

array
A task hash.
public object
# toJson( boolean $full = false, string $time_format = 'H:i' )

Returns a simple object suitable for json transport representing this task.

Returns a simple object suitable for json transport representing this task.

Parameters

$full
Whether to return all event details.
$time_format
The date() format to use for time formatting.

Returns

object
A simple object.
public array
# toAlarm( string $user = null, Prefs $prefs = null )

Returns an alarm hash of this task suitable for Horde_Alarm.

Returns an alarm hash of this task suitable for Horde_Alarm.

Parameters

$user
The user to return alarms for.
$prefs
A Prefs instance.

Returns

array
Alarm hash or null.
public Horde_Icalendar_Vtodo
# toiCalendar( Horde_Icalendar $calendar )

Exports this task in iCalendar format.

Exports this task in iCalendar format.

Parameters

$calendar
<p>A Horde_Icalendar object that acts as the container.</p>

Returns

Horde_Icalendar_Vtodo
A vtodo component of this task.
public Horde_ActiveSync_Message_Task
# toASTask( )

Create an AS message from this task

Create an AS message from this task

Returns

Horde_ActiveSync_Message_Task
public
# fromiCalendar( Horde_Icalendar_Vtodo $vTodo )

Creates a task from a Horde_Icalendar_Vtodo object.

Creates a task from a Horde_Icalendar_Vtodo object.

Parameters

$vTodo
The iCalendar data to update from.
public
# fromASTask( Horde_ActiveSync_Message_Task $message )

Create a nag Task object from an activesync message

Create a nag Task object from an activesync message

Parameters

$message
The task object
public string
# getCssStyle( )

CSS formatting.

CSS formatting.

Returns

string
CSS formatting.
Properties summary
public string $id

The task id.

The task id.

#
public string $tasklist

This task's tasklist id.

This task's tasklist id.

#
public string $uid

The task uid.

The task uid.

#
public string $owner

The task owner.

The task owner.

#
public string $assignee

The task assignee.

The task assignee.

#
public string $name

The task title.

The task title.

#
public string $desc

The task decription.

The task decription.

#
public integer $start

The start date timestamp.

The start date timestamp.

#
public integer $due

The due date timestamp.

The due date timestamp.

#
public integer $priority

The task priority.

The task priority.

#
public float $estimate

The estimated task length.

The estimated task length.

#
public boolean $completed

Whether the task is completed.

Whether the task is completed.

#
public integer $completed_date

The completion date timestamp.

The completion date timestamp.

#
public string $category

The task category

The task category

#
public integer $alarm

The task alarm threshold.

The task alarm threshold.

#
public array $methods

The particular alarm methods overridden for this task.

The particular alarm methods overridden for this task.

#
public boolean $private

Whether the task is private.

Whether the task is private.

#
public string $view_link

URL to view the task.

URL to view the task.

#
public string $complete_link

URL to complete the task.

URL to complete the task.

#
public string $edit_link

URL to edit the task.

URL to edit the task.

#
public string $delete_link

URL to delete the task.

URL to delete the task.

#
public string $parent_id

The parent task's id.

The parent task's id.

# ''
public Nag_Task $parent

The parent task.

The parent task.

#
public array $children

The sub-tasks.

The sub-tasks.

# array()
public integer $indent

This task's idention (child) level.

This task's idention (child) level.

# 0
public boolean $lastChild

Whether this is the last sub-task.

Whether this is the last sub-task.

#
API documentation generated by ApiGen