PHP 클래스 Nag_Api, horde

This file defines Nag's external API interface. Other applications can interact with Nag through this API.
상속: extends Horde_Registry_Api
파일 보기 프로젝트 열기: horde/horde

보호된 프로퍼티들

프로퍼티 타입 설명
$_links array Links.

공개 메소드들

메소드 설명
addTask ( array $task ) Adds a task.
addTasklist ( string $name, string $description = '', string $color = '', array $params = [] ) : string Adds a new task list.
ajaxDefaults ( ) : array Returns a number of defaults necessary for the ajax view.
browse ( string $path = '', array $properties = [] ) : array Browse through Nag's object tree.
delete ( string | array $uid ) : boolean Deletes a task identified by UID.
deleteTask ( string $tasklist, string $id ) Deletes a task identified by tasklist and ID.
deleteTasklist ( string $id ) Deletes a task list.
export ( string $uid, string $contentType, array $options = [] ) : string Exports a task, identified by UID, in the requested content type.
exportTasklist ( string $tasklist, string $contentType ) : string Exports a tasklist in the requested content type.
getActionTimestamp ( string $uid, string $action, string $tasklist = null, boolean $modSeq = false ) : integer Returns the timestamp of an operation for a given uid an action.
getChanges ( integer $start, integer $end, boolean $isModSeq = false, string $tasklist = null ) : array Method for obtaining all server changes between two timestamps. Basically a wrapper around listBy(), but returns an array containing all adds, edits and deletions.
getChangesByModSeq ( integer $start, integer $end, string $tasklist = null ) : array Return all changes occuring between the specified modification sequences.
getDefaultShare ( ) : string Retrieve the UID for the current user's default tasklist.
getDisplayedTasklists ( ) : array Returns the displayed task lists.
getHighestModSeq ( string $id = null ) : integer Return the largest modification sequence from the history backend.
getTask ( string $tasklist, string $id ) : Nag_Task Returns a task object.
getTasklist ( string $name ) : Horde_Share_Object Returns a task list.
import ( string $content, string $contentType, string $tasklist = null ) : string Imports one or more tasks represented in the specified content type.
listBy ( string $action, integer $timestamp, string $tasklist = null, integer $end = null, boolean $isModSeq = false ) : array Returns an array of UIDs for tasks that have had $action happen since $timestamp.
listCostObjects ( array $criteria ) CostObject API: Lists active tasks as cost objects.
listTagInfo ( array $tags = null, $user = null ) : array Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.
listTasklists ( boolean $owneronly = false, integer $permission = Horde_Perms::SHOW, boolean $smart = true ) : array Returns a list of task lists.
listTasks ( array $options = [] ) : array Retrieves the current user's task list from storage.
listTimeObjectCategories ( )
listTimeObjects ( array $categories, mixed $start, mixed $end ) Lists active tasks as time objects.
listUids ( mixed $tasklists = null ) : array Returns an array of UIDs for all tasks that the current user is authorized to see.
modified ( string $uid, string $tasklist = null ) : integer Returns the last modification timestamp of a given uid.
path_delete ( string $path ) : string Deletes a file from the Nag tree.
put ( string $path, string $content, string $content_type ) : array Saves a file into the Nag tree.
quickAdd ( string $text, string $tasklist = null ) : array Imports one or more tasks parsed from a string.
replace ( string $uid, string $content, string $contentType ) : boolean Replaces the task identified by UID with the content represented in the specified content type.
saveTimeObject ( array $timeobject ) Saves properties of a time object back to the task that it represents.
searchTags ( array $names, integer $max = 10, integer $from, string $resource_type = '', string $user = null, boolean $raw = false ) : array SearchTags API: Returns an application-agnostic array (useful for when doing a tag search across multiple applications)
setDisplayedTasklists ( array $list ) Sets the displayed task lists.
sources ( boolean $writeable = false, boolean $sync_only = false ) : array Returns a list of available sources.
toggleCompletion ( string $task_id, string $tasklist_id ) : boolean | string Toggles the task completion flag.
updateAttendee ( Horde_Icalendar_Vtodo $response, string $sender = null ) Updates an attendee's response status for a specified task assignment.
updateCostObject ( string $id, array $data ) CostObject API: Update a single costobject.
updateTask ( string $tasklist, string $id, array $task ) Changes a task identified by tasklist and ID.
updateTasklist ( string $name, array $info ) Updates an existing task list.

