PHP Класс 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.
Автор: Chuck Hagenbuch ([email protected])
Автор: Jan Schneider ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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.

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
_getVfs ( ) : Horde_Vfs_Base Returns a Horde_Vfs instance.

Описание методов

__construct() публичный Метод

Constructor.
public __construct ( integer $id, array $details ) : Whups_Ticket
$id integer The ticket id.
$details array The hash of ticket information.
Результат Whups_Ticket

__toString() публичный Метод

public __toString ( )

_getVfs() защищенный Метод

Returns a Horde_Vfs instance.
protected _getVfs ( ) : Horde_Vfs_Base
Результат Horde_Vfs_Base A VFS instance.

addAttachment() публичный Метод

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() публичный Метод

Adds ticket attribute values to the ticket's details, and returns the list of attributes.
public addAttributes ( ) : array
Результат array List of ticket attribute hashes.

addCommentPerms() публичный статический Метод

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.
Результат integer The permission id.

addMessage() публичный Метод

Adds a message to this ticket.
public addMessage ( string $message ) : integer
$message string The email message content.
Результат integer The message ID.

change() публичный Метод

Tracks that a detail of the ticket should change, but does not actually make the change until commit() is called.
См. также: commit()
public change ( string $detail, string $value )
$detail string The detail to change.
$value string The new detail value.

commit() публичный Метод

This will send email updates by default, update the ticket log, etc.
См. также: 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() публичный Метод

Deletes this ticket.
public delete ( )

deleteAttachment() публичный Метод

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

deleteMessage() публичный Метод

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

get() публичный Метод

Returns a piece of information from this ticket.
public get ( string $detail ) : mixed
$detail string The detail to return.
Результат mixed The detail value.

getDetails() публичный Метод

Returns all ticket information.
public getDetails ( ) : array
Результат array The ticket information.

getId() публичный Метод

Returns the ticket id.
public getId ( ) : integer
Результат integer The ticket id.

listAllAttachments() публичный Метод

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.
Результат array The list of file attachments

makeTicket() публичный статический Метод

Returns a ticket object for an id.
public static makeTicket ( integer $id ) : Whups_Ticket
$id integer The ticket id.
Результат Whups_Ticket Whups_Ticket object

newTicket() публичный статический Метод

Pretty bare wrapper around Whups_Driver::addTicket().
public static newTicket ( array $info, $requester ) : Whups_Ticket
$info array A hash with ticket information.
Результат Whups_Ticket Whups_Ticket object.

notify() публичный Метод

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() публичный Метод

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() публичный Метод

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() публичный Метод

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

toString() публичный Метод

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

Описание свойств

$_changes защищенное свойство

Array of changes to make to the ticket.
protected array $_changes
Результат array

$_details защищенное свойство

The current values of the ticket.
protected array $_details
Результат array

$_id защищенное свойство

The id of the ticket this object wraps.
protected int $_id
Результат integer