PHP Class Whups_Api, horde

This file defines Whups' external API interface. Other applications can interact with Whups through this API.
Inheritance: extends Horde_Registry_Api
显示文件 Open project: horde/horde

Protected Properties

Property Type Description
$_links array Links.

Public Methods

Method Description
addAttachment ( integer $ticket_id, string $name, string $data ) Adds an attachment to a ticket.
addComment ( integer $ticket_id, string $comment, string $group = null ) : boolean Add a comment to a ticket.
addQueue ( string $name ) : integer Create a new queue.
addTicket ( array $ticket_info ) : integer Create a new ticket.
addVersion ( integer $queue, string $name, string $description, boolean $active = true ) Add a version to a queue
browse ( string $path = '' ) : array Browse through Whups' object tree.
getAssignedTicketIds ( ) : array Return the ids of all open tickets assigned to the current user.
getListTypes ( ) : array Get the types that Whups items can be listed as.
getQueueDetails ( array | integer $queue ) : array Get details for a queue
getRequestedTicketIds ( ) : array Return the ids of all open tickets that the current user created.
getTicketDetails ( integer $queue_id, string $state = null ) : array Get the all tickets for a queue, optionally with a specific state.
getVersionDetails ( integer $version_id ) : array Return the details for a queue version
listAs ( string $type ) : array Get a list of items from whups as type $type.
listCostObjects ( array $criteria ) : array List cost objects
listQueues ( ) : array Return a list of queues that the current user has read permissions for
listSlugs ( ) : array Return a list of slugs that the current user has read permissions for
listTimeObjectCategories ( ) : array List the ways that tickets can be treated as time objects
listTimeObjects ( array $categories, mixed $start, mixed $end ) Lists tickets with due dates as time objects.
listVersions ( integer $queue ) : array List the versions associated with a queue
setTicketAttributes ( $info ) Set attributes for a ticket
updateTicket ( integer $ticket_id, array $ticket_info ) : boolean Update a ticket's properties.

Private Methods

Method Description
_sortVersions ( $a, $b )

Method Details

addAttachment() public method

Adds an attachment to a ticket.
public addAttachment ( integer $ticket_id, string $name, string $data )
$ticket_id integer The ticket number.
$name string The name of the attachment.
$data string The attachment data.

addComment() public method

Add a comment to a ticket.
public addComment ( integer $ticket_id, string $comment, string $group = null ) : boolean
$ticket_id integer The id of the ticket to comment on.
$comment string The comment text to add.
$group string (optional) Restrict this comment to a specific group.
return boolean True

addQueue() public method

Create a new queue.
public addQueue ( string $name ) : integer
$name string The queue's name.
return integer The new queue id.

addTicket() public method

Create a new ticket.
public addTicket ( array $ticket_info ) : integer
$ticket_info array An array of form variables representing all of the data collected by CreateStep1Form, CreateStep2Form, CreateStep3Form, and optionally CreateStep4Form.
return integer The new ticket id.

addVersion() public method

Add a version to a queue
public addVersion ( integer $queue, string $name, string $description, boolean $active = true )
$queue integer The queue id to add the version to.
$name string The name of the new version.
$description string The descriptive text for the new version.
$active boolean Whether the version is still active.

browse() public method

Browse through Whups' object tree.
public browse ( string $path = '' ) : array
$path string The level of the tree to browse.
return array The contents of $path

getAssignedTicketIds() public method

Return the ids of all open tickets assigned to the current user.
public getAssignedTicketIds ( ) : array
return array Array of ticket ids.

getListTypes() public method

Get the types that Whups items can be listed as.
public getListTypes ( ) : array
return array Array of list types.

getQueueDetails() public method

Get details for a queue
public getQueueDetails ( array | integer $queue ) : array
$queue array | integer
return array An array of queue information (or an array of arrays, if multiple queues were passed).

getRequestedTicketIds() public method

Return the ids of all open tickets that the current user created.
public getRequestedTicketIds ( ) : array
return array Array of ticket ids.

getTicketDetails() public method

Get the all tickets for a queue, optionally with a specific state.
public getTicketDetails ( integer $queue_id, string $state = null ) : array
$queue_id integer The queue to get tickets for
$state string The state filter, if any.
return array Array of tickets

getVersionDetails() public method

Return the details for a queue version
public getVersionDetails ( integer $version_id ) : array
$version_id integer The version to fetch
return array Array of version details

listAs() public method

Get a list of items from whups as type $type.
public listAs ( string $type ) : array
$type string The list type to use (@see getListTypes). Currently supported: 'taskHash'
return array An array of tickets.

listCostObjects() public method

List cost objects
public listCostObjects ( array $criteria ) : array
$criteria array The list criteria
return array Tickets (as cost objects) matching $criteria

listQueues() public method

Return a list of queues that the current user has read permissions for
public listQueues ( ) : array
return array Array of queue details

listSlugs() public method

Return a list of slugs that the current user has read permissions for
public listSlugs ( ) : array
return array Array of queue details

listTimeObjectCategories() public method

List the ways that tickets can be treated as time objects
public listTimeObjectCategories ( ) : array
return array Array of time object types

listTimeObjects() public method

Lists tickets with due dates as time objects.
public listTimeObjects ( array $categories, mixed $start, mixed $end )
$categories array The time categories (from listTimeObjectCategories) to list.
$start mixed The start date of the period.
$end mixed The end date of the period.

listVersions() public method

List the versions associated with a queue
public listVersions ( integer $queue ) : array
$queue integer The queue id to get versions for.
return array Array of queue versions

setTicketAttributes() public method

Set attributes for a ticket
public setTicketAttributes ( $info )

updateTicket() public method

Update a ticket's properties.
public updateTicket ( integer $ticket_id, array $ticket_info ) : boolean
$ticket_id integer The id of the id to changes.
$ticket_info array The attributes to set, from Whups_Form_Ticket_Edit.
return boolean True

Property Details