메소드 상세

addTask() 공개 메소드

Adds a task.
public addTask ( array $task )
$task array A hash with task information.

addTasklist() 공개 메소드

Adds a new task list.
public addTasklist ( string $name, string $description = '', string $color = '', array $params = [] ) : string
$name string Task list name.
$description string Task list description.
$color string Task list color.
$params array Any addtional parameters needed. @since 4.2.1 - synchronize: (boolean) If true, add task list to the list of task lists to syncronize. DEFAULT: false (do not add to the list).
리턴 string The new tasklist's id.

ajaxDefaults() 공개 메소드

Returns a number of defaults necessary for the ajax view.
public ajaxDefaults ( ) : array
리턴 array A hash with default values.

browse() 공개 메소드

Browse through Nag's object tree.
public browse ( string $path = '', array $properties = [] ) : array
$path string The level of the tree to browse.
$properties array The item properties to return. Defaults to 'name', 'icon', and 'browseable'.
리턴 array The contents of $path

delete() 공개 메소드

Deletes a task identified by UID.
public delete ( string | array $uid ) : boolean
$uid string | array Identify the task to delete, either a single UID or an array.
리턴 boolean Success or failure.

deleteTask() 공개 메소드

Deletes a task identified by tasklist and ID.
public deleteTask ( string $tasklist, string $id )
$tasklist string A tasklist id.
$id string A task id.

deleteTasklist() 공개 메소드

Deletes a task list.
public deleteTasklist ( string $id )
$id string A task list id.

export() 공개 메소드

Exports a task, identified by UID, in the requested content type.
public export ( string $uid, string $contentType, array $options = [] ) : string
$uid string Identify the task to export.
$contentType string What format should the data be in? A string with one of: - text/calendar: iCalendar 2.0. Recommended as this is specified in RFC 2445. - text/x-vcalendar: vCalendar 1.0 format. Still in wide use. - activesync: Horde_ActiveSync_Message_Task. - raw: Nag_Task.
$options array Any additional options for the exporter.
리턴 string The requested data.

exportTasklist() 공개 메소드

Exports a tasklist in the requested content type.
public exportTasklist ( string $tasklist, string $contentType ) : string
$tasklist string The tasklist to export.
$contentType string What format should the data be in? A string with one of:
text/calendar (VCALENDAR 2.0. Recommended as
               this is specified in rfc2445)
text/x-vcalendar (old VCALENDAR 1.0 format.
                 Still in wide use)
리턴 string The iCalendar representation of the tasklist.

getActionTimestamp() 공개 메소드

Returns the timestamp of an operation for a given uid an action.
public getActionTimestamp ( string $uid, string $action, string $tasklist = null, boolean $modSeq = false ) : integer
$uid string The uid to look for.
$action string The action to check for - add, modify, or delete.
$tasklist string The tasklist to be used. If 'null', the user's default tasklist will be used.
$modSeq boolean Request a modification sequence instead of a timestamp. @since 4.1.1
리턴 integer The timestamp for this action.

getChanges() 공개 메소드

Method for obtaining all server changes between two timestamps. Basically a wrapper around listBy(), but returns an array containing all adds, edits and deletions.
public getChanges ( integer $start, integer $end, boolean $isModSeq = false, string $tasklist = null ) : array
$start integer The starting timestamp
$end integer The ending timestamp.
$isModSeq boolean If true, $timestamp and $end are modification sequences and not timestamps. @since 4.1.1
$tasklist string The sources to check. @since 4.2.0
리턴 array An hash with 'add', 'modify' and 'delete' arrays.

getChangesByModSeq() 공개 메소드

Return all changes occuring between the specified modification sequences.
부터: 4.1.1
public getChangesByModSeq ( integer $start, integer $end, string $tasklist = null ) : array
$start integer The starting modseq.
$end integer The ending modseq.
$tasklist string The sources to check. @since 4.2.0
리턴 array The changes @see getChanges()

getDefaultShare() 공개 메소드

