Documentation

Nag
in package

Nag Base Class.

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

Tags
author

Jon Parise jon@horde.org

author

Chuck Hagenbuch chuck@horde.org

author

Jan Schneider jan@horde.org

Table of Contents

DAV_ACCOUNT  = 3
CalDAV principal.
DAV_CALDAV  = 2
CalDAV task list.
DAV_WEBDAV  = 1
WebDAV task list.
ITIP_CANCEL  = 2
ITIP_REQUEST  = 1
iTip requests
ITIP_UPDATE  = 3
RANGE_THISANDFUTURE  = 'THISANDFUTURE'
RESPONSE_ACCEPTED  = 2
RESPONSE_DECLINED  = 3
RESPONSE_NONE  = 1
Status codes
SORT_ASCEND  = 0
Sort in ascending order.
SORT_ASSIGNEE  = 'assignee'
Sort by assignee.
SORT_COMPLETION  = 'completed'
Sort by completion.
SORT_DESCEND  = 1
Sort in descending order.
SORT_DUE  = 'due'
Sort by due date.
SORT_ESTIMATE  = 'estimate'
Sort by estimate.
SORT_NAME  = 'name'
Sort by task name.
SORT_OWNER  = 'tasklist'
Sort by owner.
SORT_PRIORITY  = 'priority'
Sort by priority.
SORT_START  = 'start'
Sort by start date.
VIEW_ALL  = 1
All tasks
VIEW_COMPLETE  = 2
Complete tasks
VIEW_FUTURE  = 3
Future tasks
VIEW_FUTURE_INCOMPLETE  = 4
Future and incompleted tasks
VIEW_INCOMPLETE  = 0
Incomplete tasks
_rsortByAssignee()  : int
Comparison function for reverse sorting tasks by assignee.
_rsortByCompletion()  : int
Comparison function for reverse sorting tasks by completion status.
_rsortByDue()  : int
Comparison function for reverse sorting tasks by due date.
_rsortByEstimate()  : int
Comparison function for reverse sorting tasks by name.
_rsortByName()  : int
Comparison function for reverse sorting tasks by name.
_rsortByOwner()  : int
Comparison function for reverse sorting tasks by owner.
_rsortByPriority()  : int
Comparison function for reverse sorting tasks by priority.
_rsortByStart()  : int
Comparison function for reverse sorting tasks by start date.
_sortByAssignee()  : int
Comparison function for sorting tasks by assignee.
_sortByCompletion()  : int
Comparison function for sorting tasks by completion status.
_sortByDue()  : int
Comparison function for sorting tasks by due date.
_sortByEstimate()  : int
Comparison function for sorting tasks by assignee.
_sortByName()  : int
Comparison function for sorting tasks by name.
_sortByOwner()  : int
Comparison function for sorting tasks by owner.
_sortByPriority()  : int
Comparison function for sorting tasks by priority.
_sortByStart()  : int
Comparison function for sorting tasks by start date.
addTasklist()  : Horde_Share
Creates a new share.
buildCheckboxWidget()  : string
Builds the HTML for a checkbox widget.
buildMimeMessage()  : Horde_Mime_Part
Builds the body MIME part of a multipart message.
buildPriorityWidget()  : string
Builds the HTML for a priority selection widget.
countTasks()  : int
Returns the number of taks in task lists that the current user owns.
createTasksFromText()  : array<string|int, mixed>
Imports one or more tasks parsed from a string.
deleteTasklist()  : mixed
Deletes a task list.
formatAlarm()  : string
Returns the string matching the given alarm value.
formatAssignee()  : string
Returns the full name and a compose to message an assignee.
formatCompletion()  : string
Returns the string representation of the given completion status.
formatDate()  : string
Formats the given Unix-style date string.
formatOrganizer()  : string
Returns formatted string representing a task organizer.
formatPriority()  : string
Returns a colored representation of a priority.
getDefaultTasklist()  : string
Returns the default tasklist for the current user at the specified permissions level.
getImagePart()  : Horde_Mime_Part
Returns a MIME part for an image to be embedded into a HTML document.
getLabel()  : string
Returns the label to be used for a task list.
getSyncLists()  : array<string|int, mixed>
Returns the tasklists that should be used for syncing.
getTask()  : Nag_Task
Returns a single task.
getUrl()  : string
Returns a DAV URL to be used for a task list.
getUserEmail()  : mixed
getUserName()  : string
Returns the real name, if available, of a user.
hasPermission()  : bool
Returns whether the current user has certain permissions on a tasklist.
initialize()  : mixed
Initial app setup code.
listAlarms()  : array<string|int, mixed>
Returns all the alarms active right on $date.
listTasklists()  : array<string|int, mixed>
Lists all task lists a user has access to.
listTasks()  : Nag_Task
Retrieves the current user's task list from storage.
parseDate()  : Horde_Date
Parses a complete date-time string into a Horde_Date object.
randomColor()  : string
Returns a random CSS color.
responseFromICal()  : string
Maps an iCalendar attendee response string to the corresponding Nag value.
secondsToString()  : string
sendITipNotifications()  : mixed
Sends out iTip task notification to the assignee.
sendNotification()  : mixed
Sends email notifications that a task has been added, edited, or deleted to users that want such notifications.
status()  : mixed
Trigger notifications.
updateTasklist()  : mixed
Updates an existing share.
_getOwner()  : string
Returns the owner of a task.
_notificationPref()  : bool
Returns whether a user wants email notifications for a tasklist.

Constants

DAV_ACCOUNT

CalDAV principal.

public mixed DAV_ACCOUNT = 3

DAV_CALDAV

CalDAV task list.

