PHP Класс Nag_Task, horde

See the enclosed file COPYING for license information (GPL). If you did not receive this file, see http://www.horde.org/licenses/gpl.
Автор: Jan Schneider ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$actual float The actual task length.
$alarm integer The task alarm threshold in minutes.
$assignee string The task assignee.
$children array The sub-tasks.
$complete_link string URL to complete the task.
$completed boolean Whether the task is completed.
$completed_date integer The completion date timestamp.
$created Horde_Date The creation time.
$createdby string The creator string.
$delete_link string URL to delete the task.
$desc string The task decription.
$due integer The due date timestamp.
$edit_link string URL to edit the task.
$estimate float The estimated task length.
$id string The task id.
$indent integer This task's idention (child) level.
$internaltags array Task tags from the storage backend (e.g. Kolab)
$lastChild boolean Whether this is the last sub-task.
$methods array The particular alarm methods overridden for this task.
$modified Horde_Date The last modification time.
$modifiedby string The last-modifier string.
$name string The task title.
$organizer string Task organizer
$owner string The task owner.
$parent Nag_Task The parent task.
$parent_id string The parent task's id.
$priority integer The task priority from 1 = highest to 5 = lowest.
$private boolean Whether the task is private.
$recurrence Horde_Date_Recurrence Recurrence rules for recurring tasks.
$snooze integer Snooze minutes for this event's alarm.
$start integer The start date timestamp.
$status integer The assignment status of this task.
$tasklist string This task's tasklist id.
$tasklist_name string Overrides the $tasklist's share name.
$uid string The task uid.
$view_link string URL to view the task.

Защищенные свойства (Protected)

Свойство Тип Описание
$_dict array Task id => pointer dictionary.
$_inlist boolean Internal flag.
$_pointer integer Internal pointer.
$_storage Nag_Driver A storage driver.
$_tags string Task tags (lazy loaded).

Открытые методы

Метод Описание
__clone ( ) Deep clone so we can clone the child objects too.
__construct ( Nag_Driver $storage = null, array $task = null ) Constructor.
__get ( string $name ) : mixed Getter.
__set ( string $name, mixed $value ) Setter.
actuals ( ) : integer Returns the actual length for this and any sub tasks.
add ( Nag_Task $task, $replace = false ) Adds a sub task to this task.
backgroundColor ( ) : string Returns the background color.
childrenCompleted ( ) : boolean Returns whether all sub tasks are completed.
childrenOverdue ( ) : boolean Returns whether any tasks in the list are overdue.
count ( ) : integer Returns the number of tasks including this and any sub tasks.
each ( ) Returns the next task iterating through all tasks and sub tasks.
estimation ( ) : integer Returns the estimated length for this and any sub tasks.
foregroundColor ( ) : string Returns the foreground color.
fromASTask ( Horde_ActiveSync_Message_Task $message ) Create a nag Task object from an activesync message
fromiCalendar ( Horde_Icalendar_Vtodo $vTodo ) Creates a task from a Horde_Icalendar_Vtodo object.
get ( string $key ) : Nag_Task Returns a sub task by its id.
getFormattedDescription ( ) : string Format the description - link URLs, etc.
getNextDue ( ) : Horde_Date | null Returns the next due date of this task.
getNextStart ( ) : Horde_Date Returns the next start date of this task.
getParent ( ) : mixed Returns the parent task of this task, if one exists.
getSlice ( integer $page, integer $perpage = null ) : Nag_Task Helper method for getting only a slice of the total tasks in this list.
hasSubTasks ( ) : boolean Returns whether this task contains any sub tasks.
hasTask ( string $taskId ) : Nag_Task | false Return the task, if present anywhere in this tasklist, regardless of child depth.
hasTasks ( ) : boolean Returns whether this is a task (not a container) or contains any sub tasks.
loadChildren ( $include_history = true ) Loads all sub-tasks.
loadTags ( ) Recursively loads tags for all tasks contained in this object.
merge ( array $task ) Merges a task hash into this task object.
mergeChildren ( array $children ) Merges an array of tasks into this task's children.
orphan ( ) Disconnect this task from any child tasks. Used when building search result sets since child tasks will be re-added if they actually match the result, and there is no guarentee that a tasks's parent will be present in the result set.
process ( integer $indent = null ) Processes a list of tasks by adding action links, obscuring details of private tasks and calculating indentation.
recurs ( ) : boolean Returns whether this task is a recurring task.
reset ( ) Resets the tasks iterator.
save ( ) Saves this task in the storage backend.
sort ( string $sortby, integer $sortdir, string $altsortby ) Sorts sub tasks by the given criteria.
synchronizeTags ( array $tags ) Syncronizes tags from the tagging backend with the task storage backend, if necessary.
toASTask ( array $options = [] ) : Horde_ActiveSync_Message_Task Create an AS message from this task
toAlarm ( string $user = null, Prefs $prefs = null ) : array Returns an alarm hash of this task suitable for Horde_Alarm.
toHash ( ) : array Returns a hash representation for this task.
toJson ( boolean $full = false, string $time_format = 'H:i' ) : object Returns a simple object suitable for json transport representing this task.
toggleComplete ( $ignore_children = false ) Toggles completion status of this task. Moves a recurring task to the next occurence on completion. Enforces the rule that sub tasks must be completed before parent tasks.
toiCalendar ( Horde_Icalendar $calendar ) : Horde_Icalendar_Vtodo Exports this task in iCalendar format.
treeIcons ( ) : string Returns the HTML code for any tree icons, when displaying this task in a tree view.

