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_Api

Nag external API interface.

This file defines Nag's external API interface. Other applications can interact with Nag through this API.

Horde_Registry_Api
Extended by Nag_Api
Package: Nag
Located at Api.php
Methods summary
public array
# ajaxDefaults( )

Returns a number of defaults necessary for the ajax view.

Returns a number of defaults necessary for the ajax view.

Returns

array
A hash with default values.
public Nag_Task
# listTasks( string $sortby = null, integer $sortdir = null, string $altsortby = null, array $tasklists = null, string $completed = null, boolean $json = false )

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
<p>The field by which to sort (NAG_SORT_PRIORITY, NAG_SORT_NAME NAG_SORT_DUE, NAG_SORT_COMPLETION).</p>
$sortdir
The direction by which to sort.
$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 (all, incomplete, complete, future or future_incomplete).</p>
$json
<p>Retrieve the results of the tasks in 'json format'.</p>

Returns

Nag_Task
A list of the requested tasks.
public array
# listTasklists( boolean $owneronly = false, integer $permission = Horde_Perms::SHOW )

Returns a list of task lists.

Returns a list of task lists.

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 Horde_Share_Object
# getTasklist( string $name )

Returns a task list.

Returns a task list.

Parameters

$name
A task list name.

Returns

Horde_Share_Object
The task list.

Since

Nag 3.0.3
public integer
# addTasklist( string $name, string $description = '', string $color = '' )

Adds a new task list.

Adds a new task list.

Parameters

$name
Task list name.
$description
Task list description.
$color
Task list color.

Returns

integer
The new tasklist's id.
public static
# updateTasklist( string $name, array $info )

Updates an existing task list.

Updates an existing task list.

Parameters

$name
A task list name.
$info
Hash with task list information.
public
# deleteTasklist( string $id )

Deletes a task list.

Deletes a task list.

Parameters

$id
A task list id.
public array
# getDisplayedTasklists( )

Returns the displayed task lists.

Returns the displayed task lists.

Returns

array
Displayed tasklists.

Since

Nag 3.0.3
public
# setDisplayedTasklists( array $list )

Sets the displayed task lists.

Sets the displayed task lists.

Parameters

$list
Displayed tasklists.

Since

Nag 3.0.3
public integer
# modified( string $uid, string $tasklist = null )

Returns the last modification timestamp of a given uid.

Returns the last modification timestamp of a given uid.

Parameters

$uid
The uid to look for.
$tasklist
The tasklist to look in.

Returns

integer
The timestamp for the last modification of $uid.
public array
# browse( string $path = '', array $properties = array() )

Browse through Nag's object tree.

Browse through Nag's object tree.

Parameters

$path
The level of the tree to browse.
$properties
<p>The item properties to return. Defaults to 'name', 'icon', and 'browseable'.</p>

Returns

array
The contents of $path
public array
# put( string $path, string $content, string $content_type )

Saves a file into the Nag tree.

Saves a file into the Nag tree.

Parameters

$path
The path where to PUT the file.
$content
The file content.
$content_type
The file's content type.

Returns

array
The event UIDs
public string
# path_delete( string $path )

Deletes a file from the Nag tree.

Deletes a file from the Nag tree.

Parameters

$path
The path to the file.

Returns

string
The event's UID

Throws

Nag_Exception
public array
# listUids( mixed $tasklists = null )

Returns an array of UIDs for all tasks that the current user is authorized to see.

Returns an array of UIDs for all tasks that the current user is authorized to see.

Parameters

$tasklists
The tasklist or an array of taskslists to list.

Returns

array

An array of UIDs for all tasks the user can access.

Throws

Horde_Exception_PermissionDenied
Nag_Exception
public array
# listBy( string $action, integer $timestamp, mixed $tasklist = null, integer $end = null )

Returns an array of UIDs for tasks that have had $action happen since $timestamp.

Returns an array of UIDs for tasks that have had $action happen since $timestamp.

Parameters

$action
The action to check for - add, modify, or delete.
$timestamp
The time to start the search.
$tasklist
<p>$tasklists The tasklists to be used. If 'null', the user's default tasklist will be used.</p>
$end
The optional ending timestamp.

Returns

array
An array of UIDs matching the action and time criteria.

Throws

Horde_History_Exception
InvalidArgumentException
public array
# getChanges( integer $start, integer $end )

Method for obtaining all server changes between two timestamps. Basically a wrapper around listBy(), but returns an array containing all adds, edits and deletions.

Method for obtaining all server changes between two timestamps. Basically a wrapper around listBy(), but returns an array containing all adds, edits and deletions.

Parameters

$start
The starting timestamp
$end
The ending timestamp.

Returns

array
An hash with 'add', 'modify' and 'delete' arrays.
public integer
# getActionTimestamp( string $uid, string $action, string $tasklist = null )

Returns the timestamp of an operation for a given uid an action.

Returns the timestamp of an operation for a given uid an action.

Parameters

