\Whups_Driver

Base class for Whups' storage backend.

Copyright 2001-2002 Robert E. Coyle robertecoyle@hotmail.com Copyright 2001-2017 Horde LLC (http://www.horde.org/)

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

Summary

Methods
Properties
Constants
__construct()
setAttributes()
getHistory()
getQueue()
getQueues()
getVersionInfo()
getVersions()
getVersion()
getCategories()
getAttributesForType()
getAllTicketAttributesWithNames()
deleteQueue()
deleteReply()
filterTicketsByState()
mail()
formatComments()
No public properties found
No constants found
_serializeAttribute()
_json_decode()
$_params
N/A
No private methods found
No private properties found
N/A

Properties

$_params

$_params : array

Type

array

Methods

__construct()

__construct(array  $params) : \Whups_Driver_Base

Constructor

Parameters

array $params

Parameter array.

Returns

\Whups_Driver_Base

setAttributes()

setAttributes(array  $info, \Whups_Ticket  $ticket) 

Set ticket attributes

Parameters

array $info

Attributes to set

\Whups_Ticket $ticket

The ticket which attributes to set.

getHistory()

getHistory(integer  $ticket_id, \Horde_Form  $form = null) : array

Fetch ticket history

Parameters

integer $ticket_id

The ticket to fetch history for.

\Horde_Form $form

Returns

array

getQueue()

getQueue(  $queueId) 

Parameters

$queueId

getQueues()

getQueues() 

getVersionInfo()

getVersionInfo(  $queue) 

Parameters

$queue

getVersions()

getVersions(  $queue,   $all = false) 

Returns a hash of versions suitable for select lists.

Parameters

$queue
$all

getVersion()

getVersion(  $version) 

Parameters

$version

getCategories()

getCategories() 

getAttributesForType()

getAttributesForType(  $type = null) : array

Returns the attributes for a ticket type.

Parameters

$type

Returns

array —

A list of attributes.

getAllTicketAttributesWithNames()

getAllTicketAttributesWithNames(  $ticket_id) : array

Returns the attributes for a specific ticket.

This method will check if external attributes need to be fetched from hooks or whether to use the standard ones defined within Whups.

Parameters

$ticket_id

Returns

array —

List of attributes.

deleteQueue()

deleteQueue(integer  $queueId) 

Deletes a queue.

Should be called by driver subclasses after successful removal from the backend. Takes only care of cleaning up queue permissions.

Parameters

integer $queueId

The id of the queue being deleted.

deleteReply()

deleteReply(integer  $reply) 

Deletes a form reply.

Should be called by driver subclasses after successful removal from the backend. Takes only care of cleaning up reply permissions.

Parameters

integer $reply

The id of the form reply being deleted.

filterTicketsByState()

filterTicketsByState(  $tickets,   $state_category = array()) 

Parameters

$tickets
$state_category

mail()

mail(array  $opts) 

Sends email notifications to a list of recipients.

We do some ugly work in here to make sure that no one gets comments mailed to them that they shouldn't see (because of group permissions).

Parameters

array $opts

Option hash with notification information. Possible values:

  • ticket: (Whups_Ticket) A ticket. If not set, this is assumed to be a reminder message.
  • recipients: (array|string) The list of recipients, with user names as keys and user roles as values.
  • subject: (string) The email subject.
  • view: (Horde_View) The view object for the message text.
  • template: (string) The template file for the message text.
  • from: (string) The email sender.
  • new: (boolean, optional) Whether the passed ticket was just created.

formatComments()

formatComments(array  $comments, integer  $ticket) : string

Converts a changeset array to a plain text comment snippet.

Parameters

array $comments

A changeset list.

integer $ticket

A ticket ID.

Returns

string —

The formatted comment text, if any.

_serializeAttribute()

_serializeAttribute(  $value) : string

Returns a serialized value, if necessary.

Parameters

$value

Returns

string —

The JSON encoded value if not already a string.

_json_decode()

_json_decode(  $value) : mixed

Helper to decode attribute value, which may be a bare scalar value, or a json encoded structure that may contain large numeric strings that should not be taken as integers.

Parameters

$value

Returns

mixed —

The decoded value.