Описание методов

__clone() публичный Метод

Deep clone so we can clone the child objects too.
public __clone ( )

__construct() публичный Метод

Takes a hash and returns a nice wrapper around it.
public __construct ( Nag_Driver $storage = null, array $task = null )
$storage Nag_Driver A storage driver.
$task array A task hash.

__get() публичный Метод

Returns 'tags' property.
public __get ( string $name ) : mixed
$name string Property name.
Результат mixed Property value.

__set() публичный Метод

Setter.
public __set ( string $name, mixed $value )
$name string Property name.
$value mixed Property value.

actuals() публичный Метод

Returns the actual length for this and any sub tasks.
public actuals ( ) : integer
Результат integer The actual length sum.

add() публичный Метод

Adds a sub task to this task.
public add ( Nag_Task $task, $replace = false )
$task Nag_Task A sub task.

backgroundColor() публичный Метод

Returns the background color.
public backgroundColor ( ) : string
Результат string A HTML color code.

childrenCompleted() публичный Метод

Returns whether all sub tasks are completed.
public childrenCompleted ( ) : boolean
Результат boolean True if all sub tasks are completed.

childrenOverdue() публичный Метод

Returns whether any tasks in the list are overdue.
public childrenOverdue ( ) : boolean
Результат boolean True if any task or sub tasks are overdue.

count() публичный Метод

Returns the number of tasks including this and any sub tasks.
public count ( ) : integer
Результат integer The number of tasks and sub tasks.

each() публичный Метод

