Overview

Packages

  • Horde
    • Form
    • MIME
      • Viewer
    • Scheduler
  • None
  • Whups
    • UnitTests

Classes

  • Horde_Core_Ui_VarRenderer_whups
  • Whups
  • Whups_Ajax_Imple_ContactAutoCompleter
  • Whups_Api
  • Whups_Driver
  • Whups_Driver_Sql
  • Whups_Form_AddComment
  • Whups_Form_Admin_AddAttribute
  • Whups_Form_Admin_AddPriority
  • Whups_Form_Admin_AddQueue
  • Whups_Form_Admin_AddReply
  • Whups_Form_Admin_AddState
  • Whups_Form_Admin_AddType
  • Whups_Form_Admin_AddUser
  • Whups_Form_Admin_AddVersion
  • Whups_Form_Admin_CloneType
  • Whups_Form_Admin_DefaultPriority
  • Whups_Form_Admin_DefaultState
  • Whups_Form_Admin_DeleteAttribute
  • Whups_Form_Admin_DeletePriority
  • Whups_Form_Admin_DeleteQueue
  • Whups_Form_Admin_DeleteReply
  • Whups_Form_Admin_DeleteState
  • Whups_Form_Admin_DeleteType
  • Whups_Form_Admin_DeleteVersion
  • Whups_Form_Admin_EditAttributeStepOne
  • Whups_Form_Admin_EditAttributeStepTwo
  • Whups_Form_Admin_EditPriorityStepOne
  • Whups_Form_Admin_EditPriorityStepTwo
  • Whups_Form_Admin_EditQueueStepOne
  • Whups_Form_Admin_EditQueueStepTwo
  • Whups_Form_Admin_EditReplyStepOne
  • Whups_Form_Admin_EditReplyStepTwo
  • Whups_Form_Admin_EditStateStepOne
  • Whups_Form_Admin_EditStateStepTwo
  • Whups_Form_Admin_EditTypeStepOne
  • Whups_Form_Admin_EditTypeStepTwo
  • Whups_Form_Admin_EditUser
  • Whups_Form_Admin_EditVersionStepOne
  • Whups_Form_Admin_EditVersionStepTwo
  • Whups_Form_InsertBranch
  • Whups_Form_Query_AttributeCriterion
  • Whups_Form_Query_ChooseNameForLoad
  • Whups_Form_Query_ChooseNameForSave
  • Whups_Form_Query_DateCriterion
  • Whups_Form_Query_Delete
  • Whups_Form_Query_GroupCriterion
  • Whups_Form_Query_Parameter
  • Whups_Form_Query_PropertyCriterion
  • Whups_Form_Query_TextCriterion
  • Whups_Form_Query_UserCriterion
  • Whups_Form_Renderer_Comment
  • Whups_Form_Search
  • Whups_Form_SendReminder
  • Whups_Form_Ticket_CreateStepFour
  • Whups_Form_Ticket_CreateStepOne
  • Whups_Form_Ticket_CreateStepThree
  • Whups_Form_Ticket_CreateStepTwo
  • Whups_Form_Ticket_Edit
  • Whups_Form_TicketDetails
  • Whups_LoginTasks_SystemTask_Upgrade
  • Whups_Mail
  • Whups_Query
  • Whups_Query_Manager
  • Whups_Reports
  • Whups_Ticket
  • Whups_View_Base
  • Whups_View_Results
  • Whups_View_SavedQueries
  • Overview
  • Package
  • Class
  • Tree

Class Whups

The Whups class provides functionality that all of Whups needs, or that should be encapsulated from other parts of the Whups system.

Package: Whups
Author: Robert E. Coyle robertecoyle@hotmail.com
Author: Jan Schneider jan@horde.org
Located at Whups.php
Methods summary
public static Horde_Url
# urlFor( string $controller, array|string $data, boolean $full = false, integer $append_session = 0 )

URL factory.

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

$b
The field to sort by.

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

Whups_Ticket
The current ticket.
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

$user
A user name.

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

Whups_Exception
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

Whups_Exception
if the VFS object cannot be created.
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'.
Constants summary
string VFS_ATTACH_PATH

Path to ticket attachments in the VFS.

Path to ticket attachments in the VFS.

# '.horde/whups/attachments'
API documentation generated by ApiGen