Methods summary
public
|
|
public
integer
|
#
addQueue( mixed $name, mixed $description, mixed $slug = '', mixed $email = '' )
Adds a new queue.
Returns
integer The new queue ID.
Throws
Params
string $name A queue name.
string $description A queue description.
string $slug A queue slug.
string $email A queue email address.
|
public
integer
|
#
addType( string $name, string $description )
Adds a new ticket type.
Parameters
- $name
- A type name.
- $description
- A type description.
Returns
integer The new type ID.
Throws
|
public
integer
|
#
addState( integer $typeId, string $name, string $description, string $category )
Adds a new state to a ticket type.
Adds a new state to a ticket type.
Parameters
- $typeId
- A ticket type ID.
- $name
- A state name
- $description
- A state description.
- $category
- A state category.
Returns
integer The new state ID.
Throws
|
public
integer
|
#
addPriority( integer $typeId, string $name, string $description )
Adds a new priority to a ticket type.
Adds a new priority to a ticket type.
Parameters
- $typeId
- A ticket type ID.
- $name
- A priority name.
- $description
- A priority description.
Returns
integer The new priority ID.
Throws
|
public
integer
|
#
addVersion( integer $queueId, string $name, string $description, boolean $active )
Adds a new version to a queue.
Adds a new version to a queue.
Parameters
- $queueId
- A queue ID.
- $name
- A version name.
- $description
- A version description.
- $active
- Whether the version is active.
Returns
integer The new version ID.
Throws
|
public
integer
|
#
addReply( integer $type, string $name, string $text )
Adds a form reply.
Parameters
- $type
- A ticket type ID.
- $name
- A reply name.
- $text
- A reply text.
Returns
integer The new form reply ID.
Throws
|
public
integer
|
#
addTicket( array & $info, string $requester )
Adds a ticket.
Parameters
- $info
- <p>A ticket info hash. Will get a
'last-transaction' value added.</p>
- $requester
- A ticket requester.
Returns
integer The new ticket ID.
Throws
|
public
|
#
updateTicket( integer $ticketId, array $attributes )
Updates a ticket.
Does not update the ticket log (so that it can be used for things
low-level enough to not show up there. In general, you should always
update the log; Whups_Ticket::commit() will take care of this in most
cases).
Parameters
- $ticketId
- A ticket ID.
- $attributes
- An attribute hash.
Throws
|
public
|
#
addTicketOwner( integer $ticketId, string $owner )
Adds a ticket owner.
Parameters
- $ticketId
- A ticket ID.
- $owner
- An owner ID.
Throws
|
public
|
#
deleteTicketOwner( integer $ticketId, string $owner )
Removes a ticket owner.
Parameters
- $ticketId
- A ticket ID.
- $owner
- An owner ID.
Throws
|
public
|
#
deleteTicket( integer $id )
Removes a ticket.
Parameters
Throws
|
public
array
|
#
executeQuery( Whups_Query $query, Horde_Variables $vars, boolean $get_details = true, boolean $munge = true )
Executes a query.
Parameters
- $query
- A query object.
- $vars
- Request variables.
- $get_details
- Whether to return all ticket details.
- $munge
- @TODO (?)
Returns
array List of ticket IDs or ticket details that match the query
criteria.
Throws
|
public
|
#
clauseFromQuery( mixed $args, mixed $type, mixed $criterion, mixed $cvalue, mixed $operator, mixed $value )
|
public
array
|
#
getTicketsByProperties( array $info, boolean $munge = true, boolean $perowner = false )
Returns tickets by searching for its properties.
Returns tickets by searching for its properties.
Parameters
- $info
- An array of properties to search for.
- $munge
- Munge the query (?)
- $perowner
- Group the results per owner?
Returns
array An array of ticket information hashes.
Throws
|
public
array
|
#
getTicketDetails( integer $ticket, boolean $checkPerms = true )
Returns ticket details.
Parameters
- $ticket
- A ticket ID.
- $checkPerms
- Enforce permissions?
Returns
array A ticket information hash.
Throws
Horde_Exception_NotFound
Horde_Exception_PermissionDenied
|
public
integer
|
#
getTicketState( integer $ticket_id )
Returns a ticket state.
Parameters
Returns
integer A state ID.
Throws
|
public
string
|
#
getGuestEmail( string $guest_id )
Returns a guest's email address.
Returns a guest's email address.
Parameters
Returns
string The guest's email address.
Throws
|
public
|
#
deleteHistory( integer $transaction )
Deletes all changes of a transaction.
Deletes all changes of a transaction.
Parameters
- $transaction
- A transaction ID.
Throws
|
public
array
|
#
getQueueSummary( array $queue_ids )
Return a list of queues and the number of open tickets in each.
Return a list of queues and the number of open tickets in each.
Parameters
- $queue_ids
- $queues Array of queue IDs to summarize.
Returns
array A list of queue hashes.
Throws
|
public
array
|
#
getQueueInternal( integer $queueId )
Returns a queue information hash.
Returns a queue information hash.
Parameters
Returns
array A queue hash.
Throws
|
public
array
|
#
getQueueBySlugInternal( string $slug )
Returns a queue information hash.
Returns a queue information hash.
Parameters
Returns
array A queue hash.
Throws
|
public
array
|
#
getQueuesInternal( )
Returns a list of available queues.
Returns a list of available queues.
Returns
array An hash of queue ID => queue name.
Throws
|
public
array
|
#
getSlugs( )
Returns a list of all available slugs.
Returns a list of all available slugs.
Returns
array A hash of queue ID => queue slug.
Throws
|
public
|
#
updateQueue( integer $queueId, string $name, string $description, array $types = array(), integer $versioned = 0, string $slug = '', string $email = '', integer $default = null )
Updates a queue.
Parameters
- $queueId
- A queue ID.
- $name
- A queue name.
- $description
- A queue description.
- $types
- A list of type IDs for this queue.
- $versioned
- <p>Is this queue versioned? (1 = true,
0 = false)</p>
- $slug
- A queue slug.
- $email
- A queue email address.
- $default
- The default ticket type.
Throws
|
public
integer
|
#
getDefaultType( integer $queue )
Returns a queue's default ticket type.
Returns a queue's default ticket type.
Parameters
Returns
integer A ticket type ID.
|
public
|
#
deleteQueue( integer $queueId )
Deletes an entire queue, and all references to it.
Deletes an entire queue, and all references to it.
Parameters
Throws
Overrides
|
public
|
#
updateTypesQueues( array $tmPairs )
Update type-queue-associations.
Update type-queue-associations.
Parameters
- $tmPairs
- array of mappings.
Throws
|
public
array
|
#
getQueueUsers( integer $queueId )
Returns a list of responsible users.
Returns a list of responsible users.
Parameters
Returns
array An array of users responsible for the queue.
Throws
Whups_Execption
|
public
|
#
addQueueUser( integer $queueId, string $userId )
Adds a responsible user.
Parameters
- $queueId
- A queue ID.
- $userId
- A user ID.
Throws
|
public
|
#
removeQueueUser( integer $queueId, string $userId )
Removes a responsible user.
Removes a responsible user.
Parameters
- $queueId
- A queue ID.
- $userId
- A user ID.
Throws
|
public
array
|
#
getType( integer $typeId )
Returns a ticket type.
Parameters
- $typeId
- A ticket type ID.
Returns
array The ticket type information.
Throws
|
public
array
|
#
getTypes( integer $queueId )
Returns a list of ticket types associated with a queue.
Returns a list of ticket types associated with a queue.
Parameters
Returns
array A hash of type ID => type name.
Throws
|
public
array
|
#
getTypeIds( integer $queueId )
Returns a list of ticket type IDs associated with a queue.
Returns a list of ticket type IDs associated with a queue.
Parameters
Returns
array A list of type IDs.
Throws
|
public
array
|
#
getAllTypes( )
Returns a list of all available ticket types.
Returns a list of all available ticket types.
Returns
array A hash of type ID => type name.
Throws
|
public
array
|
#
getAllTypeInfo( )
Returns a list of all available ticket types.
Returns a list of all available ticket types.
Returns
array A list of ticket type information hashes.
Throws
|
public
string
|
#
getTypeName( integer $type )
Returns a ticket type name.
Returns a ticket type name.
Parameters
Returns
string The ticket type's name.
Throws
|
public
|
#
updateType( integer $typeId, string $name, string $description )
Updates a ticket type.
Parameters
- $typeId
- A ticket type ID.
- $name
- A ticket type name.
- $description
- A ticket type description.
Throws
|
public
|
#
deleteType( integer $typeId )
Deletes a ticket type.
Parameters
Throws
|
public
array
|
#
getStates( integer $type = null, string|array $category = '', string|array $notcategory = '' )
Returns available states for a ticket type and state category.
Returns available states for a ticket type and state category.
Parameters
- $type
- A ticket type ID.
- $category
- State categories to include.
- $notcategory
- State categories to not include.
Returns
array A hash of state ID => state name.
Throws
|
public
array
|
#
getState( integer $stateId )
Returns a state information hash.
Returns a state information hash.
Parameters
Returns
array A state definition hash.
|
public
array
|
#
getAllStateInfo( integer $type )
Returns all state information hashes for a ticket type.
Returns all state information hashes for a ticket type.
Parameters
Returns
array A list of state hashes.
Throws
|
public
|
#
updateState( integer $stateId, string $name, string $description, string $category )
Updates a state.
Parameters
- $stateId
- A state ID.
- $name
- A state name.
- $description
- A state description.
- $category
- A state category.
Throws
|
public
integer
|
#
getDefaultState( integer $type )
Returns the default state for a ticket type.
Returns the default state for a ticket type.
Parameters
Returns
integer The default state ID for the specified type.
Throws
|
public
|
#
setDefaultState( integer $type, integer $state )
Sets the default state for a ticket type.
Sets the default state for a ticket type.
Parameters
- $type
- A type ID.
- $state
- A state ID.
Throws
|
public
|
#
deleteState( integer $state_id )
Deletes a state.
Parameters
Throws
|
public
array
|
#
getQuery( integer $queryId )
Returns query details.
Parameters
Returns
array Query information.
Throws
|
public
|
#
saveQuery( Whups_Query $query )
Saves query details.
If the query doesn't exist yes, it is added, update otherwise.
Parameters
Throws
|
public
|
#
deleteQuery( integer $queryId )
Deletes a query.
Parameters
Throws
|
public
boolean
|
#
isCategory( string $category, integer $state_id )
Returns whether a state is of a certain category.
Returns whether a state is of a certain category.
Parameters
- $category
- A state category.
- $state_id
- A state ID.
Returns
boolean True if the state is of the given category.
Throws
|
public
array
|
#
getAllPriorityInfo( integer $type )
Returns all priority information hashes for a ticket type.
Returns all priority information hashes for a ticket type.
Parameters
Returns
array A list of priority hashes.
Throws
|
public
array
|
#
getPriorities( integer $type = null )
Returns a list of priorities.
Returns a list of priorities.
If the priorities are not limited to a ticket type, the priority names
are suffixed with associated ticket type names.
Parameters
- $type
- Limit result to this ticket type's priorities.
Returns
array A hash of priority ID => priority name.
Throws
|
public
array
|
#
getPriority( integer $priorityId )
Returns a priority information hash.
Returns a priority information hash.
Parameters
Returns
array A priority definition hash.
Throws
|
public
|
#
updatePriority( integer $priorityId, string $name, string $description )
Updates a priority.
Parameters
- $priorityId
- A priority ID.
- $name
- A priority name.
- $description
- A priority description.
Throws
|
public
integer
|
#
getDefaultPriority( integer $type )
Returns the default priority for a ticket type.
Returns the default priority for a ticket type.
Parameters
Returns
integer The default priority ID for the specified type.
Throws
|
public
|
#
setDefaultPriority( integer $type, integer $priority )
Sets the default priority for a ticket type.
Sets the default priority for a ticket type.
Parameters
- $type
- A type ID.
- $priority
- A priority ID.
Throws
|
public
|
#
deletePriority( integer $priorityId )
Deletes a priority.
Parameters
- $priorityId
- A priority ID.
Throws
|
public
array
|
#
getVersionInfoInternal( integer $queue )
Returns all versions of a queue.
Returns all versions of a queue.
Parameters
Returns
array A list of version information hashes.
Throws
|
public
array
|
#
getVersionInternal( integer $versionId )
Returns a version information hash.
Returns a version information hash.
Parameters
Returns
array A version definition hash.
Throws
|
public
|
#
updateVersion( integer $versionId, string $name, string $description, boolean $active )
Updates a version.
Parameters
- $versionId
- A version ID.
- $name
- A version name.
- $description
- A version description.
- $active
- Whether the version is still active.
Throws
|
public
|
#
deleteVersion( integer $versionId )
Deletes a version.
Parameters
Throws
|
public
array
|
#
getReplies( integer $type )
Returns all available form replies for a ticket type.
Returns all available form replies for a ticket type.
Parameters
Returns
array A hash of reply ID => reply information hash.
Throws
|
public
array
|
#
getReply( integer $reply_id )
Returns a form reply.
Parameters
- $reply_id
- A form reply ID.
Returns
array A hash with all form reply information.
Throws
|
public
|
#
updateReply( integer $reply, string $name, string $text )
Updates a form reply.
Parameters
- $reply
- A reply ID.
- $name
- A reply name.
- $text
- A reply text.
Throws
|
public
|
#
deleteReply( integer $reply )
Deletes a form reply.
Parameters
Throws
Overrides
|
public
|
#
addListener( integer $ticket, string $user )
Adds a ticket listener.
Parameters
- $ticket
- A ticket ID.
- $user
- An email address.
Throws
|
public
|
#
deleteListener( integer $ticket, string $user )
Deletes a ticket listener.
Deletes a ticket listener.
Parameters
- $ticket
- A ticket ID.
- $user
- An email address.
Throws
|
public
array
|
#
getListeners( integer $ticket, boolean $withowners = true, boolean $withrequester = true, boolean $withresponsible = false )
Returns all ticket listeners.
Returns all ticket listeners.
Parameters
- $ticket
- A ticket ID.
- $withowners
- Include ticket owners?
- $withrequester
- Include ticket creators?
- $withresponsible
- <p>Include users responsible for the ticket
queue?</p>
Returns
array A list of all ticket listeners.
Throws
|
public
integer
|
#
addAttributeDesc( integer $type_id, string $name, string $desc, string $type, array $params, boolean $required )
Adds an attribute to a ticket type.
Adds an attribute to a ticket type.
Parameters
- $type_id
- A ticket type ID.
- $name
- An attribute name.
- $desc
- An attribute description.
- $type
- A form field type.
- $params
- Additional parameters for the field type.
- $required
- Whether the attribute is mandatory.
Returns
integer The new attribute ID.
Throws
|
public
|
#
updateAttributeDesc( integer $attribute_id, string $newname, string $newdesc, string $newtype, array $newparams, boolean $newrequired )
Updates an attribute for a ticket type.
Updates an attribute for a ticket type.
Parameters
- $attribute_id
- An attribute ID.
- $newname
- An attribute name.
- $newdesc
- An attribute description.
- $newtype
- A form field type.
- $newparams
- Additional parameters for the field type.
- $newrequired
- Whether the attribute is mandatory.
Throws
|
public
|
#
deleteAttributeDesc( integer $attribute_id )
Deletes an attribute for a ticket type.
Deletes an attribute for a ticket type.
Parameters
- $attribute_id
- An attribute ID.
Throws
|
public
array
|
#
getAllAttributes( )
Returns all attributes.
Returns
array A list of attributes hashes.
Throws
|
public
array
|
#
getAttributeDesc( integer $attribute_id )
Returns an attribute information hash.
Returns an attribute information hash.
Parameters
- $attribute_id
- An attribute ID.
Returns
array The attribute hash.
Throws
|
public
string
|
#
getAttributeName( integer $attribute_id )
Returns an attribute name.
Returns an attribute name.
Parameters
- $attribute_id
- An attribute ID.
Returns
string The attribute name.
Throws
|
public
array
|
#
getAttributeNamesForType( integer $type_id )
Returns available attribute names for a ticket type.
Returns available attribute names for a ticket type.
Parameters
- $type_id
- A ticket type ID.
Returns
array A list of attribute names.
Throws
|
public
array
|
#
getAttributeInfoForType( integer $type_id )
Returns available attributes for a ticket type.
Returns available attributes for a ticket type.
Parameters
- $type_id
- A ticket type ID.
Returns
array A list of attribute information hashes.
Throws
|
public
array
|
#
getTicketAttributes( integer|array $ticket_id )
Returns the attribute values of a ticket.
Returns the attribute values of a ticket.
Parameters
- $ticket_id
- One or more ticket IDs.
Returns
array If requesting a single ticket, an attribute ID =>
attribute value hash. If requesting multiple tickets, a
list of hashes with ticket ID, attribute ID and attribute
value.
Throws
|
public
array
|
#
getTicketAttributesWithNames( integer|array $ticket_id )
Returns the attribute values and names of a ticket.
Returns the attribute values and names of a ticket.
Parameters
- $ticket_id
- One or more ticket IDs.
Returns
array If requesting a single ticket, an attribute name =>
attribute value hash. If requesting multiple tickets, a
list of hashes with ticket ID, attribute ID, attribute
name, and attribute value.
Throws
|
public
array
|
#
getOwners( mixed $ticketId )
Returns the owners of a ticket.
Returns the owners of a ticket.
Parameters
- $ticketId
- $ticketId One or more ticket IDs.
Returns
array An hash of ticket ID => owner IDs
Throws
|
public
integer
|
#
updateLog( integer $ticket_id, string $user, array $changes = array(), integer $transactionId = null )
Adds a new log entry
Parameters
- $ticket_id
- A ticket ID.
- $user
- A user updating the ticket.
- $changes
- A list of changes.
- $transactionId
- A transaction ID to use.
Returns
integer A transaction ID.
Throws
|
public
integer
|
#
newTransaction( string $creator, string $creator_email = null )
Create a new transaction ID.
Create a new transaction ID.
Parameters
- $creator
- A transaction creator.
- $creator_email
- The transaction creator's email address.
Returns
integer A transaction ID.
Throws
|