\Nag_Driver_Kolab

Nag driver classes for the Kolab IMAP server.

Copyright 2004-2017 Horde LLC (http://www.horde.org/)

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

Summary

Methods
Properties
Constants
__construct()
listAlarms()
open()
add()
modify()
delete()
deleteAll()
retrieve()
getChildren()
get()
getByUID()
synchronize()
_isBase64EncodedUid()
$tasks
No constants found
_add()
_modify()
_updateTags()
_addTags()
_getData()
_getDataForTasklist()
_buildTask()
_getObject()
_move()
_delete()
_deleteAll()
$_tasklist
$_params
$_errormsg
$_kolab
$_data
N/A
No private methods found
No private properties found
N/A

Properties

$tasks

$tasks : \Nag_Task

A Nag_Task instance holding the current task list.

Type

\Nag_Task

$_tasklist

$_tasklist : string

String containing the current tasklist.

Type

string

$_params

$_params : array

Hash containing connection parameters.

Type

array

$_errormsg

$_errormsg : string

An error message to throw when something is wrong.

Type

string

$_kolab

$_kolab : \Horde_Kolab_Storage

The Kolab_Storage backend.

Type

\Horde_Kolab_Storage

$_data

$_data : \Horde_Kolab_Storage_Data

The current tasklist.

Type

\Horde_Kolab_Storage_Data

Methods

__construct()

__construct(string  $tasklist, array  $params = array()) : \Nag_Driver

Constructs a new Kolab storage object.

Parameters

string $tasklist

The tasklist to load.

array $params

A hash containing connection parameters.

Returns

\Nag_Driver

listAlarms()

listAlarms(integer  $date) : array

Lists all alarms near $date.

Parameters

integer $date

The unix epoch time to check for alarms.

Returns

array —

An array of Nag_Task objects that have alarms that match.

open()

open(string  $tasklist) 

Sets the currently open tasklist.

Parameters

string $tasklist

The tasklist.

add()

add(array  $task) : array

Adds a task and handles notification.

Parameters

array $task

A hash with the following possible properties:

  • desc: (string) The description (long) of the task.
  • name: (string) The name (short) of the task.
  • actual: (OPTIONAL, float) The actual time spent on the task.
  • alarm: (OPTIONAL, integer) The alarm associated with the task.
  • assignee: (OPTIONAL, string) The assignee of the event.
  • completed: (OPTIONAL, integer) The completion state of the task.
  • completed_date: (OPTIONAL, integer) The task's completion date.
  • due: (OPTIONAL, integer) The due date of the task.
  • estimate: (OPTIONAL, float) The estimated time to complete the task.
  • methods: (OPTIONAL, array) The overridden alarm notification methods.
  • owner: (OPTIONAL, string) The owner of the event.
  • parent: (OPTIONAL, string) The parent task.
  • priority: (OPTIONAL, integer) The priority of the task.
  • private: (OPTIONAL, boolean) Whether the task is private.
  • recurrence: (OPTIONAL, Horde_Date_Recurrence|array) Recurrence information.
  • start: (OPTIONAL, integer) The start date of the task.
  • tags: (OPTIONAL, string) The comma delimited list of tags.
  • uid: (OPTIONAL, string) A Unique Identifier for the task.

Returns

array —

array(ID,UID) of new task

modify()

modify(string  $taskId, array  $properties) 

Modifies an existing task and handles notification.

Parameters

string $taskId

The task to modify.

array $properties

A hash with properties. @see add().

Throws

\Nag_Exception

delete()

delete(string  $taskId) 

Deletes a task and handles notification.

Parameters

string $taskId

The task to delete.

deleteAll()

deleteAll() 

Deletes all tasks for the current task list.

Throws

\Nag_Exception

retrieve()

retrieve(integer  $completed = \Nag::VIEW_ALL) 

Retrieves tasks from the Kolab server.

Parameters

integer $completed

Which tasks to retrieve (1 = all tasks, 0 = incomplete tasks, 2 = complete tasks).

getChildren()

getChildren(string  $parentId, boolean  $include_history = true) : array

Retrieves sub-tasks from the database.

Parameters

string $parentId

The parent id for the sub-tasks to retrieve.

boolean $include_history

Include created/modified info? Not currently honored.

Throws

\Nag_Exception

Returns

array —

List of sub-tasks.

get()

get(string  $taskId) : \Nag_Task

Retrieves one task from the backend.

Parameters

string $taskId

The id of the task to retrieve.

Throws

\Horde_Exception_NotFound
\Nag_Exception

Returns

\Nag_Task

A Nag_Task object.

getByUID()

getByUID(string  $uid, array  $tasklists = null, boolean  $getall = true) : \Nag_Task

Retrieves one task from the database by UID.

Parameters

string $uid

The UID of the task to retrieve.

array $tasklists

An optional array of tasklists to search.

boolean $getall

If true, return all instances of the task, otherwise only one. Attempts to find the instance owned by the current user.

Throws

\Horde_Exception_NotFound
\Nag_Exception

Returns

\Nag_Task

A Nag_Task object.

synchronize()

synchronize(mixed  $token = false) 

Synchronize with the Kolab backend.

Parameters

mixed $token

A value indicating the last synchronization point, if available.

_isBase64EncodedUid()

_isBase64EncodedUid(string  $s) : boolean

Detect if a string is already Horde_Url::uriB64Encode()'ed or not.

Parameters

string $s

The string to test.

Returns

boolean —

True if $s was base64 encoded.

_add()

_add(array  $task) : string

Adds a task to the backend storage.

Parameters

array $task

A hash with the following possible properties:

  • alarm: (integer) The alarm associated with the task.
  • assignee: (string) The assignee of the event.
  • completed: (integer) The completion state of the task.
  • desc: (string) The description (long) of the task.
  • due: (integer) The due date of the task.
  • estimate: (float) The estimated time to complete the task.
  • methods: (array) The overridden alarm notification methods.
  • name: (string) The name (short) of the task.
  • organizer: (string) The organizer/owner of the task.
  • owner: (string) The owner of the event.
  • parent: (string) The parent task.
  • priority: (integer) The priority of the task.
  • private: (boolean) Whether the task is private.
  • recurrence: (Horde_Date_Recurrence|array) Recurrence information.
  • start: (integer) The start date of the task.
  • tags: (array) The task tags.
  • uid: (string) A Unique Identifier for the task.

Throws

\Nag_Exception

Returns

string —

The Nag ID of the new task.

_modify()

_modify(string  $taskId, array  $task) 

Modifies an existing task.

Parameters

string $taskId

The task to modify.

array $task

_updateTags()

_updateTags(array  $task) 

Helper function to update an existing event's tags to tagger storage.

Parameters

array $task

The task to update

_addTags()

_addTags(array  $task) 

Helper function to add tags from a newly created event to the tagger.

Parameters

array $task

The task to save tags to storage for.

_getData()

_getData(boolean  $force = false) : \Horde_Kolab_Storage_Data

Return the Kolab data handler for the current tasklist.

Parameters

boolean $force

Force returning a new handler

Returns

\Horde_Kolab_Storage_Data —

The data handler.

_getDataForTasklist()

_getDataForTasklist(string  $tasklist) : \Horde_Kolab_Storage_Date

Return the Kolab data handler for the specified tasklist.

Parameters

string $tasklist

The tasklist name.

Returns

\Horde_Kolab_Storage_Date —

The data handler.

_buildTask()

_buildTask(array  $task) : array

Build a task based a data array

Parameters

array $task

The data for the task

Returns

array —

The converted data array representing the task

_getObject()

_getObject(array  $task) : array

Retrieve the Kolab object representations for the task.

Parameters

array $task

A hash with the following possible properties:

  • actual: (float) The actual number of hours accumulated.
  • alarm: (integer) The alarm associated with the task.
  • assignee: (string) The assignee of the event.
  • completed: (integer) The completion state of the task.
  • completed_date: (integer) The task's completion date.
  • desc: (string) The description (long) of the task.
  • due: (integer) The due date of the task.
  • estimate: (float) The estimated time to complete the task.
  • methods: (array) The overridden alarm notification methods.
  • name: (string) The name (short) of the task.
  • organizer: (string) The organizer/owner of the task.
  • owner: (string) The owner of the event.
  • parent: (string) The parent task.
  • priority: (integer) The priority of the task.
  • private: (boolean) Whether the task is private.
  • recurrence: (Horde_Date_Recurrence|array) Recurrence information.
  • start: (integer) The start date of the task.
  • tags: (array) The task tags.

Returns

array —

The Kolab object.

_move()

_move(string  $taskId, string  $newTasklist) 

Moves a task to a different tasklist.

Parameters

string $taskId

The task to move.

string $newTasklist

The new tasklist.

_delete()

_delete(string  $taskId) 

Deletes a task from the backend.

Parameters

string $taskId

The task to delete.

_deleteAll()

_deleteAll() : array

Deletes all tasks from the backend.

Returns

array —

An array of ids that have been deleted.