Class Whups_Ticket

Description

The Whups_Ticket class encapsulates some logic relating to tickets, sending updates, etc.

$Horde: whups/lib/Ticket.php,v 1.100.2.1 2009/01/06 15:28:17 jan Exp $

Copyright 2004-2009 The Horde Project (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.

Located in /lib/Ticket.php (line 17)


	
			
Variable Summary
 array $_changes
 array $_details
 integer $_id
Method Summary
 static Whups_Ticket makeTicket (integer $id)
 static Whups_Ticket newTicket (array $info,  $requester)
 Whups_Ticket Whups_Ticket (integer $id, array $details)
 mixed addAttachment ( &$attachment_name, string $attachment_file, string $attachment_name)
 array addAttributes ()
 void addCommentPerms (integer $commentId, string $group)
 void change (string $detail, string $value)
 mixed commit ([string $user = null], [integer $transaction = null], [boolean $notify = true])
 mixed deleteAttachment (string $attachment_name)
 mixed get (string $detail)
 array getDetails ()
 integer getId ()
 void notify (string $author, boolean $isNew, [array $listeners = array()])
 void set (string $detail, string $value)
 void setDetails ( &$vars, Horde_Variables $vars)
 void show ()
 void toString (string $author, boolean $isNew)
 void __toString ()
Variables
array $_changes = array() (line 38)

Array of changes to make to the ticket.

array $_details (line 31)

The current values of the ticket.

integer $_id (line 24)

The id of the ticket this object wraps.

Methods
static makeTicket (line 50)

Returns a ticket object for an id.

  • return: Either a Whups_Ticket object on success or a PEAR_Error object on failure.
static Whups_Ticket makeTicket (integer $id)
  • integer $id: The ticket id.
static newTicket (line 75)

Creates a new ticket.

Pretty bare wrapper around Whups_Driver::addTicket().

  • return: Either a Whups_Ticket object on success or a PEAR_Error object on failure.
static Whups_Ticket newTicket (array $info,  $requester)
  • array $info: A hash with ticket information.
  • $requester
Constructor Whups_Ticket (line 152)

Constructor.

Whups_Ticket Whups_Ticket (integer $id, array $details)
  • integer $id: The ticket id.
  • array $details: The hash of ticket information.
addAttachment (line 434)

Adds an attachment to this ticket.

  • return: True on success or PEAR_Error on failure.
mixed addAttachment ( &$attachment_name, string $attachment_file, string $attachment_name)
  • string $attachment_name: The name of the attachment.
  • string $attachment_file: The temporary file containing the data to be stored.
  • &$attachment_name
addAttributes (line 852)

Adds ticket attribute values to the ticket's details, and returns the list of attributes.

  • return: List of ticket attribute hashes.
array addAttributes ()
addCommentPerms (line 544)

Sets exclusive read permissions on a comment to a certain group.

void addCommentPerms (integer $commentId, string $group)
  • integer $commentId: The id of the comment to restrict.
  • string $group: The group name to limit access by.
change (line 215)

Tracks that a detail of the ticket should change, but does not actually make the change until commit() is called.

void change (string $detail, string $value)
  • string $detail: The detail to change.
  • string $value: The new detail value.
commit (line 244)

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.

mixed commit ([string $user = null], [integer $transaction = null], [boolean $notify = true])
  • string $user: The Horde user of the changes to be made. Defaults to the current user.
  • integer $transaction: The transaction these changes are part of. Defaults to a new transaction.
  • boolean $notify: Send ticket notifications?
deleteAttachment (line 482)

Removes an attachment from this ticket.

  • return: True on success or PEAR_Error on failure.
mixed deleteAttachment (string $attachment_name)
  • string $attachment_name: The name of the attachment.
get (line 185)

Returns a piece of information from this ticket.

  • return: The detail value.
mixed get (string $detail)
  • string $detail: The detail to return.
getDetails (line 163)

Returns all ticket information.

  • return: The ticket information.
array getDetails ()
getId (line 173)

Returns the ticket id.

  • return: The ticket id.
integer getId ()
listAllAttachments (line 511)

Returns a list of all files that have been attached to this ticket, whether they still exist or not.

void listAllAttachments ()
notify (line 598)

Notifies all appropriate people of the creation/update of this ticket.

void notify (string $author, boolean $isNew, [array $listeners = array()])
  • string $author: Who created/changed the ticket?
  • boolean $isNew: Is this a new ticket or a change to an existing one?
  • array $listeners: The list of listener that should receive the notification. If empty, the list will be created automatically.
set (line 201)

Changes a detail of the ticket to a new value.

Never touches the backend; do not use for changes that you want to persist.

void set (string $detail, string $value)
  • string $detail: The detail to change.
  • string $value: The new detail value.
setDetails (line 560)

Sets all properties of the ticket necessary to display the TicketDetailsForm.

void setDetails ( &$vars, Horde_Variables $vars)
  • Horde_Variables $vars: The form variables object to set info in.
  • &$vars
show (line 532)

Redirects the browser to this ticket's view.

void show ()
toString (line 801)

Returns a plain text representation of a ticket.

void toString (string $author, boolean $isNew)
  • string $author: Who created/changed the ticket?
  • boolean $isNew: Is this a new ticket or a change to an existing one?
__toString (line 841)
void __toString ()

Documentation generated on Sun, 30 Jan 2011 05:41:44 +0000 by phpDocumentor 1.4.3