Call reset() each time before looping through the tasks: $tasks->reset(); while ($task = $tasks->each() { ... }
См. также: reset()
public each ( )

estimation() публичный Метод

Returns the estimated length for this and any sub tasks.
public estimation ( ) : integer
Результат integer The estimated length sum.

foregroundColor() публичный Метод

Returns the foreground color.
public foregroundColor ( ) : string
Результат string A HTML color code.

fromASTask() публичный Метод

Create a nag Task object from an activesync message
public fromASTask ( Horde_ActiveSync_Message_Task $message )
$message Horde_ActiveSync_Message_Task The task object

fromiCalendar() публичный Метод

Creates a task from a Horde_Icalendar_Vtodo object.
public fromiCalendar ( Horde_Icalendar_Vtodo $vTodo )
$vTodo Horde_Icalendar_Vtodo The iCalendar data to update from.

get() публичный Метод

The methods goes recursively through all sub tasks until it finds the searched task.
public get ( string $key ) : Nag_Task
$key string A task id.
Результат Nag_Task The searched task or null.

getFormattedDescription() публичный Метод

Format the description - link URLs, etc.
public getFormattedDescription ( ) : string
Результат string

getNextDue() публичный Метод

Takes recurring tasks into account.
public getNextDue ( ) : Horde_Date | null
Результат Horde_Date | null The next due date or null if no due date.

getNextStart() публичный Метод

Takes recurring tasks into account.
public getNextStart ( ) : Horde_Date
Результат Horde_Date The next start date.

getParent() публичный Метод

Returns the parent task of this task, if one exists.
public getParent ( ) : mixed
Результат mixed The parent task, null if none exists

getSlice() публичный Метод

Helper method for getting only a slice of the total tasks in this list.
public getSlice ( integer $page, integer $perpage = null ) : Nag_Task
$page integer The starting page.
$perpage integer The count of tasks per page.
Результат Nag_Task The resulting task list.

hasSubTasks() публичный Метод

Returns whether this task contains any sub tasks.
public hasSubTasks ( ) : boolean
Результат boolean True if this task has sub tasks.

hasTask() публичный Метод

Return the task, if present anywhere in this tasklist, regardless of child depth.
public hasTask ( string $taskId ) : Nag_Task | false
$taskId string The task id we are looking for.
Результат Nag_Task | false The task object, if found. Otherwise false.

hasTasks() публичный Метод

Returns whether this is a task (not a container) or contains any sub tasks.
public hasTasks ( ) : boolean
Результат boolean True if this is a task or has sub tasks.

loadChildren() публичный Метод

Loads all sub-tasks.
public loadChildren ( $include_history = true )

loadTags() публичный Метод

Recursively loads tags for all tasks contained in this object.
public loadTags ( )

merge() публичный Метод

Merges a task hash into this task object.
public merge ( array $task )
$task array A task hash.

mergeChildren() публичный Метод

Merges an array of tasks into this task's children.
public mergeChildren ( array $children )
$children array A list of Nag_Tasks.

orphan() публичный Метод

Disconnect this task from any child tasks. Used when building search result sets since child tasks will be re-added if they actually match the result, and there is no guarentee that a tasks's parent will be present in the result set.
public orphan ( )

process() публичный Метод

Processes a list of tasks by adding action links, obscuring details of private tasks and calculating indentation.
public process ( integer $indent = null )
$indent integer The indention level of the tasks.

recurs() публичный Метод

Returns whether this task is a recurring task.
public recurs ( ) : boolean
Результат boolean True if this is a recurring task.

reset() публичный Метод

Call this each time before looping through the tasks.
См. также: each()
public reset ( )

save() публичный Метод

Saves this task in the storage backend.
public save ( )

sort() публичный Метод

Sorts sub tasks by the given criteria.
public sort ( string $sortby, integer $sortdir, string $altsortby )
$sortby string The field by which to sort (Nag::SORT_PRIORITY, Nag::SORT_NAME Nag::SORT_DUE, Nag::SORT_COMPLETION).
$sortdir integer The direction by which to sort (Nag::SORT_ASCEND, Nag::SORT_DESCEND).
$altsortby string The secondary sort field.

synchronizeTags() публичный Метод

Syncronizes tags from the tagging backend with the task storage backend, if necessary.
public synchronizeTags ( array $tags )
$tags array Tags from the tagging backend.

toASTask() публичный Метод

Create an AS message from this task
public toASTask ( array $options = [] ) : Horde_ActiveSync_Message_Task
$options array Options: - protocolversion: (float) The EAS version to support DEFAULT: 2.5 - bodyprefs: (array) A BODYPREFERENCE array. DEFAULT: none (No body prefs enforced). - truncation: (integer) Truncate event body to this length DEFAULT: none (No truncation).
Результат Horde_ActiveSync_Message_Task

toAlarm() публичный Метод

Returns an alarm hash of this task suitable for Horde_Alarm.
public toAlarm ( string $user = null, Prefs $prefs = null ) : array
$user string The user to return alarms for.
$prefs Prefs A Prefs instance.
Результат array Alarm hash or null.

toHash() публичный Метод

Returns a hash representation for this task.
public toHash ( ) : array
Результат array A task hash.

toJson() публичный Метод

Returns a simple object suitable for json transport representing this task.
public toJson ( boolean $full = false, string $time_format = 'H:i' ) : object
$full boolean Whether to return all task details.
$time_format string The date() format to use for time formatting.
Результат object A simple object.

toggleComplete() публичный Метод

Toggles completion status of this task. Moves a recurring task to the next occurence on completion. Enforces the rule that sub tasks must be completed before parent tasks.
public toggleComplete ( $ignore_children = false )

toiCalendar() публичный Метод

Exports this task in iCalendar format.
public toiCalendar ( Horde_Icalendar $calendar ) : Horde_Icalendar_Vtodo
$calendar Horde_Icalendar A Horde_Icalendar object that acts as the container.
Результат Horde_Icalendar_Vtodo A vtodo component of this task.

treeIcons() публичный Метод

Returns the HTML code for any tree icons, when displaying this task in a tree view.
public treeIcons ( ) : string
Результат string The HTML code for necessary tree icons.

Описание свойств

$_dict защищенное свойство

Task id => pointer dictionary.
protected array $_dict
Результат array

$_inlist защищенное свойство

Internal flag.
См. также: each()
protected bool $_inlist
Результат boolean

$_pointer защищенное свойство

Internal pointer.
См. также: each()
protected int $_pointer
Результат integer

$_storage защищенное свойство

A storage driver.
protected Nag_Driver $_storage
Результат Nag_Driver

$_tags защищенное свойство

Task tags (lazy loaded).
protected string $_tags
Результат string

$actual публичное свойство

The actual task length.
public float $actual
Результат float

$alarm публичное свойство

The task alarm threshold in minutes.
public int $alarm
Результат integer

$assignee публичное свойство

The task assignee.
public string $assignee
Результат string

$children публичное свойство

The sub-tasks.
public array $children
Результат array

$completed публичное свойство

Whether the task is completed.
public bool $completed
Результат boolean

$completed_date публичное свойство

The completion date timestamp.
public int $completed_date
Результат integer

$created публичное свойство

The creation time.
public Horde_Date $created
Результат Horde_Date

$createdby публичное свойство

The creator string.
public string $createdby
Результат string

$desc публичное свойство

The task decription.
public string $desc
Результат string

$due публичное свойство

The due date timestamp.
public int $due
Результат integer

$estimate публичное свойство

The estimated task length.
public float $estimate
Результат float

$id публичное свойство

The task id.
public string $id
Результат string

$indent публичное свойство

This task's idention (child) level.
public int $indent
Результат integer

$internaltags публичное свойство

Task tags from the storage backend (e.g. Kolab)
public array $internaltags
Результат array

$lastChild публичное свойство

Whether this is the last sub-task.
public bool $lastChild
Результат boolean

$methods публичное свойство

The particular alarm methods overridden for this task.
public array $methods
Результат array

$modified публичное свойство

The last modification time.
public Horde_Date $modified
Результат Horde_Date

$modifiedby публичное свойство

The last-modifier string.
public string $modifiedby
Результат string

$name публичное свойство

The task title.
public string $name
Результат string

$organizer публичное свойство

Task organizer
public string $organizer
Результат string

$owner публичное свойство

The task owner.
public string $owner
Результат string

$parent публичное свойство

The parent task.
public Nag_Task $parent
Результат Nag_Task

$parent_id публичное свойство

The parent task's id.
public string $parent_id
Результат string

$priority публичное свойство

The task priority from 1 = highest to 5 = lowest.
public int $priority
Результат integer

$private публичное свойство

Whether the task is private.
public bool $private
Результат boolean

$recurrence публичное свойство

Recurrence rules for recurring tasks.
public Horde_Date_Recurrence $recurrence
Результат Horde_Date_Recurrence

$snooze публичное свойство

Snooze minutes for this event's alarm.
См. также: Horde_Alarm::snooze()
public int $snooze
Результат integer

$start публичное свойство

The start date timestamp.
public int $start
Результат integer

$status публичное свойство

The assignment status of this task.
public int $status
Результат integer

$tasklist публичное свойство

This task's tasklist id.
public string $tasklist
Результат string

$tasklist_name публичное свойство

Overrides the $tasklist's share name.
public string $tasklist_name
Результат string

$uid публичное свойство

The task uid.
public string $uid
Результат string