The Whups_Ticket class encapsulates some logic relating to tickets, sending
updates, etc.
Copyright 2004-2012 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.
Methods summary
public static
Whups_Ticket
#
makeTicket ( integer $id )
Returns a ticket object for an id.
Returns a ticket object for an id.
Parameters
Returns
public static
Whups_Ticket
#
newTicket ( array $info , mixed $requester )
Creates a new ticket.
Pretty bare wrapper around Whups_Driver::addTicket().
Parameters
$info
A hash with ticket information.
$requester
Returns
public
Whups_Ticket
#
__construct ( integer $id , array $details )
Constructor.
Parameters
$id
The ticket id.
$details
The hash of ticket information.
Returns
public
array
#
getDetails ( )
Returns all ticket information.
Returns all ticket information.
Returns
array
The ticket information.
public
integer
#
getId ( )
Returns the ticket id.
Returns
integer
The ticket id.
public
mixed
#
get ( string $detail )
Returns a piece of information from this ticket.
Returns a piece of information from this ticket.
Parameters
$detail
The detail to return.
Returns
mixed
The detail value.
public
#
set ( string $detail , string $value )
Changes a detail of the ticket to a new value.
Changes a detail of the ticket to a new value.
Never touches the backend; do not use for changes that you want to
persist.
Parameters
$detail
The detail to change.
$value
The new detail value.
public
#
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.
Tracks that a detail of the ticket should change, but does not actually
make the change until commit() is called.
Parameters
$detail
The detail to change.
$value
The new detail value.
See
public
#
commit ( string $user = null , integer $transaction = null , boolean $notify = true )
Goes through a list of built-up changes and commits them to the
backend.
Goes through a list of built-up changes and commits them to the
backend.
This will send email updates by default, update the ticket log, etc.
Parameters
$user
<p>The Horde user of the changes to be made.
Defaults to the current user.</p>
$transaction
<p>The transaction these changes are part of.
Defaults to a new transaction.</p>
$notify
Send ticket notifications?
See
public
#
delete ( )
Deletes this ticket.
Throws
public
#
addAttachment ( string & $attachment_name , string $attachment_file )
Adds an attachment to this ticket.
Adds an attachment to this ticket.
Parameters
$attachment_name
The name of the attachment.
$attachment_file
<p>The temporary file containing the data
to be stored.</p>
Throws
public
#
deleteAttachment ( string $attachment_name )
Removes an attachment from this ticket.
Removes an attachment from this ticket.
Parameters
$attachment_name
The name of the attachment.
Throws
public
array
#
listAllAttachments ( )
Returns a list of all files that have been attached to this ticket,
whether they still exist or not.
Returns a list of all files that have been attached to this ticket,
whether they still exist or not.
Returns
array
The list of file attachments
Throws
public
#
show ( )
Redirects the browser to this ticket's view.
Redirects the browser to this ticket's view.
public
string
#
feedLink ( )
Returns a tag for this ticket's feed.
Returns a tag for this ticket's feed.
Returns
string
A full tag.
public
#
setDetails ( Horde_Variables & $vars )
Sets all properties of the ticket necessary to display the
TicketDetailsForm.
Sets all properties of the ticket necessary to display the
TicketDetailsForm.
Parameters
$vars
The form variables object to set info in.
public
#
notify ( string $author , boolean $isNew , array $listeners = array () )
Notifies all appropriate people of the creation/update of this ticket.
Notifies all appropriate people of the creation/update of this ticket.
Parameters
$author
Who created/changed the ticket?
$isNew
<p>Is this a new ticket or a change to an existing
one?</p>
$listeners
<p>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.</p>
public
#
toString ( )
Returns a plain text representation of a ticket.
Returns a plain text representation of a ticket.
public
public
array
#
addAttributes ( )
Adds ticket attribute values to the ticket's details, and returns the
list of attributes.
Adds ticket attribute values to the ticket's details, and returns the
list of attributes.
Returns
array
List of ticket attribute hashes.