PHP Class Whups_Ticket, horde

Copyright 2004-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: Chuck Hagenbuch ([email protected])
Author: Jan Schneider ([email protected])
Mostra file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_changes array Array of changes to make to the ticket.
$_details array The current values of the ticket.
$_id integer The id of the ticket this object wraps.

Public Methods

Method Description
__construct ( integer $id, array $details ) : Whups_Ticket Constructor.
__toString ( )
addAttachment ( string &$attachment_name, string $attachment_file ) Adds an attachment to this ticket.
addAttributes ( ) : array Adds ticket attribute values to the ticket's details, and returns the list of attributes.
addCommentPerms ( integer $commentId, string $group ) : integer Sets exclusive read permissions on a comment to a certain group.
addMessage ( string $message ) : integer Adds a message to this ticket.
change ( string $detail, string $value ) Tracks that a detail of the ticket should change, but does not actually make the change until commit() is called.
commit ( string $user = null, integer $transaction = null, boolean $notify = true ) Goes through a list of built-up changes and commits them to the backend.
delete ( ) Deletes this ticket.
deleteAttachment ( string $attachment_name ) Removes an attachment from this ticket.
deleteMessage ( integer $message ) Removes a message from this ticket.
feedLink ( ) : array Returns data for this ticket's feed.
get ( string $detail ) : mixed Returns a piece of information from this ticket.
getDetails ( ) : array Returns all ticket information.
getId ( ) : integer Returns the ticket id.
listAllAttachments ( string $filter = null ) : array Returns a list of all files that have been attached to this ticket, whether they still exist or not.
makeTicket ( integer $id ) : Whups_Ticket Returns a ticket object for an id.
newTicket ( array $info, $requester ) : Whups_Ticket Creates a new ticket.
notify ( string $author, boolean $isNew, array $listeners = [] ) Notifies all appropriate people of the creation/update of this ticket.
set ( string $detail, string $value ) Changes a detail of the ticket to a new value.
setDetails ( Horde_Variables $vars, boolean $split_owners = false ) Sets all properties of the ticket necessary to display the TicketDetailsForm.
show ( ) Redirects the browser to this ticket's view.
toString ( ) Returns a plain text representation of a ticket.

Protected Methods

Method Description
_getVfs ( ) : Horde_Vfs_Base Returns a Horde_Vfs instance.

Method Details

__construct() public method

Constructor.
public __construct ( integer $id, array $details ) : Whups_Ticket
$id integer The ticket id.
$details array The hash of ticket information.
return Whups_Ticket

__toString() public method

public __toString ( )

_getVfs() protected method

Returns a Horde_Vfs instance.
protected _getVfs ( ) : Horde_Vfs_Base
return Horde_Vfs_Base A VFS instance.

addAttachment() public method

Adds an attachment to this ticket.
public addAttachment ( string &$attachment_name, string $attachment_file )
$attachment_name string The name of the attachment.
$attachment_file string The temporary file containing the data to be stored.

addAttributes() public method

Adds ticket attribute values to the ticket's details, and returns the list of attributes.
public addAttributes ( ) : array
return array List of ticket attribute hashes.

addCommentPerms() public static method

Sets exclusive read permissions on a comment to a certain group.
public static addCommentPerms ( integer $commentId, string $group ) : integer
$commentId integer The id of the comment to restrict.
$group string The group name to limit access by.
return integer The permission id.

addMessage() public method

Adds a message to this ticket.
public addMessage ( string $message ) : integer
$message string The email message content.
return integer The message ID.

change() public method

Tracks that a detail of the ticket should change, but does not actually make the change until commit() is called.
See also: commit()
public change ( string $detail, string $value )
$detail string The detail to change.
$value string The new detail value.

commit() public method

This will send email updates by default, update the ticket log, etc.
See also: change()
public commit ( string $user = null, integer $transaction = null, boolean $notify = true )
$user string The Horde user of the changes to be made. Defaults to the current user.
$transaction integer The transaction these changes are part of. Defaults to a new transaction.
$notify boolean Send ticket notifications?

delete() public method

Deletes this ticket.
public delete ( )

deleteAttachment() public method

Removes an attachment from this ticket.
public deleteAttachment ( string $attachment_name )
$attachment_name string The name of the attachment.

deleteMessage() public method

Removes a message from this ticket.
public deleteMessage ( integer $message )
$message integer A message ID.

get() public method

Returns a piece of information from this ticket.
public get ( string $detail ) : mixed
$detail string The detail to return.
return mixed The detail value.

getDetails() public method

Returns all ticket information.
public getDetails ( ) : array
return array The ticket information.

getId() public method

Returns the ticket id.
public getId ( ) : integer
return integer The ticket id.

listAllAttachments() public method

Returns a list of all files that have been attached to this ticket, whether they still exist or not.
public listAllAttachments ( string $filter = null ) : array
$filter string If set, only return this property of the change commit that included the attachment.
return array The list of file attachments

makeTicket() public static method

Returns a ticket object for an id.
public static makeTicket ( integer $id ) : Whups_Ticket
$id integer The ticket id.
return Whups_Ticket Whups_Ticket object

newTicket() public static method

Pretty bare wrapper around Whups_Driver::addTicket().
public static newTicket ( array $info, $requester ) : Whups_Ticket
$info array A hash with ticket information.
return Whups_Ticket Whups_Ticket object.

notify() public method

Notifies all appropriate people of the creation/update of this ticket.
public notify ( string $author, boolean $isNew, array $listeners = [] )
$author string Who created/changed the ticket?
$isNew boolean Is this a new ticket or a change to an existing one?
$listeners array The list of listener that should receive the notification, with user names as keys and user roles as values. If empty, the list will be created automatically.

set() public method

Never touches the backend; do not use for changes that you want to persist.
public set ( string $detail, string $value )
$detail string The detail to change.
$value string The new detail value.

setDetails() public method

Sets all properties of the ticket necessary to display the TicketDetailsForm.
public setDetails ( Horde_Variables $vars, boolean $split_owners = false )
$vars Horde_Variables The form variables object to set info in.
$split_owners boolean This has to be set if you want to use the $vars var for saving later or otherwise $form->validate() will fail

show() public method

Redirects the browser to this ticket's view.
public show ( )

toString() public method

Returns a plain text representation of a ticket.
public toString ( )

Property Details

$_changes protected_oe property

Array of changes to make to the ticket.
protected array $_changes
return array

$_details protected_oe property

The current values of the ticket.
protected array $_details
return array

$_id protected_oe property

The id of the ticket this object wraps.
protected int $_id
return integer