Methods summary
public static
Horde_Url
|
#
urlFor( string $controller, array|string $data, boolean $full = false, integer $append_session = 0 )
URL factory.
Parameters
- $controller
- <p>The controller to link to, one of
'queue', 'ticket', 'ticket_rss',
'ticket_action', 'query', 'query_rss'.</p>
- $data
- URL data, depending on the controller.
- $full
- @see Horde::url()
- $append_session
- @see Horde::url()
Returns
Horde_Url The generated URL.
|
public static
|
#
sortTickets( array & $tickets, string $by = null, string $dir = null )
Sorts tickets by requested direction and fields.
Sorts tickets by requested direction and fields.
Parameters
- $tickets
- The list of tickets to sort.
- $by
- <p>The field to sort by. If omitted, obtain from
preferences.</p>
- $dir
- <p>The direction to sort. If omitted, obtain from
preferences.</p>
|
public static
string
|
#
sortBy( string $b = null )
Sets or returns the current sort field.
Sets or returns the current sort field.
Parameters
Returns
string If $b is null, returns the previously set value.
|
public static
integer
|
#
sortDir( integer $d = null )
Sets or returns the current sort direction.
Sets or returns the current sort direction.
Parameters
- $d
- The direction to sort by.
Returns
integer If $d is null, returns the previously set value.
|
public static
string
|
#
getCAPTCHA( boolean $new = false )
Returns a new or the current CAPTCHA string.
Returns a new or the current CAPTCHA string.
Parameters
- $new
- <p>If true, a new CAPTCHA is created and returned.
The current, to-be-confirmed string otherwise.</p>
Returns
string A CAPTCHA string.
|
public static
array
|
#
listTemplates( string $type )
Lists all templates of a given type.
Lists all templates of a given type.
Parameters
- $type
- <p>The kind of template ('searchresults', etc.) to
list.</p>
Returns
array All templates of the requested type.
|
public static
Whups_Ticket
|
#
getCurrentTicket( )
Returns the current 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.
Returns
|
public static
|
#
getTicketTabs( mixed & $vars, mixed $id )
Returns the tabs for navigating between ticket actions.
Returns the tabs for navigating between ticket actions.
|
public static
boolean
|
#
hasPermission( mixed $in, string $filter, string|integer $permission, string $user = null )
Returns whether a user has a certain permission on a single resource.
Returns whether a user has a certain permission on a single resource.
Parameters
- $in
- A single resource to check.
- $filter
- <p>The kind of resource specified in
$in, currently only 'queue'.</p>
- $permission
- <p>A permission, either 'assign' or
'update', 'requester', or one of the
PERM_* constants.</p>
- $user
- A user name.
Returns
boolean True if the user has the specified permission.
|
public static
array
|
#
permissionsFilter( array $in, string $filter, integer $permission = Horde_Perms::READ, string $user = null, string $creator = null )
Filters a list of resources based on whether a user has certain
permissions on it.
Filters a list of resources based on whether a user has certain
permissions on it.
Parameters
- $in
- A list of resources to check.
- $filter
- <p>The kind of resource specified in $in,
one of 'queue', 'queue_id', 'reply', or
'comment'.</p>
- $permission
- A permission, one of the PERM_* constants.
- $user
- A user name.
- $creator
- <p>The creator of an object in the resource,
e.g. a ticket creator.</p>
Returns
array The list of resources matching the permission criteria.
|
public static
array
|
#
getOwnerCriteria( string $user )
Builds a list of criteria for Whups_Driver#getTicketsByProperties() that
match a certain user.
Builds a list of criteria for Whups_Driver#getTicketsByProperties() that
match a certain user.
Merges the user's groups with the user name.
Parameters
Returns
array A list of criteria that would match the user.
|
public static
array
|
#
getUserAttributes( string $user = null )
Returns a hash with user information.
Returns a hash with user information.
Parameters
- $user
- A (Whups) user name, defaults to the current user.
Returns
array An information hash with 'user', 'name', 'email', and
'type' values.
|
public static
|
#
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.
Returns a user string from the user's name and email address.
Parameters
- $user
- <p>A user name or a hash as returned from
<a href="self::getUserAttributes()">self::getUserAttributes()</a>.</p>
- $showemail
- Whether to include the email address.
- $showname
- Whether to include the full name.
- $html
- <p>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.</p>
|
public static
|
#
getSearchResultColumns( integer $search_type = null )
Returns the set of columns and their associated parameter from the
backend that should be displayed to the user.
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 and which search
function was executed.
Parameters
- $search_type
- <p>The type of search that was executed.
Currently only 'block' is supported.</p>
|
public static
|
#
sendReminders( Horde_Variables $vars )
Sends reminders, one email per user.
Sends reminders, one email per user.
Parameters
- $vars
- <p>The selection criteria:
- 'id' (integer) for individual tickets
- 'queue' (integer) for tickets of a queue.
- 'category' (array) for ticket
categories, defaults to unresolved
tickets.
- 'unassigned' (boolean) for unassigned
tickets.</p>
Throws
|
public static
array
|
#
getAttachments( integer $ticket, string $name = null )
Returns attachment information hashes from the VFS backend.
Returns attachment information hashes from the VFS backend.
Parameters
- $ticket
- A ticket ID.
- $name
- An attachment name.
Returns
array If $name is empty a list of all attachments' information
hashes, otherwise only the hash for the attachment of
that name.
Throws
|
public static
|
#
attachmentUrl( integer $ticket, string $file, integer $queue )
Returns the links to view, download, and delete an attachment.
Returns the links to view, download, and delete an attachment.
Parameters
- $ticket
- A ticket ID.
- $file
- An attachment name.
- $queue
- The ticket's queue ID.
|
public static
string
|
#
getOwners( integer $ticket, boolean $showemail = true, boolean $showname = true, array $owners = null )
Returns formatted owner names of a ticket.
Returns formatted owner names of a ticket.
Parameters
- $ticket
- A ticket id. Only used if $owners is null.
- $showemail
- <p>$showmail Should we include the email address in the
output?</p>
- $showname
- Should we include the name in the output?
- $owners
- <p>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.</p>
Returns
string The formatted owner string.
|
public static
array
|
#
fieldTypes( )
Returns all available form field types including all type information
from the Horde_Form classes.
Returns all available form field types including all type information
from the Horde_Form classes.
Returns
array The full field types array.
|
public static
array
|
#
fieldTypeNames( )
Returns the available field type names from the Horde_Form classes.
Returns the available field type names from the Horde_Form classes.
Returns
array A hash The with available field types and names.
|
public static
array
|
#
fieldTypeParams( string $field_type )
Returns the parameters for a certain Horde_Form field type.
Returns the parameters for a certain Horde_Form field type.
Parameters
- $field_type
- A field type.
Returns
array A list of field type parameters.
|
public static
array
|
#
getAddressbookSearchParams( )
Returns the parameters necessary to run an address search.
Returns the parameters necessary to run an address search.
Returns
array An array with two keys: 'sources' and 'fields'.
|