PHP Class Whups_Driver, horde

Copyright 2001-2002 Robert E. Coyle Copyright 2001-2016 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.
Author: Robert E. Coyle ([email protected])
Author: Jan Schneider ([email protected])
ファイルを表示 Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_params array

Public Methods

Method Description
__construct ( array $params ) : Whups_Driver_Base Constructor
deleteQueue ( integer $queueId ) Deletes a queue.
deleteReply ( integer $reply ) Deletes a form reply.
filterTicketsByState ( $tickets, $state_category = [] )
formatComments ( array $comments, integer $ticket ) : string Converts a changeset array to a plain text comment snippet.
getAllTicketAttributesWithNames ( $ticket_id ) : array Returns the attributes for a specific ticket.
getAttributesForType ( $type = null ) : array Returns the attributes for a ticket type.
getCategories ( )
getHistory ( integer $ticket_id, Horde_Form $form = null ) : array Fetch ticket history
getQueue ( $queueId )
getQueues ( )
getVersion ( $version )
getVersionInfo ( $queue )
getVersions ( $queue, $all = false ) Returns a hash of versions suitable for select lists.
mail ( array $opts ) Sends email notifications to a list of recipients.
setAttributes ( array $info, Whups_Ticket &$ticket ) Set ticket attributes

Protected Methods

Method Description
_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.
_serializeAttribute ( $value ) : string Returns a serialized value, if necessary.

Method Details

__construct() public method

Constructor
public __construct ( array $params ) : Whups_Driver_Base
$params array Parameter array.
return Whups_Driver_Base

_json_decode() protected method

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.
protected _json_decode ( $value ) : mixed
return mixed The decoded value.

_serializeAttribute() protected method

Returns a serialized value, if necessary.
protected _serializeAttribute ( $value ) : string
return string The JSON encoded value if not already a string.

deleteQueue() public method

Should be called by driver subclasses after successful removal from the backend. Takes only care of cleaning up queue permissions.
public deleteQueue ( integer $queueId )
$queueId integer The id of the queue being deleted.

deleteReply() public method

Should be called by driver subclasses after successful removal from the backend. Takes only care of cleaning up reply permissions.
public deleteReply ( integer $reply )
$reply integer The id of the form reply being deleted.

filterTicketsByState() public method

public filterTicketsByState ( $tickets, $state_category = [] )

formatComments() public method

Converts a changeset array to a plain text comment snippet.
public formatComments ( array $comments, integer $ticket ) : string
$comments array A changeset list.
$ticket integer A ticket ID.
return string The formatted comment text, if any.

getAllTicketAttributesWithNames() public method

This method will check if external attributes need to be fetched from hooks or whether to use the standard ones defined within Whups.
public getAllTicketAttributesWithNames ( $ticket_id ) : array
return array List of attributes.

getAttributesForType() public method

Returns the attributes for a ticket type.
public getAttributesForType ( $type = null ) : array
return array A list of attributes.

getCategories() public method

public getCategories ( )

getHistory() public method

Fetch ticket history
public getHistory ( integer $ticket_id, Horde_Form $form = null ) : array
$ticket_id integer The ticket to fetch history for.
$form Horde_Form
return array

getQueue() public method

public getQueue ( $queueId )

getQueues() public method

public getQueues ( )

getVersion() public method

public getVersion ( $version )

getVersionInfo() public method

public getVersionInfo ( $queue )

getVersions() public method

Returns a hash of versions suitable for select lists.
public getVersions ( $queue, $all = false )

mail() public method

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).
public mail ( array $opts )
$opts array 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.

setAttributes() public method

Set ticket attributes
public setAttributes ( array $info, Whups_Ticket &$ticket )
$info array Attributes to set
$ticket Whups_Ticket The ticket which attributes to set.

Property Details

$_params protected_oe property

protected array $_params
return array