Constants

RESPONSE_NONE

RESPONSE_NONE

Status codes

RESPONSE_ACCEPTED

RESPONSE_ACCEPTED

RESPONSE_DECLINED

RESPONSE_DECLINED

ITIP_REQUEST

ITIP_REQUEST

iTip requests

ITIP_CANCEL

ITIP_CANCEL

ITIP_UPDATE

ITIP_UPDATE

RANGE_THISANDFUTURE

RANGE_THISANDFUTURE

SORT_NAME

SORT_NAME

Sort by task name.

SORT_PRIORITY

SORT_PRIORITY

Sort by priority.

SORT_DUE

SORT_DUE

Sort by due date.

SORT_START

SORT_START

Sort by start date.

SORT_COMPLETION

SORT_COMPLETION

Sort by completion.

SORT_OWNER

SORT_OWNER

Sort by owner.

SORT_ESTIMATE

SORT_ESTIMATE

Sort by estimate.

SORT_ASSIGNEE

SORT_ASSIGNEE

Sort by assignee.

SORT_ASCEND

SORT_ASCEND

Sort in ascending order.

SORT_DESCEND

SORT_DESCEND

Sort in descending order.

VIEW_INCOMPLETE

VIEW_INCOMPLETE

Incomplete tasks

VIEW_ALL

VIEW_ALL

All tasks

VIEW_COMPLETE

VIEW_COMPLETE

Complete tasks

VIEW_FUTURE

VIEW_FUTURE

Future tasks

VIEW_FUTURE_INCOMPLETE

VIEW_FUTURE_INCOMPLETE

Future and incompleted tasks

DAV_WEBDAV

DAV_WEBDAV

WebDAV task list.

DAV_CALDAV

DAV_CALDAV

CalDAV task list.

DAV_ACCOUNT

DAV_ACCOUNT

CalDAV principal.

Methods

secondsToString()

secondsToString(integer  $seconds) : string

Parameters

integer $seconds

Returns

string

parseDate()

parseDate(string  $date, boolean  $withtime = true) : \Horde_Date

Parses a complete date-time string into a Horde_Date object.

Parameters

string $date

The date-time string to parse.

boolean $withtime

Whether time is included in the string.

Throws

\Horde_Date_Exception

Returns

\Horde_Date —

The parsed date.

listTasks()

listTasks(\arary  $options = array()) : \Nag_Task

Retrieves the current user's task list from storage.

This function will also sort the resulting list, if requested.

Parameters

\arary $options

Options array:

  • altsortby: (string) The secondary sort field. Same values as sortdir. DEFAULT: altsortby pref is used.
  • completed: (integer) Which task to retrieve. A Nag::VIEW_* constant. DEFAULT: show_completed pref is used.
  • external: (boolean) Whether to include tasks from other applications too. DEFAULT: true.
  • include_history: (boolean) Autoload created/modified data from Horde_History. DEFAULT: true (Automatically load history data).
  • include_tags: (boolean) Autoload all tags. DEFAULT: false (Tags are lazy loaded as needed.)
  • sortby: (string) A Nag::SORT_* constant for the field to sort by. DEFAULT: sortby pref is used.
  • sortdir: (string) Direction of sort. NAG::SORT_ASCEND or NAG::SORT_DESCEND. DEFAULT: sortdir pref is used.
  • tasklists: (array) An array of tasklists to include. DEFAULT: Use $GLOBALS['display_tasklists'];

Returns

\Nag_Task

A list of the requested tasks.

getTask()

getTask(string  $tasklist, string  $task) : \Nag_Task

Returns a single task.

Parameters

string $tasklist

A tasklist.

string $task

A task id.

Returns

\Nag_Task

The task hash.

countTasks()

countTasks() : integer

Returns the number of taks in task lists that the current user owns.

Returns

integer —

The number of tasks that the user owns.

createTasksFromText()

createTasksFromText(string  $text, string  $tasklist = null) : array

Imports one or more tasks parsed from a string.

Parameters

string $text

The text to parse into

string $tasklist

The tasklist into which the task will be imported. If 'null', the user's default tasklist will be used.

Returns

array —

The UIDs of all tasks that were added.

listAlarms()

listAlarms(integer  $date, array  $tasklists = null) : array

Returns all the alarms active right on $date.

Parameters

integer $date

The unix epoch time to check for alarms.

array $tasklists

An array of tasklists

Returns

array —

An array of Nag_Task objects with alarms active on $date.

listTasklists()

listTasklists(boolean  $owneronly = false, integer  $permission = \Horde_Perms::SHOW, boolean  $smart = true) : array

Lists all task lists a user has access to.

Parameters

boolean $owneronly

Only return task lists that this user owns? Defaults to false.

integer $permission

The permission to filter task lists by.

boolean $smart

Include SmartLists in the results.

Returns

array —

The task lists.

hasPermission()

hasPermission(string  $tasklist, integer  $perm) : boolean

Returns whether the current user has certain permissions on a tasklist.

Parameters

string $tasklist

A tasklist id.

integer $perm

A Horde_Perms permission mask.

Returns

boolean —

True if the current user has the requested permissions.

getDefaultTasklist()

getDefaultTasklist(integer  $permission = \Horde_Perms::SHOW) : string

Returns the default tasklist for the current user at the specified permissions level.

Parameters

integer $permission

Horde_Perms constant for permission level required.

Returns

string —

The default tasklist or null if none.

addTasklist()

addTasklist(array  $info, boolean  $display = true) : \Horde_Share

Creates a new share.

Parameters

array $info

Hash with tasklist information.

boolean $display

Add the new tasklist to display_tasklists

Returns

\Horde_Share —

The new share.

updateTasklist()

updateTasklist(\Horde_Share_Object  $tasklist, array  $info) 

Updates an existing share.

Parameters

\Horde_Share_Object $tasklist

The share to update.

array $info

Hash with task list information.

Throws

\Horde_Exception_PermissionDenied
\Nag_Exception

deleteTasklist()

deleteTasklist(\Horde_Share_Object  $tasklist) 

Deletes a task list.

Parameters

\Horde_Share_Object $tasklist

The task list to delete.

Throws

\Nag_Exception
\Horde_Exception_PermissionDenied

getLabel()

getLabel(  $tasklist) : string

Returns the label to be used for a task list.

Attaches the owner name of shared task lists if necessary.

Parameters

$tasklist

Returns

string —

The task list's label.

getUrl()

getUrl(integer  $type,   $tasklist) : string

Returns a DAV URL to be used for a task list.

Parameters

integer $type

A Nag::DAV_* constant.

$tasklist

Throws

\Horde_Exception

Returns

string —

The task list's URL.

randomColor()

randomColor() : string

Returns a random CSS color.

Returns

string —

A random CSS color string.

buildPriorityWidget()

buildPriorityWidget(string  $name, integer  $selected = -1) : string

Builds the HTML for a priority selection widget.

Parameters

string $name

The name of the widget.

integer $selected

The default selected priority.

Returns

string —

The HTML