Documentation

Nag_Driver_Kolab extends Nag_Driver
in package

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.

Tags
author

Gunnar Wrobel wrobel@pardus.de

author

Thomas Jarosch thomas.jarosch@intra2net.com

author

Stuart Binge omicron@mighty.co.za

Table of Contents

$tasks  : Nag_Task
A Nag_Task instance holding the current task list.
$_data  : Horde_Kolab_Storage_Data
The current tasklist.
$_errormsg  : string
An error message to throw when something is wrong.
$_kolab  : Horde_Kolab_Storage
The Kolab_Storage backend.
$_params  : array<string|int, mixed>
Hash containing connection parameters.
$_tasklist  : string
String containing the current tasklist.
__construct()  : Nag_Driver
Constructs a new Kolab storage object.
_isBase64EncodedUid()  : bool
Detect if a string is already Horde_Url::uriB64Encode()'ed or not.
add()  : array<string|int, mixed>
Adds a task and handles notification.
delete()  : mixed
Deletes a task and handles notification.
deleteAll()  : mixed
Deletes all tasks for the current task list.
get()  : Nag_Task
Retrieves one task from the backend.
getByUID()  : Nag_Task
Retrieves one task from the database by UID.
getChildren()  : array<string|int, mixed>
Retrieves sub-tasks from the database.
listAlarms()  : array<string|int, mixed>
Lists all alarms near $date.
modify()  : mixed
Modifies an existing task and handles notification.
open()  : mixed
Sets the currently open tasklist.
retrieve()  : mixed
Retrieves tasks from the Kolab server.
synchronize()  : mixed
Synchronize with the Kolab backend.
_add()  : string
Adds a task to the backend storage.
_addTags()  : mixed
Helper function to add tags from a newly created event to the tagger.
_buildTask()  : array<string|int, mixed>
Build a task based a data array
_delete()  : mixed
Deletes a task from the backend.
_deleteAll()  : array<string|int, mixed>
Deletes all tasks from the backend.
_getData()  : Horde_Kolab_Storage_Data
Return the Kolab data handler for the current tasklist.
_getDataForTasklist()  : Horde_Kolab_Storage_Date
Return the Kolab data handler for the specified tasklist.
_getObject()  : array<string|int, mixed>
Retrieve the Kolab object representations for the task.
_modify()  : mixed
Modifies an existing task.
_move()  : mixed
Moves a task to a different tasklist.
_updateTags()  : mixed
Helper function to update an existing event's tags to tagger storage.

Properties

$tasks

A Nag_Task instance holding the current task list.

public Nag_Task $tasks

$_data

The current tasklist.

protected Horde_Kolab_Storage_Data $_data

$_errormsg

An error message to throw when something is wrong.

protected string $_errormsg

$_kolab

The Kolab_Storage backend.

protected Horde_Kolab_Storage $_kolab

$_params

Hash containing connection parameters.

protected array<string|int, mixed> $_params = array()

$_tasklist

String containing the current tasklist.

protected string $_tasklist = ''

Methods

__construct()

Constructs a new Kolab storage object.

public __construct(string $tasklist[, array<string|int, mixed> $params = array() ]) : Nag_Driver
Parameters
$tasklist : string

The tasklist to load.

$params : array<string|int, mixed> = array()

A hash containing connection parameters.

Return values
Nag_Driver

_isBase64EncodedUid()

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

public _isBase64EncodedUid(string $s) : bool
Parameters
$s : string

The string to test.

Tags
todo

This will be removed in Horde 6.

Return values
bool

True if $s was base64 encoded.

add()

Adds a task and handles notification.

public add(array<string|int, mixed> $task) : array<string|int, mixed>
Parameters
$task : array<string|int, mixed>

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.
Return values
array<string|int, mixed>

array(ID,UID) of new task

delete()

Deletes a task and handles notification.

public delete(string $taskId) : mixed
Parameters
$taskId : string

The task to delete.

Return values
mixed

deleteAll()

Deletes all tasks for the current task list.

public deleteAll() : mixed
Tags
throws
Nag_Exception
Return values
mixed

get()

Retrieves one task from the backend.

public get(string $taskId) : Nag_Task
Parameters
$taskId : string

The id of the task to retrieve.

Tags
throws
Horde_Exception_NotFound
throws
Nag_Exception
Return values
Nag_Task

A Nag_Task object.

getByUID()

Retrieves one task from the database by UID.