Retrieve the UID for the current user's default tasklist.
부터: 4.2.0
public getDefaultShare ( ) : string
리턴 string UID.

getDisplayedTasklists() 공개 메소드

Returns the displayed task lists.
public getDisplayedTasklists ( ) : array
리턴 array Displayed tasklists.

getHighestModSeq() 공개 메소드

Return the largest modification sequence from the history backend.
부터: 4.1.1
public getHighestModSeq ( string $id = null ) : integer
$id string Limit the check to this tasklist. @since 4.2.0
리턴 integer The modseq.

getTask() 공개 메소드

Returns a task object.
public getTask ( string $tasklist, string $id ) : Nag_Task
$tasklist string A tasklist id.
$id string A task id.
리턴 Nag_Task The matching task object.

getTasklist() 공개 메소드

Returns a task list.
public getTasklist ( string $name ) : Horde_Share_Object
$name string A task list name.
리턴 Horde_Share_Object The task list.

import() 공개 메소드

If a UID is present in the content and the task is already in the database, a replace is performed rather than an add.
public import ( string $content, string $contentType, string $tasklist = null ) : string
$content string The content of the task.
$contentType string What format is the data in? Currently supports: text/calendar text/x-vcalendar
$tasklist string The tasklist into which the task will be imported. If 'null', the user's default tasklist will be used.
리턴 string The new UID on one import, an array of UIDs on multiple imports,

listBy() 공개 메소드

Returns an array of UIDs for tasks that have had $action happen since $timestamp.
public listBy ( string $action, integer $timestamp, string $tasklist = null, integer $end = null, boolean $isModSeq = false ) : array
$action string The action to check for - add, modify, or delete.
$timestamp integer The time to start the search.
$tasklist string The tasklist to be used. If 'null', the user's default tasklist will be used.
$end integer The optional ending timestamp.
$isModSeq boolean If true, $timestamp and $end are modification sequences and not timestamps. @since 4.1.1
리턴 array An array of UIDs matching the action and time criteria.

listCostObjects() 공개 메소드

CostObject API: Lists active tasks as cost objects.
public listCostObjects ( array $criteria )
$criteria array Filter attributes

listTagInfo() 공개 메소드

Retrieve the list of used tag_names, tag_ids and the total number of resources that are linked to that tag.
public listTagInfo ( array $tags = null, $user = null ) : array
$tags array An optional array of tag_ids. If omitted, all tags will be included.
리턴 array An array containing tag_name, and total

listTasklists() 공개 메소드

Returns a list of task lists.
public listTasklists ( boolean $owneronly = false, integer $permission = Horde_Perms::SHOW, boolean $smart = true ) : array
$owneronly boolean Only return tasklists that this user owns? Defaults to false.
$permission integer The permission to filter tasklists by.
$smart boolean Include smart tasklists in results.
리턴 array The task lists.

listTasks() 공개 메소드

This function will also sort the resulting list, if requested.
public listTasks ( array $options = [] ) : array
$options array Options array: - altsortby: (string) The secondary sort field. Same values as sortdir. DEFAULT: altsortby pref is used. - completed: (integer) Which task to retrieve. DEFAULT: show_completed pref is used. - sortby: (string) A Nag::SORT_* constant for the field to sort by. DEFAULT: sortby pref is used. - sortdir: (string) Direction of sort. NAG::SORT_ASCEND or NAG::SORT_DESCEND. DEFAULT: sortdir pref is used. - include_tags: (boolean) Autoload all tags. DEFAULT: false (Tags are lazy loaded as needed.) - json: (boolean) Return data as JSON. DEFAULT: false (Data is returned as Nag_Task) - tasklists: (array) An array of tasklists to include. DEFAULT: Use $GLOBALS['display_tasklists'];
리턴 array An array of the requested tasks.

listTimeObjectCategories() 공개 메소드

listTimeObjects() 공개 메소드

Lists active tasks as time objects.
public listTimeObjects ( array $categories, mixed $start, mixed $end )
$categories array The time categories (from listTimeObjectCategories) to list.
$start mixed The start date of the period.
$end mixed The end date of the period.

listUids() 공개 메소드

