PHP 클래스 Whups, horde

저자: Robert E. Coyle ([email protected])
저자: Jan Schneider ([email protected])
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_fieldTypes array All available form field types including all type information from the Horde_Form classes.
$_sortBy string The current sort field.
$_sortDir integer The current sort direction.
$_users array Cached list of user information.

공개 메소드들

메소드 설명
addFeedLink ( )
addTopbarSearch ( ) Adds topbar search to page
attachmentUrl ( integer $ticket, string $file, integer $queue ) : array Returns the links to view, download, and delete an attachment.
fieldTypeNames ( ) : array Returns the available field type names from the Horde_Form classes.
fieldTypeParams ( string $field_type ) : array Returns the parameters for a certain Horde_Form field type.
fieldTypes ( ) : array Returns all available form field types including all type information from the Horde_Form classes.
formatColumn ( array $info, string $value ) : string Formats a ticket property for a tabular ticket listing.
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.
getAddressbookSearchParams ( ) : array Returns the parameters necessary to run an address search.
getAttachments ( integer $ticket, string $name = null ) : array Returns attachment information hashes from the VFS backend.
getCAPTCHA ( boolean $new = false ) : string Returns a new or the current CAPTCHA string.
getCurrentTicket ( ) : Whups_Ticket Returns the current ticket.
getOwnerCriteria ( string $user ) : array Builds a list of criteria for Whups_Driver#getTicketsByProperties() that match a certain user.
getOwners ( integer $ticket, $showemail = true, boolean $showname = true, array $owners = null ) : string Returns formatted owner names of a ticket.
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.
getTicketTabs ( &$vars, $id ) Returns the tabs for navigating between ticket actions.
getUserAttributes ( string $user = null ) : array Returns a hash with user information.
hasMessage ( integer $ticket, integer $id ) : boolean Returns whether an original message for a ticket comment exists.
hasPermission ( mixed $in, string $filter, string | integer $permission, string $user = null ) : boolean Returns whether a user has a certain permission on a single resource.
listTemplates ( string $type ) : array Lists all templates of a given type.
messageUrls ( integer $ticket, $message, integer $queue ) : array Returns the links to view, download, and delete an original message.
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.
sendReminders ( Horde_Variables $vars ) Sends reminders, one email per user.
sortBy ( string $b = null ) : string Sets or returns the current sort field.
sortDir ( integer $d = null ) : integer Sets or returns the current sort direction.
sortTickets ( array &$tickets, string $by = null, string $dir = null ) Sorts tickets by requested direction and fields.
urlFor ( string $controller, array | string $data, boolean $full = false, integer $append_session ) : Horde_Url URL factory.

보호된 메소드들

메소드 설명
_prepareSort ( array $ticket ) : array Helper method to prepare an array of tickets for sorting.
_sort ( array $a, array $b, string $sortby = null, string $sortdir = null ) : integer Helper method to sort an array of tickets.

메소드 상세

_prepareSort() 보호된 정적인 메소드

Adds a sort_by key to each ticket array, with values lowercased. Used as a callback to array_map().
protected static _prepareSort ( array $ticket ) : array
$ticket array The ticket array to prepare.
리턴 array The altered $ticket array

_sort() 보호된 정적인 메소드

Used as callback to usort().
protected static _sort ( array $a, array $b, string $sortby = null, string $sortdir = null ) : integer
$a array The first ticket to compare.
$b array The second ticket to compare.
$sortby string The field to sort by. If null, uses the field from self::sortBy().
$sortdir string The direction to sort. If null, uses the value from self::sortDir().
리턴 integer

addTopbarSearch() 공개 정적인 메소드

Adds topbar search to page
public static addTopbarSearch ( )

attachmentUrl() 공개 정적인 메소드

Returns the links to view, download, and delete an attachment.
public static attachmentUrl ( integer $ticket, string $file, integer $queue ) : array
$ticket integer A ticket ID.
$file string An attachment name.
$queue integer The ticket's queue ID.
리턴 array List of URLs.

fieldTypeNames() 공개 정적인 메소드

Returns the available field type names from the Horde_Form classes.
public static fieldTypeNames ( ) : array
리턴 array A hash The with available field types and names.

fieldTypeParams() 공개 정적인 메소드

Returns the parameters for a certain Horde_Form field type.
public static fieldTypeParams ( string $field_type ) : array
$field_type string A field type.
리턴 array A list of field type parameters.

fieldTypes() 공개 정적인 메소드

Returns all available form field types including all type information from the Horde_Form classes.
public static fieldTypes ( ) : array
리턴 array The full field types array.

formatColumn() 공개 정적인 메소드

Formats a ticket property for a tabular ticket listing.
public static formatColumn ( array $info, string $value ) : string
$info array A ticket information hash.
$value string The column/property to format.
리턴 string The formatted property.

formatUser() 공개 정적인 메소드

Returns a user string from the user's name and email address.
public static formatUser ( string | array $user = null, boolean $showemail = true, boolean $showname = true, boolean $html = false )
$user string | array A user name or a hash as returned from {@link self::getUserAttributes()}.
$showemail boolean Whether to include the email address.
$showname boolean Whether to include the full name.
$html boolean 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.

getAddressbookSearchParams() 공개 정적인 메소드

Returns the parameters necessary to run an address search.
public static getAddressbookSearchParams ( ) : array
리턴 array An array with two keys: 'sources' and 'fields'.

getAttachments() 공개 정적인 메소드

Returns attachment information hashes from the VFS backend.
public static getAttachments ( integer $ticket, string $name = null ) : array
$ticket integer A ticket ID.
$name string An attachment name.
리턴 array If $name is empty a list of all attachments' information hashes, otherwise only the hash for the attachment of that name.

