CoreAPI
[ class tree: CoreAPI ] [ index: CoreAPI ] [ all elements ]

Procedural File: filter_api.php

Source Location: /core/filter_api.php



Page Details:



Tags:

copyright:  Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
copyright:  Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
link:  http://www.mantisbt.org


Includes:

require_once('tag_api.php') [line 48]
requires tag_api

require_once('relationship_api.php') [line 44]
requires relationship_api

require_once('current_user_api.php') [line 28]
requires current_user_api

require_once('user_api.php') [line 32]
requires user_api

require_once('bug_api.php') [line 36]
requires bug_api

require_once('collapse_api.php') [line 40]
requires collapse_api

require_once($g_absolute_path.'config_filter_defaults_inc.php') [line 52]
requires config_filter_defaults_inc




mixed $g_cache_filter_db_filters [line 4307]

Default value:   array()


[ Top ]






filter_cache_result [line 2025]

array filter_cache_result( array $p_rows, array $p_id_array_lastmod)

Cache the filter results with bugnote stats for later use



Parameters

array   $p_rows   results of the filter query
array   $p_id_array_lastmod   array of bug ids
[ Top ]



filter_cache_row [line 4318]

mixed filter_cache_row( int $p_filter_id, [bool $p_trigger_errors = true])

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.



Parameters

int   $p_filter_id  
bool   $p_trigger_errors  
[ Top ]



filter_clear_cache [line 4355]

bool filter_clear_cache( [int $p_filter_id = null])

Clear the filter cache (or just the given id if specified)



Parameters

int   $p_filter_id  
[ Top ]



filter_db_can_delete_filter [line 4553]

bool filter_db_can_delete_filter( $p_filter_id $p_filter_id)

Check if the current user has permissions to delete the stored query



Parameters

$p_filter_id   $p_filter_id  
[ Top ]



filter_db_delete_current_filters [line 4605]

void filter_db_delete_current_filters( )

Delete all the unnamed filters



[ Top ]



filter_db_delete_filter [line 4583]

bool filter_db_delete_filter( $p_filter_id $p_filter_id)

Delete the filter specified by $p_filter_id



Parameters

$p_filter_id   $p_filter_id  
[ Top ]



filter_db_get_available_queries [line 4620]

mixed filter_db_get_available_queries( [int $p_project_id = null], [int $p_user_id = null])



Parameters

int   $p_project_id  
int   $p_user_id  
[ Top ]



filter_db_get_filter [line 4446]

mixed filter_db_get_filter( int $p_filter_id, [int $p_user_id = null])

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




Parameters

int   $p_filter_id  
int   $p_user_id  
[ Top ]



filter_db_get_name [line 4526]

string filter_db_get_name( int $p_filter_id)

Query for the filter name using the filter id



Parameters

int   $p_filter_id  
[ Top ]



filter_db_get_project_current [line 4494]

int filter_db_get_project_current( int $p_project_id, [int $p_user_id = null])



Parameters

int   $p_project_id  
int   $p_user_id  
[ Top ]



filter_db_set_for_current_user [line 4379]

int filter_db_set_for_current_user( int $p_project_id, bool $p_is_public, string $p_name, string $p_filter_string)

Add a filter to the database for the current user



Parameters

int   $p_project_id  
bool   $p_is_public  
string   $p_name  
string   $p_filter_string  
[ Top ]



filter_deserialize [line 787]

mixed filter_deserialize( string $p_serialized_filter)

Deserialize filter string



Tags:

return:  array
see:  filter_ensure_valid_filter()


Parameters

string   $p_serialized_filter  
[ Top ]



filter_draw_selection_area [line 2058]

void filter_draw_selection_area( int $p_page_number, [bool $p_for_screen = true])

Mainly based on filter_draw_selection_area2() but adds the support for the collapsible filter display.



Tags:



Parameters

int   $p_page_number  
bool   $p_for_screen  
[ Top ]



filter_draw_selection_area2 [line 2074]

void filter_draw_selection_area2( int $p_page_number, [bool $p_for_screen = true], [bool $p_expanded = true])

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.



Parameters

int   $p_page_number  
bool   $p_for_screen  
bool   $p_expanded  
[ Top ]



filter_encode_field_and_value [line 289]

string filter_encode_field_and_value( string $p_field_name, string $p_field_value, [ $p_field_type = null])

Encodes a field and it's value for the filter URL. This handles the URL encoding and arrays.



Tags:

return:  url encoded string


Parameters