$uid
The uid to look for.
$action
The action to check for - add, modify, or delete.
$tasklist
<p>The tasklist to be used. If 'null', the user's default tasklist will be used.</p>

Returns

integer
The timestamp for this action.

Throws

InvalidArgumentException
Horde_Exception_PermissionDenied

Thorws

Horde_History_Exception
public string
# import( string $content, string $contentType, string $tasklist = null )

Imports one or more tasks represented in the specified content type.

Imports one or more tasks represented in the specified content type.

If a UID is present in the content and the task is already in the database, a replace is performed rather than an add.

Parameters

$content
The content of the task.
$contentType
<p>What format is the data in? Currently supports: text/calendar text/x-vcalendar</p>
$tasklist
<p>The tasklist into which the task will be imported. If 'null', the user's default tasklist will be used.</p>

Returns

string
The new UID on one import, an array of UIDs on multiple imports,
public
# addTask( array $task )

Adds a task.

Adds a task.

Parameters

$task
A hash with overwriting task information.

Throws

Horde_Exception_PermissionDenied
public array
# quickAdd( 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.

Throws

Horde_Exception_PermissionDenied
public
# toggleCompletion( string $task_id, string $tasklist_id )

Toggles the task completion flag.

Toggles the task completion flag.

Parameters

$task_id
The task ID.
$tasklist_id
The tasklist that contains the task.
public string
# export( string $uid, string $contentType )

Exports a task, identified by UID, in the requested content type.

Exports a task, identified by UID, in the requested content type.

Parameters

$uid
Identify the task to export.
$contentType
<p>What format should the data be in? A string with one of:</p> <pre>text/calendar - (VCALENDAR <span class="php-num">2.0</span>. Recommended <span class="php-keyword1">as</span> this is specified in rfc2445) text/x-vcalendar - (old VCALENDAR <span class="php-num">1.0</span> format. Still in wide <span class="php-keyword1">use</span>)</pre>

Returns

string
The requested data.
public Nag_Task
# getTask( string $tasklist, string $id )

Returns a task object.

Returns a task object.

Parameters

$tasklist
A tasklist id.
$id
A task id.

Returns

Nag_Task
The matching task object.
public string
# exportTasklist( string $tasklist, string $contentType )

Exports a tasklist in the requested content type.

Exports a tasklist in the requested content type.

Parameters

$tasklist
The tasklist to export.
$contentType
<p>What format should the data be in? A string with one of:</p> <pre>text/calendar (VCALENDAR <span class="php-num">2.0</span>. Recommended <span class="php-keyword1">as</span> this is specified in rfc2445) text/x-vcalendar (old VCALENDAR <span class="php-num">1.0</span> format. Still in wide <span class="php-keyword1">use</span>)</pre>

Returns

string
The iCalendar representation of the tasklist.
public boolean
# delete( string|array $uid )

Deletes a task identified by UID.

Deletes a task identified by UID.

Parameters

$uid
<p>Identify the task to delete, either a single UID or an array.</p>

Returns

boolean
Success or failure.
public
# deleteTask( string $tasklist, string $id )

Deletes a task identified by tasklist and ID.

Deletes a task identified by tasklist and ID.

Parameters

$tasklist
A tasklist id.
$id
A task id.
public boolean
# replace( string $uid, string $content, string $contentType )

Replaces the task identified by UID with the content represented in the specified content type.

Replaces the task identified by UID with the content represented in the specified content type.

If you want to replace multiple tasks with the UID specified in the VCALENDAR data, you may use $this->import instead. This automatically does a replace if existings UIDs are found.

Parameters

$uid
Identify the task to replace.
$content
The content of the task.
$contentType
<p>What format is the data in? Currently supports: - text/x-vcalendar - text/calendar</p>

Returns

boolean
Success or failure.
public
# updateTask( string $tasklist, string $id, array $task )

Changes a task identified by tasklist and ID.

Changes a task identified by tasklist and ID.

Parameters

$tasklist
A tasklist id.
$id
A task id.
$task
A hash with overwriting task information.
public
# listCostObjects( array $criteria )

Lists active tasks as cost objects.

Lists active tasks as cost objects.

Parameters

$criteria
Filter attributes
public
# listTimeObjectCategories( )
public
# listTimeObjects( array $categories, mixed $start, mixed $end )

Lists active tasks as time objects.

Lists active tasks as time objects.

Parameters

$categories
<p>The time categories (from listTimeObjectCategories) to list.</p>
$start
The start date of the period.
$end
The end date of the period.
public
# saveTimeObject( array $timeobject )

Saves properties of a time object back to the task that it represents.

Saves properties of a time object back to the task that it represents.

At the moment only the title, description and due date are saved.

Parameters

$timeobject
A time object hash.

Throws

Nag_Exception
Properties summary
public array $links

Links.

Links.

# array( 'show' => '%application%/view.php?tasklist=|tasklist|&task=|task|&uid=|uid|' )
API documentation generated by ApiGen