public mixed DAV_CALDAV = 2

DAV_WEBDAV

WebDAV task list.

public mixed DAV_WEBDAV = 1

ITIP_CANCEL

public mixed ITIP_CANCEL = 2

ITIP_REQUEST

iTip requests

public mixed ITIP_REQUEST = 1

ITIP_UPDATE

public mixed ITIP_UPDATE = 3

RANGE_THISANDFUTURE

public mixed RANGE_THISANDFUTURE = 'THISANDFUTURE'

RESPONSE_ACCEPTED

public mixed RESPONSE_ACCEPTED = 2

RESPONSE_DECLINED

public mixed RESPONSE_DECLINED = 3

RESPONSE_NONE

Status codes

public mixed RESPONSE_NONE = 1

SORT_ASCEND

Sort in ascending order.

public mixed SORT_ASCEND = 0

SORT_ASSIGNEE

Sort by assignee.

public mixed SORT_ASSIGNEE = 'assignee'

SORT_COMPLETION

Sort by completion.

public mixed SORT_COMPLETION = 'completed'

SORT_DESCEND

Sort in descending order.

public mixed SORT_DESCEND = 1

SORT_DUE

Sort by due date.

public mixed SORT_DUE = 'due'

SORT_ESTIMATE

Sort by estimate.

public mixed SORT_ESTIMATE = 'estimate'

SORT_NAME

Sort by task name.

public mixed SORT_NAME = 'name'

SORT_OWNER

Sort by owner.

public mixed SORT_OWNER = 'tasklist'

SORT_PRIORITY

Sort by priority.

public mixed SORT_PRIORITY = 'priority'

SORT_START

Sort by start date.

public mixed SORT_START = 'start'

VIEW_ALL

All tasks

public mixed VIEW_ALL = 1

VIEW_COMPLETE

Complete tasks

public mixed VIEW_COMPLETE = 2

VIEW_FUTURE

Future tasks

public mixed VIEW_FUTURE = 3

VIEW_FUTURE_INCOMPLETE

Future and incompleted tasks

public mixed VIEW_FUTURE_INCOMPLETE = 4

VIEW_INCOMPLETE

Incomplete tasks

public mixed VIEW_INCOMPLETE = 0

Methods

_rsortByAssignee()

Comparison function for reverse sorting tasks by assignee.

public static _rsortByAssignee(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

-1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByCompletion()

Comparison function for reverse sorting tasks by completion status.

public static _rsortByCompletion(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

-1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByDue()

Comparison function for reverse sorting tasks by due date.

public static _rsortByDue(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

-1 if task one is greater, 1 if task two is greater, 0 if they are equal.

_rsortByEstimate()

Comparison function for reverse sorting tasks by name.

public static _rsortByEstimate(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

-1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByName()

Comparison function for reverse sorting tasks by name.

public static _rsortByName(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

-1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByOwner()

Comparison function for reverse sorting tasks by owner.

public static _rsortByOwner(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

-1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByPriority()

Comparison function for reverse sorting tasks by priority.

public static _rsortByPriority(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

-1 if task one is greater, 1 if task two is greater; 0 if they are equal.

_rsortByStart()

Comparison function for reverse sorting tasks by start date.

public static _rsortByStart(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

-1 if task one is greater, 1 if task two is greater, 0 if they are equal.

_sortByAssignee()

Comparison function for sorting tasks by assignee.

public static _sortByAssignee(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByCompletion()

Comparison function for sorting tasks by completion status.

public static _sortByCompletion(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByDue()

Comparison function for sorting tasks by due date.

public static _sortByDue(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByEstimate()

Comparison function for sorting tasks by assignee.

public static _sortByEstimate(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByName()

Comparison function for sorting tasks by name.

public static _sortByName(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByOwner()

Comparison function for sorting tasks by owner.

public static _sortByOwner(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByPriority()

Comparison function for sorting tasks by priority.

public static _sortByPriority(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

1 if task one is greater, -1 if task two is greater; 0 if they are equal.

_sortByStart()

Comparison function for sorting tasks by start date.

public static _sortByStart(array<string|int, mixed> $a, array<string|int, mixed> $b) : int
Parameters
$a : array<string|int, mixed>

Task one.

$b : array<string|int, mixed>

Task two.

Return values
int

1 if task one is greater, -1 if task two is greater; 0 if they are equal.

addTasklist()

Creates a new share.

public static addTasklist(array<string|int, mixed> $info[, bool $display = true ]) : Horde_Share
Parameters
$info : array<string|int, mixed>

Hash with tasklist information.

$display : bool = true

Add the new tasklist to display_tasklists

Return values
Horde_Share

The new share.

buildCheckboxWidget()

Builds the HTML for a checkbox widget.

public static buildCheckboxWidget(string $name, int $checked) : string
Parameters
$name : string

The name of the widget.

$checked : int

The default checkbox state.

Return values
string

HTML for a checkbox representing the completion state.

buildMimeMessage()

Builds the body MIME part of a multipart message.

public static buildMimeMessage(Horde_View $view, string $template, Horde_Mime_Part $image) : Horde_Mime_Part
Parameters
$view : Horde_View

A view to render the HTML and plain text templates for the messate.

$template : string

The template base name for the view.

$image : Horde_Mime_Part

The MIME part of a related image.

Return values
Horde_Mime_Part

A multipart/alternative MIME part.

buildPriorityWidget()

Builds the HTML for a priority selection widget.

public static buildPriorityWidget(string $name[, int $selected = -1 ]) : string
Parameters
$name : string

The name of the widget.

$selected : int = -1

The default selected priority.

Return values
string

The HTML