Overview

Packages

  • Nag
  • None

Classes

  • Horde_Core_Ui_VarRenderer_Nag
  • Nag
  • Nag_Ajax_Application
  • Nag_Api
  • Nag_Driver
  • Nag_Driver_Kolab
  • Nag_Driver_Sql
  • Nag_Exception
  • Nag_Factory_Tasklists
  • Nag_Form_CreateTaskList
  • Nag_Form_DeleteTaskList
  • Nag_Form_EditTaskList
  • Nag_Form_Renderer_Task
  • Nag_Form_Task
  • Nag_Form_Type_NagAlarm
  • Nag_Form_Type_NagDue
  • Nag_Form_Type_NagMethod
  • Nag_Form_Type_NagStart
  • Nag_Task
  • Nag_Tasklists_Base
  • Nag_Tasklists_Default
  • Nag_Tasklists_Kolab
  • Overview
  • Package
  • Class
  • Tree

Class Nag

Nag Base Class.

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

Package: Nag
Author: Jon Parise jon@horde.org
Author: Chuck Hagenbuch chuck@horde.org
Author: Jan Schneider jan@horde.org
Located at Nag.php
Methods summary
public static string
# secondsToString( integer $seconds )

Parameters

$seconds

Returns

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

Nag_Task
A list of the requested tasks.
public static array
# getTask( string $tasklist, string $task )

Returns a single 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.

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

Horde_Exception_PermissionDenied
Nag_Exception
public static
# deleteTasklist( Horde_Share_Object $tasklist )

Deletes a task list.

Deletes a task list.

Parameters

$tasklist
The task list to delete.

Throws

Nag_Exception
Horde_Exception_PermissionDenied
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
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
# initialize( )

Initial app setup code.

Initial app setup code.

public static
# menu( )
public static
# status( )

Trigger notifications.

Trigger notifications.

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

Nag_Exception
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
Constants summary
string SORT_NAME

Sort by task name.

Sort by task name.

# 'name'
string SORT_PRIORITY

Sort by priority.

Sort by priority.

# 'priority'
string SORT_DUE

Sort by due date.

Sort by due date.

# 'due'
string SORT_START

Sort by start date.

Sort by start date.

# 'start'
string SORT_COMPLETION

Sort by completion.

Sort by completion.

# 'completed'
string SORT_CATEGORY

Sort by category.

Sort by category.

# 'category'
string SORT_OWNER

Sort by owner.

Sort by owner.

# 'tasklist'
string SORT_ESTIMATE

Sort by estimate.

Sort by estimate.

# 'estimate'
string SORT_ASSIGNEE

Sort by assignee.

Sort by assignee.

# 'assignee'
integer SORT_ASCEND

Sort in ascending order.

Sort in ascending order.

# 0
integer SORT_DESCEND

Sort in descending order.

Sort in descending order.

# 1
integer VIEW_INCOMPLETE

Incomplete tasks

Incomplete tasks

# 0
integer VIEW_ALL

All tasks

All tasks

# 1
integer VIEW_COMPLETE

Complete tasks

Complete tasks

# 2
integer VIEW_FUTURE

Future tasks

Future tasks

# 3
integer VIEW_FUTURE_INCOMPLETE

Future and incompleted tasks

Future and incompleted tasks

# 4
API documentation generated by ApiGen