getCAPTCHA() 공개 정적인 메소드

Returns a new or the current CAPTCHA string.
public static getCAPTCHA ( boolean $new = false ) : string
$new boolean If true, a new CAPTCHA is created and returned. The current, to-be-confirmed string otherwise.
리턴 string A CAPTCHA string.

getCurrentTicket() 공개 정적인 메소드

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.
public static getCurrentTicket ( ) : Whups_Ticket
리턴 Whups_Ticket The current ticket.

getOwnerCriteria() 공개 정적인 메소드

Merges the user's groups with the user name.
public static getOwnerCriteria ( string $user ) : array
$user string A user name.
리턴 array A list of criteria that would match the user.

getOwners() 공개 정적인 메소드

Returns formatted owner names of a ticket.
public static getOwners ( integer $ticket, $showemail = true, boolean $showname = true, array $owners = null ) : string
$ticket integer A ticket id. Only used if $owners is null.
$showname boolean Should we include the name in the output?
$owners array 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.
리턴 string The formatted owner string.

getSearchResultColumns() 공개 정적인 메소드

The results can depend on the current user preferences, which search function was executed, and the $columns parameter.
public static getSearchResultColumns ( integer $search_type = null, array $columns = null )
$search_type integer The type of search that was executed. Currently only 'block' is supported.
$columns array The columns to return, overriding the defaults for some $search_type.

getTicketTabs() 공개 정적인 메소드

Returns the tabs for navigating between ticket actions.
public static getTicketTabs ( &$vars, $id )

getUserAttributes() 공개 정적인 메소드

Returns a hash with user information.
public static getUserAttributes ( string $user = null ) : array
$user string A (Whups) user name, defaults to the current user.
리턴 array An information hash with 'user', 'name', 'email', and 'type' values.

hasMessage() 공개 정적인 메소드

Returns whether an original message for a ticket comment exists.
public static hasMessage ( integer $ticket, integer $id ) : boolean
$ticket integer A ticket ID.
$id integer A message ID.
리턴 boolean True if the original message exists.

hasPermission() 공개 정적인 메소드

Returns whether a user has a certain permission on a single resource.
public static hasPermission ( mixed $in, string $filter, string | integer $permission, string $user = null ) : boolean
$in mixed A single resource to check.
$filter string The kind of resource specified in $in, currently only 'queue'.
$permission string | integer A permission, either 'assign' or 'update', 'requester', or one of the PERM_* constants.
$user string A user name.
리턴 boolean True if the user has the specified permission.

listTemplates() 공개 정적인 메소드

Lists all templates of a given type.
public static listTemplates ( string $type ) : array
$type string The kind of template ('searchresults', etc.) to list.
리턴 array All templates of the requested type.

messageUrls() 공개 정적인 메소드

Returns the links to view, download, and delete an original message.
public static messageUrls ( integer $ticket, $message, integer $queue ) : array
$ticket integer A ticket ID.
$queue integer The ticket's queue ID.
리턴 array List of URLs.

permissionsFilter() 공개 정적인 메소드

Filters a list of resources based on whether a user has certain permissions on it.
public static permissionsFilter ( array $in, string $filter, integer $permission = Horde_Perms::READ, string $user = null, string $creator = null ) : array
$in array A list of resources to check.
$filter string The kind of resource specified in $in, one of 'queue', 'queue_id', 'reply', or 'comment'.
$permission integer A permission, one of the PERM_* constants.
$user string A user name.
$creator string The creator of an object in the resource, e.g. a ticket creator.
리턴 array The list of resources matching the permission criteria.

sendReminders() 공개 정적인 메소드

Sends reminders, one email per user.
public static sendReminders ( Horde_Variables $vars )
$vars Horde_Variables 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.

sortBy() 공개 정적인 메소드

Sets or returns the current sort field.
public static sortBy ( string $b = null ) : string
$b string The field to sort by.
리턴 string If $b is null, returns the previously set value.

sortDir() 공개 정적인 메소드

Sets or returns the current sort direction.
public static sortDir ( integer $d = null ) : integer
$d integer The direction to sort by.
리턴 integer If $d is null, returns the previously set value.

sortTickets() 공개 정적인 메소드

Sorts tickets by requested direction and fields.
public static sortTickets ( array &$tickets, string $by = null, string $dir = null )
$tickets array The list of tickets to sort.
$by string The field to sort by. If omitted, obtain from preferences.
$dir string The direction to sort. If omitted, obtain from preferences.

urlFor() 공개 정적인 메소드

URL factory.
public static urlFor ( string $controller, array | string $data, boolean $full = false, integer $append_session ) : Horde_Url
$controller string The controller to link to, one of 'queue', 'ticket', 'ticket_rss', 'ticket_action', 'query', 'query_rss'.
$data array | string URL data, depending on the controller.
$full boolean @see Horde::url()
$append_session integer @see Horde::url()
리턴 Horde_Url The generated URL.

프로퍼티 상세

$_fieldTypes 보호되어 있는 정적으로 프로퍼티

All available form field types including all type information from the Horde_Form classes.
또한 보기: fieldTypes()
protected static array $_fieldTypes
리턴 array

$_sortBy 보호되어 있는 정적으로 프로퍼티

The current sort field.
또한 보기: sortBy()
protected static string $_sortBy
리턴 string

$_sortDir 보호되어 있는 정적으로 프로퍼티

The current sort direction.
또한 보기: sortDir()
protected static int $_sortDir
리턴 integer

$_users 보호되어 있는 정적으로 프로퍼티

Cached list of user information.
또한 보기: getUserAttributes()
protected static array $_users
리턴 array