Class Nag

Description

Nag Base Class.

$Horde: nag/lib/Nag.php,v 1.124.2.34 2009/06/19 17:20:13 jan Exp $

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

Located in /lib/Nag.php (line 64)


	
			
Method Summary
 string buildCheckboxWidget (string $name, [integer $checked = 0])
 string buildPriorityWidget (string $name, [integer $selected = -1])
 integer countTasks ()
 string formatAlarm (int $value)
 string formatAssignee (string $assignee, [boolean $link = false])
 string formatCompletion (int $completed)
 string formatDate ([string $unixdate = ''], [boolean $hours = true])
 string formatPriority (int $priority)
 void getDefaultTasklist ([ $permission = PERMS_SHOW])
 void getMenu ([ $returnType = 'object'])
 array getTask (string $tasklist, string $task)
 void getUserName ( $uid)
 mixed hasPermission (string $permission)
 void initialize ()
 array listAlarms (integer $date, [ $tasklists = null])
 array listTasklists ([boolean $owneronly = false], [integer $permission = PERMS_SHOW])
 Nag_Task listTasks ([string $sortby = null], [integer $sortdir = null], [string $altsortby = null], [array $tasklists = null], [integer $completed = null])
 array permissionsFilter (array $in, [integer $permission = PERMS_READ], string $filter)
 void secondsToString ( $seconds)
 void sendNotification (string $action, Nag_Task $task, [Nag_Task $old_task = null])
 void status ()
 integer _rsortByAssignee (array $a, array $b)
 integer _rsortByCategory (array $a, array $b)
 integer _rsortByCompletion (array $a, array $b)
 integer _rsortByDue (array $a, array $b)
 integer _rsortByEstimate (array $a, array $b)
 integer _rsortByName (array $a, array $b)
 integer _rsortByOwner (array $a, array $b)
 integer _rsortByPriority (array $a, array $b)
 integer _sortByAssignee (array $a, array $b)
 integer _sortByCategory (array $a, array $b)
 integer _sortByCompletion (array $a, array $b)
 integer _sortByDue (array $a, array $b)
 integer _sortByEstimate (array $a, array $b)
 integer _sortByName (array $a, array $b)
 integer _sortByOwner (array $a, array $b)
 integer _sortByPriority (array $a, array $b)
Methods
buildCheckboxWidget (line 384)

Builds the HTML for a checkbox widget.

  • return: HTML for a checkbox representing the completion state.
string buildCheckboxWidget (string $name, [integer $checked = 0])
  • string $name: The name of the widget.
  • integer $checked: The default checkbox state.
buildPriorityWidget (line 361)

Builds the HTML for a priority selection widget.

  • return: The HTML <select> widget.
string buildPriorityWidget (string $name, [integer $selected = -1])
  • string $name: The name of the widget.
  • integer $selected: The default selected priority.
countTasks (line 217)

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

  • return: The number of tasks that the user owns.
integer countTasks ()
formatAlarm (line 451)

Returns the string matching the given alarm value.

  • return: The formatted alarm string.
string formatAlarm (int $value)
  • int $value: The alarm value in minutes.
formatAssignee (line 482)

Returns the full name and a compose to message an assignee.

  • return: The formatted assignee name.
string formatAssignee (string $assignee, [boolean $link = false])
  • string $assignee: The assignee's user name.
  • boolean $link: Whether to link to an email compose screen.
formatCompletion (line 424)

Returns the string representation of the given completion status.

  • return: The HTML representation of $completed.
string formatCompletion (int $completed)
  • int $completed: The completion value.
formatDate (line 399)

Formats the given Unix-style date string.

  • return: The formatted due date string.
string formatDate ([string $unixdate = ''], [boolean $hours = true])
  • string $unixdate: The Unix-style date value to format.
  • boolean $hours: Whether to add hours.
formatPriority (line 438)

Returns a colored representation of a priority.

  • return: The HTML representation of $priority.
string formatPriority (int $priority)
  • int $priority: The priority level.
getDefaultTasklist (line 334)

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

void getDefaultTasklist ([ $permission = PERMS_SHOW])
  • $permission
getMenu (line 615)

Build Nag's list of menu items.

void getMenu ([ $returnType = 'object'])
  • $returnType
getTask (line 201)

Returns a single task.

  • return: The task hash.
array getTask (string $tasklist, string $task)
  • string $tasklist: A tasklist.
  • string $task: A task id.
getUserName (line 944)

Returns the real name, if available, of a user.

  • since: Nag 2.2
void getUserName ( $uid)
  • $uid
hasPermission (line 517)

Returns the specified permission for the current user.

  • return: The value of the specified permission.
  • since: Nag 2.1
mixed hasPermission (string $permission)
  • string $permission: A permission, currently only 'max_tasks'.
initialize (line 540)

Initial app setup code.

void initialize ()
listAlarms (line 246)

Returns all the alarms active right on $date.

  • return: The alarms (taskId) active on $date.
array listAlarms (integer $date, [ $tasklists = null])
  • integer $date: The unix epoch time to check for alarms.
  • $tasklists
listTasklists (line 285)

Lists all task lists a user has access to.

  • return: The task lists.
