Methods summary
public static
string
public static
Horde_Date
#
parseDate ( string $date , boolean $withtime = true )
Parses a complete date-time string into a Horde_Date object.
Parses a complete date-time string into a Horde_Date object.
Parameters
$date
The date-time string to parse.
$withtime
Whether time is included in the string.
Returns
Horde_Date
The parsed date.
Throws
Horde_Date_Exception
public static
Nag_Task
#
listTasks ( string $sortby = null , integer $sortdir = null , string $altsortby = null , array $tasklists = null , integer $completed = null )
Retrieves the current user's task list from storage.
Retrieves the current user's task list from storage.
This function will also sort the resulting list, if requested.
Parameters
$sortby
The field by which to sort (Nag::SORT_*).
$sortdir
<p>The direction by which to sort
(Nag::SORT_ASCEND, Nag::SORT_DESCEND).</p>
$altsortby
The secondary sort field.
$tasklists
<p>An array of tasklist to display or
null/empty to display taskslists
$GLOBALS['display_tasklists'].</p>
$completed
<p>Which tasks to retrieve (1 = all tasks,
0 = incomplete tasks, 2 = complete tasks,
3 = future tasks, 4 = future and incomplete
tasks).</p>
Returns
public static
array
#
getTask ( string $tasklist , string $task )
Returns a single task.
Parameters
$tasklist
A tasklist.
$task
A task id.
Returns
array
The task hash.
public static
integer
#
countTasks ( )
Returns the number of taks in task lists that the current user owns.
Returns the number of taks in task lists that the current user owns.
Returns
integer
The number of tasks that the user owns.
public static
array
#
createTasksFromText ( string $text , string $tasklist = null )
Imports one or more tasks parsed from a string.
Imports one or more tasks parsed from a string.
Parameters
$text
The text to parse into
$tasklist
<p>The tasklist into which the task will be
imported. If 'null', the user's default
tasklist will be used.</p>
Returns
array
The UIDs of all tasks that were added.
public static
array
#
listAlarms ( integer $date , array $tasklists = null )
Returns all the alarms active right on $date.
Returns all the alarms active right on $date.
Parameters
$date
The unix epoch time to check for alarms.
$tasklists
An array of tasklists
Returns
array
The alarms (taskId) active on $date.
public static
array
#
listTasklists ( boolean $owneronly = false , integer $permission = Horde_Perms::SHOW )
Lists all task lists a user has access to.
Lists all task lists a user has access to.
This method takes the $conf['share']['hidden'] setting into account. If
this setting is enabled, even if requesting permissions different than
SHOW, it will only return calendars that the user owns or has SHOW
permissions for. For checking individual calendar's permissions, use
hasPermission() instead.
Parameters
$owneronly
<p>Only return tasklists that this user owns?
Defaults to false.</p>
$permission
The permission to filter tasklists by.
Returns
array
The task lists.
public static
array
#
permissionsFilter ( array $in , integer $permission = Horde_Perms::READ )
Filters data based on permissions.
Filters data based on permissions.
Parameters
$in
The data we want filtered.
$permission
<p>The Horde_Perms::* constant we will filter
on.</p>
Returns
array
The filtered data.
public static
boolean
#
hasPermission ( string $tasklist , integer $perm )
Returns whether the current user has certain permissions on a tasklist.
Returns whether the current user has certain permissions on a tasklist.
Parameters
$tasklist
A tasklist id.
$perm
A Horde_Perms permission mask.
Returns
boolean
True if the current user has the requested permissions.
Since
Nag 3.0.3
public static
mixed
#
getDefaultTasklist ( integer $permission = Horde_Perms::SHOW )
Returns the default tasklist for the current user at the specified
permissions level.
Returns the default tasklist for the current user at the specified
permissions level.
Parameters
$permission
The permission to require.
Returns
mixed
The default tasklist or false if none.
public static
Horde_Share
#
addTasklist ( array $info )
Creates a new share.
Parameters
$info
Hash with tasklist information.
Returns
Horde_Share
The new share.
public static
#
updateTasklist ( Horde_Share_Object $tasklist , array $info )
Updates an existing share.
Updates an existing share.
Parameters
$tasklist
The share to update.
$info
Hash with task list information.
Throws
public static
#
deleteTasklist ( Horde_Share_Object $tasklist )
Deletes a task list.
Parameters
$tasklist
The task list to delete.
Throws
public static
string
#
buildPriorityWidget ( string $name , integer $selected = -1 )
Builds the HTML for a priority selection widget.
Builds the HTML for a priority selection widget.
Parameters
$name
The name of the widget.
$selected
The default selected priority.
Returns
string
The HTML widget.
public static
string
#
buildCheckboxWidget ( string $name , integer $checked = 0 )
Builds the HTML for a checkbox widget.
Builds the HTML for a checkbox widget.
Parameters
$name
The name of the widget.
$checked
The default checkbox state.
Returns
string
HTML for a checkbox representing the completion state.
public static
string
#
formatDate ( string $unixdate = '' , boolean $hours = true )
Formats the given Unix-style date string.
Formats the given Unix-style date string.
Parameters
$unixdate
The Unix-style date value to format.
$hours
Whether to add hours.
Returns
string
The formatted due date string.
public static
string
#
formatCompletion ( integer $completed )
Returns the string representation of the given completion status.
Returns the string representation of the given completion status.
Parameters
$completed
The completion value.
Returns
string
The HTML representation of $completed.
public static
string
#
formatPriority ( integer $priority )
Returns a colored representation of a priority.
Returns a colored representation of a priority.
Parameters
$priority
The priority level.
Returns
string
The HTML representation of $priority.
public static
string
#
formatAlarm ( integer $value )
Returns the string matching the given alarm value.
Returns the string matching the given alarm value.
Parameters
$value
The alarm value in minutes.
Returns
string
The formatted alarm string.
public static
string
#
formatAssignee ( string $assignee , boolean $link = false )
Returns the full name and a compose to message an assignee.
Returns the full name and a compose to message an assignee.
Parameters
$assignee
The assignee's user name.
$link
Whether to link to an email compose screen.
Returns
string
The formatted assignee name.
public static
public static
public static
#
sendNotification ( string $action , Nag_Task
$task , Nag_Task
$old_task = null )
Sends email notifications that a task has been added, edited, or
deleted to users that want such notifications.
Sends email notifications that a task has been added, edited, or
deleted to users that want such notifications.
Parameters
$action
<p>The event action. One of "add", "edit", or
"delete".</p>
$task
The changed task.
$old_task
The original task if $action is "edit".
Throws
public static
Horde_Mime_Part
#
buildMimeMessage ( Horde_View $view , string $template , Horde_Mime_Part $image )
Builds the body MIME part of a multipart message.
Builds the body MIME part of a multipart message.
Parameters
$view
<p>A view to render the HTML and plain text
templates for the messate.</p>
$template
The template base name for the view.
$image
The MIME part of a related image.
Returns
Horde_Mime_Part
A multipart/alternative MIME part.
public static
Horde_Mime_Part
#
getImagePart ( string $file )
Returns a MIME part for an image to be embedded into a HTML document.
Returns a MIME part for an image to be embedded into a HTML document.
Parameters
$file
An image file name.
Returns
Horde_Mime_Part
A MIME part representing the image.
public static
string
#
getUserName ( string $uid )
Returns the real name, if available, of a user.
Returns the real name, if available, of a user.
Parameters
$uid
The userid of the user to retrieve
Returns
string
The fullname of the user.
public static
boolean
#
_notificationPref ( string $user , string $mode , string $tasklist = null )
Returns whether a user wants email notifications for a tasklist.
Returns whether a user wants email notifications for a tasklist.
Parameters
$user
A user name.
$mode
<p>The check "mode". If "owner", the method checks
if the user wants notifications only for
tasklists he owns. If "read", the method checks
if the user wants notifications for all
tasklists he has read access to, or only for
shown tasklists and the specified tasklist is
currently shown.</p>
$tasklist
The name of the tasklist if mode is "read".
Returns
boolean
True if the user wants notifications for the tasklist.
public static
integer
#
_sortByIdentity ( array $a , array $b )
Comparison function for sorting tasks by create date (not currently used
as it would require accessing Horde_History for each task) and id.
Comparison function for sorting tasks by create date (not currently used
as it would require accessing Horde_History for each task) and id.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
1 if task one is greater, -1 if task two is greater;
0 if they are equal (though no tasks should ever be
equal in this comparison).
public static
integer
#
_sortByPriority ( array $a , array $b )
Comparison function for sorting tasks by priority.
Comparison function for sorting tasks by priority.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
1 if task one is greater, -1 if task two is greater;
0 if they are equal.
public static
integer
#
_rsortByPriority ( array $a , array $b )
Comparison function for reverse sorting tasks by priority.
Comparison function for reverse sorting tasks by priority.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
-1 if task one is greater, 1 if task two is greater;
0 if they are equal.
public static
integer
#
_sortByName ( array $a , array $b )
Comparison function for sorting tasks by name.
Comparison function for sorting tasks by name.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
1 if task one is greater, -1 if task two is greater;
0 if they are equal.
public static
integer
#
_rsortByName ( array $a , array $b )
Comparison function for reverse sorting tasks by name.
Comparison function for reverse sorting tasks by name.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
-1 if task one is greater, 1 if task two is greater;
0 if they are equal.
public static
integer
#
_sortByAssignee ( array $a , array $b )
Comparison function for sorting tasks by assignee.
Comparison function for sorting tasks by assignee.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
1 if task one is greater, -1 if task two is greater;
0 if they are equal.
public static
integer
#
_rsortByAssignee ( array $a , array $b )
Comparison function for reverse sorting tasks by assignee.
Comparison function for reverse sorting tasks by assignee.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
-1 if task one is greater, 1 if task two is greater;
0 if they are equal.
public static
integer
#
_sortByEstimate ( array $a , array $b )
Comparison function for sorting tasks by assignee.
Comparison function for sorting tasks by assignee.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
1 if task one is greater, -1 if task two is greater;
0 if they are equal.
public static
integer
#
_rsortByEstimate ( array $a , array $b )
Comparison function for reverse sorting tasks by name.
Comparison function for reverse sorting tasks by name.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
-1 if task one is greater, 1 if task two is greater;
0 if they are equal.
public static
integer
#
_sortByCategory ( array $a , array $b )
Comparison function for sorting tasks by category.
Comparison function for sorting tasks by category.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
1 if task one is greater, -1 if task two is greater;
0 if they are equal.
public static
integer
#
_rsortByCategory ( array $a , array $b )
Comparison function for reverse sorting tasks by category.
Comparison function for reverse sorting tasks by category.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
-1 if task one is greater, 1 if task two is greater;
0 if they are equal.
public static
integer
#
_sortByDue ( array $a , array $b )
Comparison function for sorting tasks by due date.
Comparison function for sorting tasks by due date.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
1 if task one is greater, -1 if task two is greater;
0 if they are equal.
public static
integer
#
_rsortByDue ( array $a , array $b )
Comparison function for reverse sorting tasks by due date.
Comparison function for reverse sorting tasks by due date.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
-1 if task one is greater, 1 if task two is greater,
0 if they are equal.
public static
integer
#
_sortByStart ( array $a , array $b )
Comparison function for sorting tasks by start date.
Comparison function for sorting tasks by start date.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
1 if task one is greater, -1 if task two is greater;
0 if they are equal.
public static
integer
#
_rsortByStart ( array $a , array $b )
Comparison function for reverse sorting tasks by start date.
Comparison function for reverse sorting tasks by start date.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
-1 if task one is greater, 1 if task two is greater,
0 if they are equal.
public static
integer
#
_sortByCompletion ( array $a , array $b )
Comparison function for sorting tasks by completion status.
Comparison function for sorting tasks by completion status.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
1 if task one is greater, -1 if task two is greater;
0 if they are equal.
public static
integer
#
_rsortByCompletion ( array $a , array $b )
Comparison function for reverse sorting tasks by completion status.
Comparison function for reverse sorting tasks by completion status.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
-1 if task one is greater, 1 if task two is greater;
0 if they are equal.
public static
integer
#
_sortByOwner ( array $a , array $b )
Comparison function for sorting tasks by owner.
Comparison function for sorting tasks by owner.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
1 if task one is greater, -1 if task two is greater;
0 if they are equal.
public static
integer
#
_rsortByOwner ( array $a , array $b )
Comparison function for reverse sorting tasks by owner.
Comparison function for reverse sorting tasks by owner.
Parameters
$a
Task one.
$b
Task two.
Returns
integer
-1 if task one is greater, 1 if task two is greater;
0 if they are equal.
public static
array
#
getSyncLists ( )
Returns the calendars that should be used for syncing.
Returns the calendars that should be used for syncing.
Returns
array
An array of calendar ids