Returns an array of UIDs for all tasks that the current user is authorized to see.
public listUids ( mixed $tasklists = null ) : array
$tasklists mixed The tasklist or an array of taskslists to list.
리턴 array An array of UIDs for all tasks the user can access.

modified() 공개 메소드

Returns the last modification timestamp of a given uid.
public modified ( string $uid, string $tasklist = null ) : integer
$uid string The uid to look for.
$tasklist string The tasklist to look in.
리턴 integer The timestamp for the last modification of $uid.

path_delete() 공개 메소드

Deletes a file from the Nag tree.
public path_delete ( string $path ) : string
$path string The path to the file.
리턴 string The event's UID

put() 공개 메소드

Saves a file into the Nag tree.
public put ( string $path, string $content, string $content_type ) : array
$path string The path where to PUT the file.
$content string The file content.
$content_type string The file's content type.
리턴 array The event UIDs

quickAdd() 공개 메소드

Imports one or more tasks parsed from a string.
public quickAdd ( string $text, string $tasklist = null ) : array
$text string The text to parse into
$tasklist string The tasklist into which the task will be imported. If 'null', the user's default tasklist will be used.
리턴 array The UIDs of all tasks that were added.

replace() 공개 메소드

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.
public replace ( string $uid, string $content, string $contentType ) : boolean
$uid string Identify the task to replace.
$content string The content of the task.
$contentType string What format is the data in? Currently supports: - text/x-vcalendar - text/calendar
리턴 boolean Success or failure.

saveTimeObject() 공개 메소드

At the moment only the title, description and due date are saved.
public saveTimeObject ( array $timeobject )
$timeobject array A time object hash.

searchTags() 공개 메소드

The 'raw' results array can be returned instead by setting $raw = true.
public searchTags ( array $names, integer $max = 10, integer $from, string $resource_type = '', string $user = null, boolean $raw = false ) : array
$names array An array of tag_names to search for.
$max integer The maximum number of resources to return.
$from integer The number of the resource to start with.
$resource_type string The resource type [bookmark, '']
$user string Restrict results to resources owned by $user.
$raw boolean Return the raw data?
리턴 array An array of results:
 'title'    - The title for this resource.
 'desc'     - A terse description of this resource.
 'view_url' - The URL to view this resource.
 'app'      - The Horde application this resource belongs to.
 'icon'     - URL to an image.

setDisplayedTasklists() 공개 메소드

Sets the displayed task lists.
public setDisplayedTasklists ( array $list )
$list array Displayed tasklists.

sources() 공개 메소드

Returns a list of available sources.
부터: 4.2.0
public sources ( boolean $writeable = false, boolean $sync_only = false ) : array
$writeable boolean If true, limits to writeable sources.
$sync_only boolean Only include synchable address books.
리턴 array An array of the available sources. Keys are source IDs, values are source titles.

toggleCompletion() 공개 메소드

Toggles the task completion flag.
public toggleCompletion ( string $task_id, string $tasklist_id ) : boolean | string
$task_id string The task ID.
$tasklist_id string The tasklist that contains the task.
리턴 boolean | string True if the task has been toggled, a due date if there are still incomplete recurrences, otherwise false.

updateAttendee() 공개 메소드

Updates an attendee's response status for a specified task assignment.
public updateAttendee ( Horde_Icalendar_Vtodo $response, string $sender = null )
$response Horde_Icalendar_Vtodo A Horde_Icalendar_Vtodo object, with a valid UID attribute that points to an existing task. This is typically the vTodo portion of an iTip task-request response, with the attendee's response in an ATTENDEE parameter.
$sender string The email address of the person initiating the update. Attendees are only updated if this address matches.

updateCostObject() 공개 메소드

CostObject API: Update a single costobject.
public updateCostObject ( string $id, array $data )
$id string The task id.
$data array The data to update. Currently support: -: hours The amount of hours to add to the existing actual hours.

updateTask() 공개 메소드

Changes a task identified by tasklist and ID.
public updateTask ( string $tasklist, string $id, array $task )
$tasklist string A tasklist id.
$id string A task id.
$task array A hash with overwriting task information.

updateTasklist() 공개 정적인 메소드

Updates an existing task list.
public static updateTasklist ( string $name, array $info )
$name string A task list name.
$info array Hash with task list information.

프로퍼티 상세