VFS_ATTACH_PATH
VFS_ATTACH_PATH
Path to ticket attachments in the VFS.
The Whups class provides functionality that all of Whups needs, or that should be encapsulated from other parts of the Whups system.
urlFor(string $controller, array|string $data, boolean $full = false, integer $append_session) : \Horde_Url
URL factory.
string | $controller | The controller to link to, one of 'queue', 'ticket', 'ticket_rss', 'ticket_action', 'query', 'query_rss'. |
array|string | $data | URL data, depending on the controller. |
boolean | $full | @see Horde::url() |
integer | $append_session | @see Horde::url() |
The generated URL.
sortTickets(array $tickets, string $by = null, string $dir = null)
Sorts tickets by requested direction and fields.
array | $tickets | The list of tickets to sort. |
string | $by | The field to sort by. If omitted, obtain from preferences. |
string | $dir | The direction to sort. If omitted, obtain from preferences. |
getCurrentTicket() : \Whups_Ticket
Returns the current ticket.
Uses the 'id' request variable to determine what to look for. Will redirect to the default view if the ticket isn't found or if permissions checks fail.
The current ticket.
hasPermission(mixed $in, string $filter, string|integer $permission, string $user = null) : boolean
Returns whether a user has a certain permission on a single resource.
mixed | $in | A single resource to check. |
string | $filter | The kind of resource specified in $in, currently only 'queue'. |
string|integer | $permission | A permission, either 'assign' or 'update', 'requester', or one of the PERM_* constants. |
string | $user | A user name. |
True if the user has the specified permission.
permissionsFilter(array $in, string $filter, integer $permission = \Horde_Perms::READ, string $user = null, string $creator = null) : array
Filters a list of resources based on whether a user has certain permissions on it.
array | $in | A list of resources to check. |
string | $filter | The kind of resource specified in $in, one of 'queue', 'queue_id', 'reply', or 'comment'. |
integer | $permission | A permission, one of the PERM_* constants. |
string | $user | A user name. |
string | $creator | The creator of an object in the resource, e.g. a ticket creator. |
The list of resources matching the permission criteria.
formatUser(string|array $user = null, boolean $showemail = true, boolean $showname = true, boolean $html = false)
Returns a user string from the user's name and email address.
string|array | $user | A user name or a hash as returned from {@link self::getUserAttributes()}. |
boolean | $showemail | Whether to include the email address. |
boolean | $showname | Whether to include the full name. |
boolean | $html | Whether to "prettify" the result. If true, email addresses are obscured, the result is escaped for HTML output, and a group icon might be added. |
getSearchResultColumns(integer $search_type = null, array $columns = null)
Returns the set of columns and their associated parameter from the backend that should be displayed to the user.
The results can depend on the current user preferences, which search function was executed, and the $columns parameter.
integer | $search_type | The type of search that was executed. Currently only 'block' is supported. |
array | $columns | The columns to return, overriding the defaults for some $search_type. |
sendReminders(\Horde_Variables $vars)
Sends reminders, one email per user.
\Horde_Variables | $vars | The selection criteria:
|
hasMessage(integer $ticket, integer $id) : boolean
Returns whether an original message for a ticket comment exists.
integer | $ticket | A ticket ID. |
integer | $id | A message ID. |
if the VFS object cannot be created.
True if the original message exists.
getAttachments(integer $ticket, string $name = null) : array
Returns attachment information hashes from the VFS backend.
integer | $ticket | A ticket ID. |
string | $name | An attachment name. |
if the VFS object cannot be created.
If $name is empty a list of all attachments' information hashes, otherwise only the hash for the attachment of that name.
getOwners(integer $ticket, $showemail = true, boolean $showname = true, array $owners = null) : string
Returns formatted owner names of a ticket.
integer | $ticket | A ticket id. Only used if $owners is null. |
$showemail | ||
boolean | $showname | Should we include the name in the output? |
array | $owners | An array of owners as returned from Whups_Driver::getOwners() to be formatted. If this is provided, they are used instead of the owners from $ticket. |
The formatted owner string.
_prepareSort(array $ticket) : array
Helper method to prepare an array of tickets for sorting.
Adds a sort_by key to each ticket array, with values lowercased. Used as a callback to array_map().
array | $ticket | The ticket array to prepare. |
The altered $ticket array
_sort(array $a, array $b, string $sortby = null, string $sortdir = null) : integer
Helper method to sort an array of tickets.
Used as callback to usort().
array | $a | The first ticket to compare. |
array | $b | The second ticket to compare. |
string | $sortby | The field to sort by. If null, uses the field from self::sortBy(). |
string | $sortdir | The direction to sort. If null, uses the value from self::sortDir(). |