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

Procedural File: filter_api.php

Source Location: /core/filter_api.php

Page Details
Copyright:  Copyright (C) 2002 - 2009 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 ($t_core_dir.'tag_api.php') [line 50]

requires tag_api

[ Top ]

require_once ($t_core_dir.'relationship_api.php') [line 46]

requires relationship_api

[ Top ]

require_once ($t_core_dir.'current_user_api.php') [line 30]

requires current_user_api

[ Top ]

require_once ($t_core_dir.'user_api.php') [line 34]

requires user_api

[ Top ]

require_once ($t_core_dir.'bug_api.php') [line 38]

requires bug_api

[ Top ]

require_once ($t_core_dir.'collapse_api.php') [line 42]

requires collapse_api

[ Top ]

requires config_filter_defaults_inc

[ Top ]


Globals
mixed   $g_cache_filter_db_filters [line 4024]
Default value:  array()

[ Top ]


Functions
filter_cache_result  [line 1883]

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 4035]

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 4072]

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 4274]

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 4327]

void filter_db_delete_current_filters( )

Delete all the unnamed filters



[ Top ]
filter_db_delete_filter  [line 4304]

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 4342]

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 4163]

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 4245]

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 4213]

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 4096]

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 717]

mixed filter_deserialize( string $p_serialized_filter  )

Deserialize filter string

Parameters:
string   $p_serialized_filter: 

API Tags:
Return:  array
See:  filter_ensure_valid_filter()


[ Top ]
filter_draw_selection_area  [line 1916]

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.

Parameters:
int   $p_page_number: 
bool   $p_for_screen: 

API Tags:
See:  filter_draw_selection_area2()


[ Top ]
filter_draw_selection_area2  [line 1932]

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 254]

string filter_encode_field_and_value( string $p_field_name, string $p_field_value  )

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

Parameters:
string   $p_field_name:  The field name.
string   $p_field_value:  The field value (can be an array)

API Tags:
Return:  url encoded string


[ Top ]
filter_ensure_valid_filter  [line 405]

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

Parameters:
array   $p_filter_arr: 

Information Tags:
Todo:  function needs to be abstracted

[ Top ]
filter_field_is_any  [line 281]

bool filter_field_is_any( string $p_field_value  )

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

Parameters:
string   $p_field_value:  - The value to check.

API Tags:
Return:  true for "ANY" values and false for others. "ANY" means filter criteria not active.


[ Top ]
filter_field_is_myself  [line 340]

bool filter_field_is_myself( string $p_field_value  )

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

Parameters:
string   $p_field_value:  - The value to check.

API Tags:
Return:  true for "MYSELF" values and false for others.


[ Top ]
filter_field_is_none  [line 315]

bool filter_field_is_none( string $p_field_value  )

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

Parameters:
string   $p_field_value:  - The value to check.

API Tags:
Return:  true for "NONE" values and false for others.

Information Tags:
Todo:  is a check for these necessary? if ( ( $t_filter_value === 'none' ) || ( $t_filter_value === '[none]' ) )

[ Top ]
filter_get_bug_count  [line 899]

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 928]

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  )
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: 

Information 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.

[ Top ]
filter_get_default  [line 664]

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 797]

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_query_sort_data  [line 816]

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 787]

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

Parameters:
int   $p_filter_id: 

API Tags:
Return:  a filter row


[ Top ]
filter_get_url  [line 63]

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.

Parameters:
array   $p_custom_filter: 

API Tags:
Return:  the search.php?xxxx or an empty string if no criteria applied.


[ Top ]
filter_is_cookie_valid  [line 751]

bool filter_is_cookie_valid( )

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



[ Top ]
filter_name_valid_length  [line 4391]

bool filter_name_valid_length( str $p_name  )
Parameters:
str   $p_name: 

API Tags:
Return:  true when under max_length (64) and false when over


[ Top ]
filter_offset  [line 394]

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 363]

$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 349]

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 887]

$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 377]

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 3719]

void print_filter_custom_field( int $p_field_id  )

print custom fields

Parameters:
int   $p_field_id: 


[ Top ]
print_filter_custom_field_date  [line 3844]

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 3575]

void print_filter_do_filter_by_date( [ $p_hide_checkbox = false]  )

print filter by date fields with javascript

Parameters:
   $p_hide_checkbox: 

Information Tags:
Todo:  Javascript should be removed and added dynamically via external script

[ Top ]
print_filter_handler_id  [line 3300]

void print_filter_handler_id( )

print the handler field



[ Top ]
print_filter_hide_status  [line 3426]

void print_filter_hide_status( )

print hide status field



[ Top ]
print_filter_highlight_changed  [line 3563]

void print_filter_highlight_changed( )

print highlight changed field



[ Top ]
print_filter_note_user_id  [line 3693]

void print_filter_note_user_id( )

print note reporter field



[ Top ]
print_filter_os  [line 3357]

void print_filter_os( )

print the os field



[ Top ]
print_filter_os_build  [line 3372]

void print_filter_os_build( )

print the os build field



[ Top ]
print_filter_per_page  [line 3521]

void print_filter_per_page( )

print issues per page field



[ Top ]
print_filter_platform  [line 3339]

void print_filter_platform( )

print the platform field



[ Top ]
print_filter_project_id  [line 3956]

void print_filter_project_id( )

print project field



[ Top ]
print_filter_relationship_type  [line 3657]

void print_filter_relationship_type( )

print relationship fields



[ Top ]
print_filter_reporter_id  [line 3236]

void print_filter_reporter_id( )

Print the reporter field



[ Top ]
print_filter_show_build  [line 3439]

void print_filter_show_build( )

print build field



[ Top ]
print_filter_show_category  [line 3325]

void print_filter_show_category( )

print the category field



[ Top ]
print_filter_show_fixed_in_version  [line 3467]

void print_filter_show_fixed_in_version( )

print fixed in version field



[ Top ]
print_filter_show_priority  [line 3495]

void print_filter_show_priority( )

print priority field



[ Top ]
print_filter_show_profile  [line 3508]

void print_filter_show_profile( )

print profile field



[ Top ]
print_filter_show_resolution  [line 3400]

void print_filter_show_resolution( )

print resolution field



[ Top ]
print_filter_show_severity  [line 3387]

void print_filter_show_severity( )

print the severity field



[ Top ]
print_filter_show_sort  [line 3765]

void print_filter_show_sort( )

print sort fields



[ Top ]
print_filter_show_status  [line 3413]

void print_filter_show_status( )

print status field



[ Top ]
print_filter_show_target_version  [line 3481]

void print_filter_show_target_version( )

print target version field



[ Top ]
print_filter_show_version  [line 3453]

void print_filter_show_version( )

print version field



[ Top ]
print_filter_sticky_issues  [line 3553]

void print_filter_sticky_issues( )

print sticky issues field



[ Top ]
print_filter_tag_string  [line 3670]

void print_filter_tag_string( )

print tag fields



[ Top ]
print_filter_user_monitor  [line 3274]

void print_filter_user_monitor( )

Print the user monitor field



[ Top ]
print_filter_view_state  [line 3531]

void print_filter_view_state( )

print view state field



[ Top ]
print_multivalue_field  [line 3972]

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, 05 Apr 2009 23:01:14 +0100 by phpDocumentor 1.4.1