array listTasklists ([boolean $owneronly = false], [integer $permission = PERMS_SHOW])
  • boolean $owneronly: Only return tasklists that this user owns? Defaults to false.
  • integer $permission: The permission to filter tasklists by.
listTasks (line 117)

Retrieves the current user's task list from storage.

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

  • return: A list of the requested tasks.
Nag_Task listTasks ([string $sortby = null], [integer $sortdir = null], [string $altsortby = null], [array $tasklists = null], [integer $completed = null])
  • string $sortby: The field by which to sort (NAG_SORT_*).
  • integer $sortdir: The direction by which to sort (NAG_SORT_ASCEND, NAG_SORT_DESCEND).
  • string $altsortby: The secondary sort field.
  • array $tasklists: An array of tasklist to display or null/empty to display taskslists $GLOBALS['display_tasklists'].
  • integer $completed: Which tasks to retrieve (1 = all tasks,
    1. = incomplete tasks, 2 = complete tasks,
    3 = future tasks, 4 = future and incomplete tasks).
permissionsFilter (line 311)

Filters data based on permissions.

  • return: The filtered data.
array permissionsFilter (array $in, [integer $permission = PERMS_READ], string $filter)
  • array $in: The data we want filtered.
  • string $filter: What type of data we are filtering.
  • integer $permission: The PERMS_* constant we will filter on.
secondsToString (line 66)
void secondsToString ( $seconds)
  • $seconds
sendNotification (line 703)

Sends email notifications that a task has been added, edited, or deleted to users that want such notifications.

void sendNotification (string $action, Nag_Task $task, [Nag_Task $old_task = null])
  • string $action: The event action. One of "add", "edit", or "delete".
  • Nag_Task $task: The changed task.
  • Nag_Task $old_task: The original task if $action is "edit".
status (line 650)
void status ()
_rsortByAssignee (line 1097)

Comparison function for reverse sorting tasks by assignee.

  • return: -1 if task one is greater, 1 if task two is greater;
    1. if they are equal.
integer _rsortByAssignee (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_rsortByCategory (line 1164)

Comparison function for reverse sorting tasks by category.

  • return: -1 if task one is greater, 1 if task two is greater;
    1. if they are equal.
integer _rsortByCategory (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_rsortByCompletion (line 1248)

Comparison function for reverse sorting tasks by completion status.

  • return: -1 if task one is greater, 1 if task two is greater;
    1. if they are equal.
integer _rsortByCompletion (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_rsortByDue (line 1205)

Comparison function for reverse sorting tasks by due date.

  • return: -1 if task one is greater, 1 if task two is greater,
    1. if they are equal.
integer _rsortByDue (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_rsortByEstimate (line 1130)

Comparison function for reverse sorting tasks by name.

  • return: -1 if task one is greater, 1 if task two is greater;
    1. if they are equal.
integer _rsortByEstimate (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_rsortByName (line 1069)

Comparison function for reverse sorting tasks by name.

  • return: -1 if task one is greater, 1 if task two is greater;
    1. if they are equal.
integer _rsortByName (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_rsortByOwner (line 1292)

Comparison function for reverse sorting tasks by owner.

  • return: -1 if task one is greater, 1 if task two is greater;
    1. if they are equal.
integer _rsortByOwner (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_rsortByPriority (line 1038)

Comparison function for reverse sorting tasks by priority.

  • return: -1 if task one is greater, 1 if task two is greater;
    1. if they are equal.
integer _rsortByPriority (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_sortByAssignee (line 1083)

Comparison function for sorting tasks by assignee.

  • return: 1 if task one is greater, -1 if task two is greater;
    1. if they are equal.
integer _sortByAssignee (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_sortByCategory (line 1149)

Comparison function for sorting tasks by category.

  • return: 1 if task one is greater, -1 if task two is greater;
    1. if they are equal.
integer _sortByCategory (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_sortByCompletion (line 1231)

Comparison function for sorting tasks by completion status.

  • return: 1 if task one is greater, -1 if task two is greater;
    1. if they are equal.
integer _sortByCompletion (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_sortByDue (line 1179)

Comparison function for sorting tasks by due date.

  • return: 1 if task one is greater, -1 if task two is greater;
    1. if they are equal.
integer _sortByDue (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_sortByEstimate (line 1111)

Comparison function for sorting tasks by assignee.

  • return: 1 if task one is greater, -1 if task two is greater;
    1. if they are equal.
integer _sortByEstimate (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_sortByName (line 1055)

Comparison function for sorting tasks by name.

  • return: 1 if task one is greater, -1 if task two is greater;
    1. if they are equal.
integer _sortByName (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_sortByOwner (line 1265)

Comparison function for sorting tasks by owner.

  • return: 1 if task one is greater, -1 if task two is greater;
    1. if they are equal.
integer _sortByOwner (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.
_sortByPriority (line 1021)

Comparison function for sorting tasks by priority.

  • return: 1 if task one is greater, -1 if task two is greater;
    1. if they are equal.
integer _sortByPriority (array $a, array $b)
  • array $a: Task one.
  • array $b: Task two.

Documentation generated on Sun, 30 Jan 2011 05:35:03 +0000 by phpDocumentor 1.4.3