public getByUID(string $uid[, array<string|int, mixed> $tasklists = null ][, bool $getall = true ]) : Nag_Task
Parameters
$uid : string

The UID of the task to retrieve.

$tasklists : array<string|int, mixed> = null

An optional array of tasklists to search.

$getall : bool = true

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

Tags
throws
Horde_Exception_NotFound
throws
Nag_Exception
Return values
Nag_Task

A Nag_Task object.

getChildren()

Retrieves sub-tasks from the database.

public getChildren(string $parentId[, bool $include_history = true ]) : array<string|int, mixed>
Parameters
$parentId : string

The parent id for the sub-tasks to retrieve.

$include_history : bool = true

Include created/modified info? Not currently honored.

Tags
throws
Nag_Exception
Return values
array<string|int, mixed>

List of sub-tasks.

listAlarms()

Lists all alarms near $date.

public listAlarms(int $date) : array<string|int, mixed>
Parameters
$date : int

The unix epoch time to check for alarms.

Return values
array<string|int, mixed>

An array of Nag_Task objects that have alarms that match.

modify()

Modifies an existing task and handles notification.

public modify(string $taskId, array<string|int, mixed> $properties) : mixed
Parameters
$taskId : string

The task to modify.

$properties : array<string|int, mixed>

A hash with properties. @see add().

Tags
throws
Nag_Exception
Return values
mixed

open()

Sets the currently open tasklist.

public open(string $tasklist) : mixed
Parameters
$tasklist : string

The tasklist.

Return values
mixed

retrieve()

Retrieves tasks from the Kolab server.

public retrieve([int $completed = Nag::VIEW_ALL ]) : mixed
Parameters
$completed : int = Nag::VIEW_ALL

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

Return values
mixed

synchronize()

Synchronize with the Kolab backend.

public synchronize([mixed $token = false ]) : mixed
Parameters
$token : mixed = false

A value indicating the last synchronization point, if available.

Return values
mixed

_add()

Adds a task to the backend storage.

protected _add(array<string|int, mixed> $task) : string
Parameters
$task : array<string|int, mixed>

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.
Tags
throws
Nag_Exception
Return values
string

The Nag ID of the new task.

_addTags()

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

protected _addTags(array<string|int, mixed> $task) : mixed
Parameters
$task : array<string|int, mixed>

The task to save tags to storage for.

Return values
mixed

_buildTask()

Build a task based a data array

protected _buildTask(array<string|int, mixed> $task) : array<string|int, mixed>
Parameters
$task : array<string|int, mixed>

The data for the task

Tags
todo

Use 'organizer' but migrate old format.

Return values
array<string|int, mixed>

The converted data array representing the task

_delete()

Deletes a task from the backend.

protected _delete(string $taskId) : mixed
Parameters
$taskId : string

The task to delete.

Return values
mixed

_deleteAll()

Deletes all tasks from the backend.

protected _deleteAll() : array<string|int, mixed>
Return values
array<string|int, mixed>

An array of ids that have been deleted.

_getData()

Return the Kolab data handler for the current tasklist.

protected _getData([bool $force = false ]) : Horde_Kolab_Storage_Data
Parameters
$force : bool = false

Force returning a new handler

Return values
Horde_Kolab_Storage_Data

The data handler.

_getDataForTasklist()

Return the Kolab data handler for the specified tasklist.

protected _getDataForTasklist(string $tasklist) : Horde_Kolab_Storage_Date
Parameters
$tasklist : string

The tasklist name.

Return values
Horde_Kolab_Storage_Date

The data handler.

_getObject()

Retrieve the Kolab object representations for the task.

protected _getObject(array<string|int, mixed> $task) : array<string|int, mixed>
Parameters
$task : array<string|int, mixed>

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.
Tags
todo

Use 'organizer' but migrate old format.

Return values
array<string|int, mixed>

The Kolab object.

_modify()

Modifies an existing task.

protected _modify(string $taskId, array<string|int, mixed> $task) : mixed
Parameters
$taskId : string

The task to modify.

$task : array<string|int, mixed>
Return values
mixed

_move()

Moves a task to a different tasklist.

protected _move(string $taskId, string $newTasklist) : mixed
Parameters
$taskId : string

The task to move.

$newTasklist : string

The new tasklist.

Return values
mixed

_updateTags()

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

protected _updateTags(array<string|int, mixed> $task) : mixed
Parameters
$task : array<string|int, mixed>

The task to update

Return values
mixed

Search results