string   $p_field_name   The field name.
string   $p_field_value   The field value (can be an array)
   $p_field_type  
[ Top ]



filter_ensure_valid_filter [line 440]

mixed filter_ensure_valid_filter( array $p_filter_arr)

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




Tags:

todo:  function needs to be abstracted


Parameters

array   $p_filter_arr  
[ Top ]



filter_field_is_any [line 316]

bool filter_field_is_any( string $p_field_value)

Checks the supplied value to see if it is an ANY value.



Tags:

return:  true for "ANY" values and false for others. "ANY" means filter criteria not active.


Parameters

string   $p_field_value   - The value to check.
[ Top ]



filter_field_is_myself [line 375]

bool filter_field_is_myself( string $p_field_value)

Checks the supplied value to see if it is a MYSELF value.



Tags:

return:  true for "MYSELF" values and false for others.


Parameters

string   $p_field_value   - The value to check.
[ Top ]



filter_field_is_none [line 350]

bool filter_field_is_none( string $p_field_value)

Checks the supplied value to see if it is a NONE value.



Tags:

return:  true for "NONE" values and false for others.
todo:  is a check for these necessary? if ( ( $t_filter_value === 'none' ) || ( $t_filter_value === '[none]' ) )


Parameters

string   $p_field_value   - The value to check.
[ Top ]



filter_get_bug_count [line 991]

int filter_get_bug_count( array $p_query_clauses)

Build a query with the query clauses array, query for bug count and return the result



Parameters

array   $p_query_clauses  
[ Top ]



filter_get_bug_rows [line 1020]

void filter_get_bug_rows( &$p_page_number, &$p_per_page, &$p_page_count, &$p_bug_count, [mixed $p_custom_filter = null], [int $p_project_id = null], [int $p_user_id = null], [bool $p_show_sticky = null], int $p_page_number, int $p_per_page, int $p_page_count, int $p_bug_count)



Tags:

todo:  Had to make all these parameters required because we can't use call-time pass by reference anymore. I really preferred not having to pass all the params in if you didn't want to, but I wanted to get rid of the errors for now. If we can think of a better way later (maybe return an object) that would be great.


Parameters

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



filter_get_default [line 734]

mixed filter_get_default( )

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.




[ Top ]



filter_get_field [line 867]

string filter_get_field( int $p_filter_id, string $p_field_name)

Get the value of the filter field specified by filter id and field name



Parameters

int   $p_filter_id  
string   $p_field_name  
[ Top ]



filter_get_plugin_filters [line 59]

array filter_get_plugin_filters( )

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



Tags:

return:  Mapping of field name to filter object


[ Top ]



filter_get_query_sort_data [line 886]

array filter_get_query_sort_data( &$p_filter, bool $p_show_sticky, array $p_query_clauses, array $p_filter)

Add sort parameters to the query clauses



Parameters

array   $p_filter  
bool   $p_show_sticky  
array   $p_query_clauses  
   &$p_filter  
[ Top ]



filter_get_row [line 857]

mixed filter_get_row( int $p_filter_id)

Get the array fields specified by $p_filter_id

using the cached row if it's available




Tags:

return:  a filter row


Parameters

int   $p_filter_id  
[ Top ]



filter_get_url [line 90]

string filter_get_url( array $p_custom_filter)

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.



Tags:

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


Parameters

array   $p_custom_filter  
[ Top ]



filter_is_cookie_valid [line 821]

bool filter_is_cookie_valid( )

Check if the filter cookie exists and is of the correct version.



[ Top ]



filter_name_valid_length [line 4669]

bool filter_name_valid_length( str $p_name)



Tags:

return:  true when under max_length (64) and false when over


Parameters

str   $p_name  
[ Top ]



filter_offset [line 429]

int filter_offset( int $p_page_number, int $p_per_page)

Figure out the offset into the db query, offset is which record to start querying from



Parameters

int   $p_page_number  
int   $p_per_page  
[ Top ]



filter_page_count [line 398]

$t_page_count filter_page_count( $p_count $p_count, $p_per_page $p_per_page)

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.




Parameters

$p_count   $p_count  
$p_per_page   $p_per_page  
[ Top ]



filter_per_page [line 384]

int filter_per_page( $p_count $p_filter, $p_per_page $p_count, $p_per_page)



Parameters

$p_count   $p_filter  
$p_per_page   $p_count  
   $p_per_page  
[ Top ]



filter_unique_query_clauses [line 979]

$p_query_clauses filter_unique_query_clauses( $p_query_clauses $p_query_clauses)

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.




