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])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$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.

보호된 프로퍼티들

프로퍼티 타입 설명
$_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