From: Victor B. <vb...@us...> - 2004-09-26 15:35:01
|
Update of /cvsroot/mantisbt/mantisbt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11612/core Modified Files: filter_api.php Log Message: (filter_db_get_available_queries): Changed api to take project id and user id as parameters. The parameters are default to null. If null, they are set to current project / current user. Index: filter_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/filter_api.php,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- filter_api.php 21 Aug 2004 13:07:14 -0000 1.57 +++ filter_api.php 26 Sep 2004 15:34:52 -0000 1.58 @@ -1588,11 +1588,21 @@ $result = db_query( $query ); } - function filter_db_get_available_queries( ) { + function filter_db_get_available_queries( $p_project_id = null, $p_user_id = null ) { $t_filters_table = config_get( 'mantis_filters_table' ); $t_overall_query_arr = array(); - $t_project_id = helper_get_current_project(); - $t_user_id = auth_get_current_user_id(); + + if ( null === $p_project_id ) { + $t_project_id = helper_get_current_project(); + } else { + $t_project_id = db_prepare_int( $p_project_id ); + } + + if ( null === $p_user_id ) { + $t_user_id = auth_get_current_user_id(); + } else { + $t_user_id = db_prepare_int( $p_user_id ); + } # If the user doesn't have access rights to stored queries, just return if ( !access_has_project_level( config_get( 'stored_query_use_threshold' ) ) ) { |