Parameters

$p_query_clauses   $p_query_clauses  
[ Top ]



filter_valid_page_number [line 412]

void filter_valid_page_number( $p_page_number $p_page_number, $p_page_count $p_page_count)

Checks to make sure $p_page_number isn't past the last page.

and that $p_page_number isn't before the first page




Parameters

$p_page_number   $p_page_number  
$p_page_count   $p_page_count  
[ Top ]



print_filter_custom_field [line 4002]

void print_filter_custom_field( int $p_field_id)

print custom fields



Parameters

int   $p_field_id  
[ Top ]



print_filter_custom_field_date [line 4127]

void print_filter_custom_field_date( int $p_field_num, int $p_field_id)

print custom field date fields



Parameters

int   $p_field_num  
int   $p_field_id  
[ Top ]



print_filter_do_filter_by_date [line 3798]

void print_filter_do_filter_by_date( [ $p_hide_checkbox = false])

print filter by date fields with javascript



Tags:

todo:  Javascript should be removed and added dynamically via external script


Parameters

   $p_hide_checkbox  
[ Top ]



print_filter_handler_id [line 3524]

void print_filter_handler_id( )

print the handler field



[ Top ]



print_filter_hide_status [line 3649]

void print_filter_hide_status( )

print hide status field



[ Top ]



print_filter_highlight_changed [line 3786]

void print_filter_highlight_changed( )

print highlight changed field



[ Top ]



print_filter_note_user_id [line 3916]

void print_filter_note_user_id( )

print note reporter field



[ Top ]



print_filter_os [line 3580]

void print_filter_os( )

print the os field



[ Top ]



print_filter_os_build [line 3595]

void print_filter_os_build( )

print the os build field



[ Top ]



print_filter_per_page [line 3744]

void print_filter_per_page( )

print issues per page field



[ Top ]



print_filter_platform [line 3562]

void print_filter_platform( )

print the platform field



[ Top ]



print_filter_plugin_field [line 3944]

void print_filter_plugin_field( string $p_field_name, object Filter $p_filter_object)

Print plugin filter fields as defined by MantisFilter objects.



Parameters

string   $p_field_name   Field name
object Filter   $p_filter_object   object
[ Top ]



print_filter_project_id [line 4239]

void print_filter_project_id( )

print project field



[ Top ]



print_filter_relationship_type [line 3880]

void print_filter_relationship_type( )

print relationship fields



[ Top ]



print_filter_reporter_id [line 3462]

void print_filter_reporter_id( )

Print the reporter field



[ Top ]



print_filter_show_build [line 3662]

void print_filter_show_build( )

print build field



[ Top ]



print_filter_show_category [line 3548]

void print_filter_show_category( )

print the category field



[ Top ]



print_filter_show_fixed_in_version [line 3690]

void print_filter_show_fixed_in_version( )

print fixed in version field



[ Top ]



print_filter_show_priority [line 3718]

void print_filter_show_priority( )

print priority field



[ Top ]



print_filter_show_profile [line 3731]

void print_filter_show_profile( )

print profile field



[ Top ]



print_filter_show_resolution [line 3623]

void print_filter_show_resolution( )

print resolution field



[ Top ]



print_filter_show_severity [line 3610]

void print_filter_show_severity( )

print the severity field



[ Top ]



print_filter_show_sort [line 4049]

void print_filter_show_sort( )

print sort fields



[ Top ]



print_filter_show_status [line 3636]

void print_filter_show_status( )

print status field



[ Top ]



print_filter_show_target_version [line 3704]

void print_filter_show_target_version( )

print target version field



[ Top ]



print_filter_show_version [line 3676]

void print_filter_show_version( )

print version field



[ Top ]



print_filter_sticky_issues [line 3776]

void print_filter_sticky_issues( )

print sticky issues field



[ Top ]



print_filter_tag_string [line 3893]

void print_filter_tag_string( )

print tag fields



[ Top ]



print_filter_user_monitor [line 3498]

void print_filter_user_monitor( )

Print the user monitor field



[ Top ]



print_filter_view_state [line 3754]

void print_filter_view_state( )

print view state field



[ Top ]



print_multivalue_field [line 4255]

void print_multivalue_field( string $p_field_name, mixed $p_field_value)

Prints a multi-value filter field.



Parameters

string   $p_field_name  
mixed   $p_field_value  
[ Top ]



Documentation generated on Sun, 12 Dec 2010 23:50:28 +0900 by phpDocumentor 1.4.3
inserted by FC2 system