Class Whups

Description

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

Located in /lib/Whups.php (line 26)


	
			
Method Summary
 string addInlineScript (mixed $script)
 void attachmentUrl ( $ticket,  $file,  $queue)
 array fieldTypeNames ()
 array fieldTypeParams (string $field_type)
 array fieldTypes ()
 void formatUser ([string|array $user = null], [boolean $showemail = true], [boolean $showname = true], [boolean $html = false])
 void getAttachments ( $ticket, [ $name = null])
 string getCAPTCHA ([boolean $new = false])
 void getMenu ([ $returnType = 'object'])
 void getOwnerCriteria ( $user)
 void getOwners ( $ticket, [ $showemail = true], [ $showname = true], [ $owners = null])
 void getSearchResultColumns ([integer $search_type = null])
 void getTicketTabs ( &$vars,  $id)
 void getUserAttributes ([ $user = null])
 boolean hasPermission (mixed $in, string $filter, string|integer $permission, [string $user = null])
 array listTemplates (string $type)
 string outputInlineScript ()
 array permissionsFilter (array $in, string $filter, [integer $permission = PERMS_READ], [string $user = null], [string $creator = null])
 void sendReminders (Variables &$vars)
 void sortBy ([ $b = null])
 void sortDir ([ $d = null])
 void sortTickets ( &$tickets, [ $by = null], [ $dir = null])
 void urlFor ( $controller,  $data, [ $full = false], [ $append_session = 0])
 void _sort ( $a,  $b, [ $sortby = null], [ $sortdir = null])
Methods
addInlineScript (line 905)

Add inline javascript to the output buffer.

  • return: The javascript text to output, or empty if the page headers have not yet been sent.
string addInlineScript (mixed $script)
  • mixed $script: The script text to add (can be stored in an array also).
attachmentUrl (line 822)
void attachmentUrl ( $ticket,  $file,  $queue)
  • $ticket
  • $file
  • $queue
fieldTypeNames (line 988)

Returns the available field type names from the Horde_Form classes.

  • return: A hash The with available field types and names.
array fieldTypeNames ()
fieldTypeParams (line 1012)

Returns the parameters for a certain Horde_Form field type.

  • return: A list of field type parameters.
array fieldTypeParams (string $field_type)
  • string $field_type: A field type.
fieldTypes (line 952)

Retruns the available field types including all type information from the Horde_Form classes.

  • return: The full field types array.
array fieldTypes ()
formatUser (line 610)

Returns a user string from the user's name and email address.

void formatUser ([string|array $user = null], [boolean $showemail = true], [boolean $showname = true], [boolean $html = false])
  • string|array $user: A user name or a hash as returned from Whups::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.
getAttachments (line 790)
void getAttachments ( $ticket, [ $name = null])
  • $ticket
  • $name
getCAPTCHA (line 224)

Returns a new or the current CAPTCHA string.

  • return: A CAPTCHA string.
string getCAPTCHA ([boolean $new = false])
  • boolean $new: If true, a new CAPTCHA is created and returned. The current, to-be-confirmed string otherwise.
getCurrentTicket (line 261)

Get the current ticket - use 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.

void getCurrentTicket ()
getMenu (line 762)

Build Whups' list of menu items.

void getMenu ([ $returnType = 'object'])
  • $returnType
getOwnerCriteria (line 503)
void getOwnerCriteria ( $user)
  • $user
getOwners (line 877)
void getOwners ( $ticket, [ $showemail = true], [ $showname = true], [ $owners = null])
  • $ticket
  • $showemail
  • $showname
  • $owners
getSearchResultColumns (line 667)

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.

void getSearchResultColumns ([integer $search_type = null])
  • integer $search_type: The type of search that was executed. Must be one of the WHUPS_SEARCH_ constants defined above.
getTicketTabs (line 291)

Get the tabs for navigating between ticket actions.

void getTicketTabs ( &$vars,  $id)
  • &$vars
  • $id
getUserAttributes (line 517)
void getUserAttributes ([ $user = null])
  • $user
hasPermission (line 341)

Returns whether a user has a certain permission on a single resource.

  • return: True if the user has the specified permission.
boolean hasPermission (mixed $in, string $filter, string|integer $permission, [string $user = null])
  • 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', or one of the PERM_* constants.
  • string $user: A user name.
listTemplates (line 242)

List all templates of a given type.

  • return: All templates of the requested type.
array listTemplates (string $type)
  • string $type: The kind of template ('searchresults', etc.) to list.
outputInlineScript (line 933)

Print inline javascript to the output buffer.

  • return: The javascript text to output.
string outputInlineScript ()
permissionsFilter (line 415)

Filters a list of resources based on whether a user use certain permissions on it.

  • return: The list of resources matching the permission criteria.
array permissionsFilter (array $in, string $filter, [integer $permission = PERMS_READ], [string $user = null], [string $creator = null])
  • 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.
sendReminders (line 698)

Send reminders. One email per user.

void sendReminders (Variables &$vars)
  • Variables &$vars: The selection criteria.
sortBy (line 132)
void sortBy ([ $b = null])
  • $b
sortDir (line 143)
void sortDir ([ $d = null])
  • $d
sortTickets (line 117)
void sortTickets ( &$tickets, [ $by = null], [ $dir = null])
  • &$tickets
  • $by
  • $dir
urlFor (line 28)
void urlFor ( $controller,  $data, [ $full = false], [ $append_session = 0])
  • $controller
  • $data
  • $full
  • $append_session
_sort (line 154)
void _sort ( $a,  $b, [ $sortby = null], [ $sortdir = null])
  • $a
  • $b
  • $sortby
  • $sortdir

Documentation generated on Sun, 30 Jan 2011 05:41:45 +0000 by phpDocumentor 1.4.3