[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/core/ -> filter_api.php (summary)

Filter API

Copyright: Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
Copyright: Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net
File Size: 4663 lines (171 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 65 functions

  filter_get_plugin_filters()
  filter_get_url()
  filter_encode_field_and_value()
  filter_field_is_any()
  filter_field_is_none()
  filter_field_is_myself()
  filter_per_page()
  filter_page_count()
  filter_valid_page_number()
  filter_offset()
  filter_ensure_valid_filter()
  filter_get_default()
  filter_deserialize()
  filter_is_cookie_valid()
  filter_get_row()
  filter_get_field()
  filter_get_query_sort_data()
  filter_unique_query_clauses()
  filter_get_bug_count()
  filter_get_bug_rows()
  filter_cache_result()
  filter_draw_selection_area()
  filter_draw_selection_area2()
  print_filter_reporter_id()
  print_filter_user_monitor()
  print_filter_handler_id()
  print_filter_show_category()
  print_filter_platform()
  print_filter_os()
  print_filter_os_build()
  print_filter_show_severity()
  print_filter_show_resolution()
  print_filter_show_status()
  print_filter_hide_status()
  print_filter_show_build()
  print_filter_show_version()
  print_filter_show_fixed_in_version()
  print_filter_show_target_version()
  print_filter_show_priority()
  print_filter_show_profile()
  print_filter_per_page()
  print_filter_view_state()
  print_filter_sticky_issues()
  print_filter_highlight_changed()
  print_filter_do_filter_by_date()
  print_filter_relationship_type()
  print_filter_tag_string()
  print_filter_note_user_id()
  print_filter_plugin_field()
  print_filter_custom_field()
  print_filter_show_sort()
  print_filter_custom_field_date()
  print_filter_project_id()
  print_multivalue_field()
  filter_cache_row()
  filter_clear_cache()
  filter_db_set_for_current_user()
  filter_db_get_filter()
  filter_db_get_project_current()
  filter_db_get_name()
  filter_db_can_delete_filter()
  filter_db_delete_filter()
  filter_db_delete_current_filters()
  filter_db_get_available_queries()
  filter_name_valid_length()

Functions
Functions that are not part of a class:

filter_get_plugin_filters()   X-Ref
Allow plugins to define a set of class-based filters, and register/load
them here to be used by the rest of filter_api.

return: array Mapping of field name to filter object

filter_get_url( $p_custom_filter )   X-Ref
Get a permalink for the current active filter.  The results of using these fields by other users
can be inconsistent with the original results due to fields like "Myself", "Current Project",
and due to access level.

param: array $p_custom_filter
return: string the search.php?xxxx or an empty string if no criteria applied.

filter_encode_field_and_value( $p_field_name, $p_field_value, $p_field_type=null )   X-Ref
Encodes a field and it's value for the filter URL.  This handles the URL encoding
and arrays.

param: string $p_field_name The field name.
param: string $p_field_value The field value (can be an array)
return: string url encoded string

filter_field_is_any( $p_field_value )   X-Ref
Checks the supplied value to see if it is an ANY value.

param: string $p_field_value - The value to check.
return: bool true for "ANY" values and false for others.  "ANY" means filter criteria not active.

filter_field_is_none( $p_field_value )   X-Ref
Checks the supplied value to see if it is a NONE value.

param: string $p_field_value - The value to check.
return: bool true for "NONE" values and false for others.

filter_field_is_myself( $p_field_value )   X-Ref
Checks the supplied value to see if it is a MYSELF value.

param: string $p_field_value - The value to check.
return: bool true for "MYSELF" values and false for others.

filter_per_page( $p_filter, $p_count, $p_per_page )   X-Ref

param: $p_count
param: $p_per_page
return: int

filter_page_count( $p_count, $p_per_page )   X-Ref
Use $p_count and $p_per_page to determine how many pages to split this list up into.
For the sake of consistency have at least one page, even if it is empty.

param: $p_count
param: $p_per_page
return: $t_page_count

filter_valid_page_number( $p_page_number, $p_page_count )   X-Ref
Checks to make sure $p_page_number isn't past the last page.
and that $p_page_number isn't before the first page

param: $p_page_number
param: $p_page_count

filter_offset( $p_page_number, $p_per_page )   X-Ref
Figure out the offset into the db query, offset is which record to start querying from

param: int $p_page_number
param: int $p_per_page
return: int

filter_ensure_valid_filter( $p_filter_arr )   X-Ref
Make sure that our filters are entirely correct and complete (it is possible that they are not).
We need to do this to cover cases where we don't have complete control over the filters given.s

param: array $p_filter_arr
return: mixed

filter_get_default()   X-Ref
Get the standard filter that is to be used when no filter was previously saved.
When creating specific filters, this can be used as a basis for the filter, where
specific entries can be overridden.

return: mixed

filter_deserialize( $p_serialized_filter )   X-Ref
Deserialize filter string

param: string $p_serialized_filter
return: mixed $t_filter array

filter_is_cookie_valid()   X-Ref
Check if the filter cookie exists and is of the correct version.

return: bool

filter_get_row( $p_filter_id )   X-Ref
Get the array fields specified by $p_filter_id
using the cached row if it's available

param: int $p_filter_id
return: mixed a filter row

filter_get_field( $p_filter_id, $p_field_name )   X-Ref
Get the value of the filter field specified by filter id and field name

param: int $p_filter_id
param: string $p_field_name
return: string

filter_get_query_sort_data( &$p_filter, $p_show_sticky, $p_query_clauses )   X-Ref
Add sort parameters to the query clauses

param: array $p_filter
param: bool $p_show_sticky
param: array $p_query_clauses
return: array $p_query_clauses

filter_unique_query_clauses( $p_query_clauses )   X-Ref
Remove any duplicate values in certain elements of query_clauses
Do not loop over query clauses as some keys may contain valid duplicate values.
We basically want unique values for just the base query elements select, from, and join
'where' and 'where_values' key should not have duplicates as that is handled earlier and applying
array_unique here could cause problems with the query.

param: $p_query_clauses
return: $p_query_clauses

filter_get_bug_count( $p_query_clauses )   X-Ref
Build a query with the query clauses array, query for bug count and return the result

param: array $p_query_clauses
return: int

filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p_bug_count, $p_custom_filter = null, $p_project_id = null, $p_user_id = null, $p_show_sticky = null )   X-Ref

param: int $p_page_number the page you want to see (set to the actual page on return)
param: int $p_per_page the number of bugs to see per page (set to actual on return)
param: int $p_page_count you don't need to give a value here, the number of pages will be stored here on return
param: int $p_bug_count you don't need to give a value here, the number of bugs will be stored here on return
param: mixed $p_custom_filter Filter to use.
param: int $p_project_id project id to use in filtering.
param: int $p_user_id user id to use as current user when filtering.
param: bool $p_show_sticky get sticky issues only.

filter_cache_result( $p_rows, $p_id_array_lastmod )   X-Ref
Cache the filter results with bugnote stats for later use

param: array $p_rows results of the filter query
param: array $p_id_array_lastmod array of bug ids
return: array

filter_draw_selection_area( $p_page_number, $p_for_screen = true )   X-Ref
Mainly based on filter_draw_selection_area2() but adds the support for the collapsible
filter display.

param: int $p_page_number
param: bool $p_for_screen

filter_draw_selection_area2( $p_page_number, $p_for_screen = true, $p_expanded = true )   X-Ref
Prints the filter selection area for both the bug list view screen and
the bug list print screen. This function was an attempt to make it easier to
add new filters and rearrange them on screen for both pages.

param: int $p_page_number
param: bool $p_for_screen
param: bool $p_expanded

print_filter_reporter_id()   X-Ref
Print the reporter field


print_filter_user_monitor()   X-Ref
Print the user monitor field


print_filter_handler_id()   X-Ref
print the handler field


print_filter_show_category()   X-Ref
print the category field


print_filter_platform()   X-Ref
print the platform field


print_filter_os()   X-Ref
print the os field


print_filter_os_build()   X-Ref
print the os build field


print_filter_show_severity()   X-Ref
print the severity field


print_filter_show_resolution()   X-Ref
print resolution field


print_filter_show_status()   X-Ref
print status field


print_filter_hide_status()   X-Ref
print hide status field


print_filter_show_build()   X-Ref
print build field


print_filter_show_version()   X-Ref
print version field


print_filter_show_fixed_in_version()   X-Ref
print fixed in version field


print_filter_show_target_version()   X-Ref
print target version field


print_filter_show_priority()   X-Ref
print priority field


print_filter_show_profile()   X-Ref
print profile field


print_filter_per_page()   X-Ref
print issues per page field


print_filter_view_state()   X-Ref
print view state field


print_filter_sticky_issues()   X-Ref
print sticky issues field


print_filter_highlight_changed()   X-Ref
print highlight changed field


print_filter_do_filter_by_date( $p_hide_checkbox = false )   X-Ref
print filter by date fields


print_filter_relationship_type()   X-Ref
print relationship fields


print_filter_tag_string()   X-Ref
print tag fields


print_filter_note_user_id()   X-Ref
print note reporter field


print_filter_plugin_field( $p_field_name, $p_filter_object )   X-Ref
Print plugin filter fields as defined by MantisFilter objects.

param: string Field name
param: object Filter object

print_filter_custom_field( $p_field_id )   X-Ref
print custom fields

param: int $p_field_id

print_filter_show_sort()   X-Ref
print sort fields


print_filter_custom_field_date( $p_field_num, $p_field_id )   X-Ref
print custom field date fields

param: int $p_field_num
param: int $p_field_id

print_filter_project_id()   X-Ref
print project field


print_multivalue_field( $p_field_name, $p_field_value )   X-Ref
Prints a multi-value filter field.

param: string $p_field_name
param: mixed $p_field_value

filter_cache_row( $p_filter_id, $p_trigger_errors = true )   X-Ref
Cache a filter row if necessary and return the cached copy
If the second parameter is true (default), trigger an error
if the filter can't be found.  If the second parameter is
false, return false if the filter can't be found.

param: int $p_filter_id
param: bool $p_trigger_errors
return: mixed

filter_clear_cache( $p_filter_id = null )   X-Ref
Clear the filter cache (or just the given id if specified)

param: int $p_filter_id
return: bool

filter_db_set_for_current_user( $p_project_id, $p_is_public, $p_name, $p_filter_string )   X-Ref
Add a filter to the database for the current user

param: int $p_project_id
param: bool $p_is_public
param: string $p_name
param: string $p_filter_string
return: int

filter_db_get_filter( $p_filter_id, $p_user_id = null )   X-Ref
This function returns the filter string that is
tied to the unique id parameter. If the user doesn't
have permission to see this filter, the function
returns null

param: int $p_filter_id
param: int $p_user_id
return: mixed

filter_db_get_project_current( $p_project_id, $p_user_id = null )   X-Ref

param: int $p_project_id
param: int $p_user_id
return: int

filter_db_get_name( $p_filter_id )   X-Ref
Query for the filter name using the filter id

param: int $p_filter_id
return: string

filter_db_can_delete_filter( $p_filter_id )   X-Ref
Check if the current user has permissions to delete the stored query

param: $p_filter_id
return: bool

filter_db_delete_filter( $p_filter_id )   X-Ref
Delete the filter specified by $p_filter_id

param: $p_filter_id
return: bool

filter_db_delete_current_filters()   X-Ref
Delete all the unnamed filters


filter_db_get_available_queries( $p_project_id = null, $p_user_id = null )   X-Ref

param: int $p_project_id
param: int $p_user_id
return: mixed

filter_name_valid_length( $p_name )   X-Ref

param: str $p_name
return: bool true when under max_length (64) and false when over



Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7