| [ Index ] |
PHP Cross Reference of MantisBT |
[Summary view] [Print] [Text view]
1 <?php 2 # MantisBT - A PHP based bugtracking system 3 4 # MantisBT is free software: you can redistribute it and/or modify 5 # it under the terms of the GNU General Public License as published by 6 # the Free Software Foundation, either version 2 of the License, or 7 # (at your option) any later version. 8 # 9 # MantisBT is distributed in the hope that it will be useful, 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 # GNU General Public License for more details. 13 # 14 # You should have received a copy of the GNU General Public License 15 # along with MantisBT. If not, see <http://www.gnu.org/licenses/>. 16 17 /** 18 * @package MantisBT 19 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org 20 * @copyright Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net 21 * @link http://www.mantisbt.org 22 * 23 * @uses core.php 24 * @uses authentication_api.php 25 * @uses compress_api.php 26 * @uses config_api.php 27 * @uses constant_inc.php 28 * @uses current_user_api.php 29 * @uses custom_field_api.php 30 * @uses error_api.php 31 * @uses filter_api.php 32 * @uses filter_constants_inc.php 33 * @uses gpc_api.php 34 * @uses helper_api.php 35 */ 36 37 /** 38 * MantisBT Core API's 39 */ 40 require_once ( 'core.php' ); 41 require_api( 'authentication_api.php' ); 42 require_api( 'compress_api.php' ); 43 require_api( 'config_api.php' ); 44 require_api( 'constant_inc.php' ); 45 require_api( 'current_user_api.php' ); 46 require_api( 'custom_field_api.php' ); 47 require_api( 'error_api.php' ); 48 require_api( 'filter_api.php' ); 49 require_api( 'filter_constants_inc.php' ); 50 require_api( 'gpc_api.php' ); 51 require_api( 'helper_api.php' ); 52 53 auth_ensure_user_authenticated(); 54 55 compress_enable(); 56 57 global $t_filter; 58 global $t_select_modifier; 59 $t_filter = current_user_get_bug_filter(); 60 if( $t_filter === false ) { 61 $t_filter = filter_get_default(); 62 } 63 $t_project_id = helper_get_current_project(); 64 $t_current_user_access_level = current_user_get_access_level(); 65 $t_accessible_custom_fields_ids = array(); 66 $t_accessible_custom_fields_names = array(); 67 $t_accessible_custom_fields_types = array(); 68 $t_accessible_custom_fields_values = array(); 69 $t_filter_cols = 7; 70 $t_custom_cols = 1; 71 $t_custom_rows = 0; 72 73 if ( ON == config_get( 'filter_by_custom_fields' ) ) { 74 $t_custom_cols = config_get( 'filter_custom_fields_per_row' ); 75 $t_custom_fields = custom_field_get_linked_ids( $t_project_id ); 76 77 foreach ( $t_custom_fields as $t_cfid ) { 78 $t_field_info = custom_field_cache_row( $t_cfid, true ); 79 if ( $t_field_info['access_level_r'] <= $t_current_user_access_level ) { 80 $t_accessible_custom_fields_ids[] = $t_cfid; 81 $t_accessible_custom_fields_names[] = $t_field_info['name']; 82 $t_accessible_custom_fields_types[] = $t_field_info['type']; 83 $t_accessible_custom_fields_values[] = custom_field_distinct_values( $t_field_info, $t_project_id ); 84 } 85 } 86 87 if ( count( $t_accessible_custom_fields_ids ) > 0 ) { 88 $t_per_row = config_get( 'filter_custom_fields_per_row' ); 89 $t_custom_rows = ceil( count( $t_accessible_custom_fields_ids ) / $t_per_row ); 90 } 91 } 92 93 $f_for_screen = gpc_get_bool( 'for_screen', true ); 94 95 $t_sort = $t_filter[ FILTER_PROPERTY_SORT_FIELD_NAME ]; 96 $t_dir = $t_filter[ FILTER_PROPERTY_SORT_DIRECTION ]; 97 $t_action = "view_all_set.php?f=3"; 98 99 if ( $f_for_screen == false ) { 100 $t_action = "view_all_set.php"; 101 } 102 103 $f_default_view_type = 'simple'; 104 if ( ADVANCED_DEFAULT == config_get( 'view_filters' ) ) { 105 $f_default_view_type = 'advanced'; 106 } 107 108 $f_view_type = gpc_get_string( 'view_type', $f_default_view_type ); 109 if ( ADVANCED_ONLY == config_get( 'view_filters' ) ) { 110 $f_view_type = 'advanced'; 111 } 112 if ( SIMPLE_ONLY == config_get( 'view_filters' ) ) { 113 $f_view_type = 'simple'; 114 } 115 116 $t_select_modifier = ''; 117 if ( 'advanced' == $f_view_type ) { 118 $t_select_modifier = ' multiple="multiple" size="10"'; 119 } 120 121 /** 122 * Prepend headers to the dynamic filter forms that are sent as the response from this page. 123 */ 124 function return_dynamic_filters_prepend_headers() { 125 if ( !headers_sent() ) { 126 header( 'Content-Type: text/html; charset=utf-8' ); 127 } 128 } 129 130 $f_filter_target = gpc_get_string( 'filter_target' ); 131 $t_function_name = 'print_filter_' . utf8_substr( $f_filter_target, 0, -7 ); 132 if ( function_exists( $t_function_name ) ) { 133 return_dynamic_filters_prepend_headers(); 134 call_user_func( $t_function_name ); 135 } else if ( 'custom_field' == utf8_substr( $f_filter_target, 0, 12 ) ) { 136 # custom function 137 $t_custom_id = utf8_substr( $f_filter_target, 13, -7 ); 138 return_dynamic_filters_prepend_headers(); 139 print_filter_custom_field( $t_custom_id ); 140 } else { 141 $t_plugin_filters = filter_get_plugin_filters(); 142 $t_found = false; 143 foreach ( $t_plugin_filters as $t_field_name => $t_filter_object ) { 144 if ( $t_field_name . '_filter' == $f_filter_target ) { 145 return_dynamic_filters_prepend_headers(); 146 print_filter_plugin_field( $t_field_name, $t_filter_object ); 147 $t_found = true; 148 break; 149 } 150 } 151 152 if ( !$t_found ) { 153 # error - no function to populate the target (e.g., print_filter_foo) 154 error_parameters( $f_filter_target ); 155 trigger_error( ERROR_FILTER_NOT_FOUND, ERROR ); 156 } 157 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Jul 28 15:48:31 2011 | Cross-referenced by PHPXref 0.7 |