| [ Index ] |
|
Code source de Mantis 1.1.0rc3 |
1 <?php 2 # Mantis - a php based bugtracking system 3 4 # Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org 5 # Copyright (C) 2002 - 2007 Mantis Team - mantisbt-dev@lists.sourceforge.net 6 7 # Mantis is free software: you can redistribute it and/or modify 8 # it under the terms of the GNU General Public License as published by 9 # the Free Software Foundation, either version 2 of the License, or 10 # (at your option) any later version. 11 # 12 # Mantis is distributed in the hope that it will be useful, 13 # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 # GNU General Public License for more details. 16 # 17 # You should have received a copy of the GNU General Public License 18 # along with Mantis. If not, see <http://www.gnu.org/licenses/>. 19 20 # -------------------------------------------------------- 21 # $Id: print_all_bug_page.php,v 1.89.2.1 2007-10-13 22:34:15 giallu Exp $ 22 # -------------------------------------------------------- 23 ?> 24 <?php 25 # Bugs to display / print / export can be selected with the checkboxes 26 # A printing Options link allows to choose the fields to export 27 # Export : 28 # - the bugs displayed in print_all_bug_page.php are saved in a .doc or .xls file 29 # - the IE icons allows to see or directly print the same result 30 ?> 31 <?php 32 require_once ( 'core.php' ); 33 34 $t_core_path = config_get( 'core_path' ); 35 36 require_once( $t_core_path.'current_user_api.php' ); 37 require_once( $t_core_path.'bug_api.php' ); 38 require_once( $t_core_path.'date_api.php' ); 39 require_once( $t_core_path.'icon_api.php' ); 40 require_once( $t_core_path.'string_api.php' ); 41 require_once( $t_core_path.'columns_api.php' ); 42 43 auth_ensure_user_authenticated(); 44 45 $f_search = gpc_get_string( 'search', false ); # @@@ need a better default 46 $f_offset = gpc_get_int( 'offset', 0 ); 47 48 $t_cookie_value_id = gpc_get_cookie( config_get( 'view_all_cookie' ), '' ); 49 $t_cookie_value = filter_db_get_filter( $t_cookie_value_id ); 50 51 $f_highlight_changed = 0; 52 $f_sort = null; 53 $f_dir = null; 54 $t_project_id = 0; 55 56 $t_columns = helper_get_columns_to_view( COLUMNS_TARGET_PRINT_PAGE ); 57 $t_num_of_columns = sizeof( $t_columns ); 58 59 # check to see if the cookie exists 60 if ( ! is_blank( $t_cookie_value ) ) { 61 62 # check to see if new cookie is needed 63 if ( ! filter_is_cookie_valid() ) { 64 print_header_redirect( 'view_all_set.php?type=0&print=1' ); 65 } 66 67 $t_setting_arr = explode( '#', $t_cookie_value, 2 ); 68 $t_filter_cookie_arr = unserialize( $t_setting_arr[1] ); 69 70 $f_highlight_changed = $t_filter_cookie_arr['highlight_changed']; 71 $f_sort = $t_filter_cookie_arr['sort']; 72 $f_dir = $t_filter_cookie_arr['dir']; 73 $t_project_id = helper_get_current_project( ); 74 } 75 76 # This replaces the actual search that used to be here 77 $f_page_number = gpc_get_int( 'page_number', 1 ); 78 $t_per_page = -1; 79 $t_bug_count = null; 80 $t_page_count = null; 81 82 $result = filter_get_bug_rows( $t_page_number, $t_per_page, $t_page_count, $t_bug_count ); 83 $row_count = sizeof( $result ); 84 85 # for export 86 $t_show_flag = gpc_get_int( 'show_flag', 0 ); 87 ?> 88 <?php html_page_top1( ) ?> 89 <?php html_head_end( ) ?> 90 <?php html_body_begin( ) ?> 91 92 <table class="width100"><tr><td class="form-title"> 93 <div class="center"> 94 <?php echo string_display( config_get( 'window_title' ) ) . ' - ' . string_display( project_get_name( $t_project_id ) ); ?> 95 </div> 96 </td></tr></table> 97 98 <br /> 99 100 <form method="post" action="view_all_set.php"> 101 <input type="hidden" name="type" value="1" /> 102 <input type="hidden" name="print" value="1" /> 103 <input type="hidden" name="offset" value="0" /> 104 <input type="hidden" name="sort" value="<?php echo $f_sort ?>" /> 105 <input type="hidden" name="dir" value="<?php echo $f_dir ?>" /> 106 107 <table class="width100" cellpadding="2px"> 108 <?php 109 #<SQLI> Excel & Print export 110 #$f_bug_array stores the number of the selected rows 111 #$t_bug_arr_sort is used for displaying 112 #$f_export is a string for the word and excel pages 113 114 $f_bug_arr = gpc_get_int_array( 'bug_arr', array() ); 115 $f_bug_arr[$row_count]=-1; 116 117 for( $i=0; $i < $row_count; $i++ ) { 118 if ( isset( $f_bug_arr[$i] ) ) { 119 $index = $f_bug_arr[$i]; 120 $t_bug_arr_sort[$index]=1; 121 } 122 } 123 $f_export = implode( ',', $f_bug_arr ); 124 125 $t_icon_path = config_get( 'icon_path' ); 126 ?> 127 128 <tr> 129 <td colspan="<?php echo $t_num_of_columns ?>"> 130 <?php 131 if ( 'DESC' == $f_dir ) { 132 $t_new_dir = 'ASC'; 133 } else { 134 $t_new_dir = 'DESC'; 135 } 136 137 $t_search = urlencode( $f_search ); 138 139 $t_icons = array( 140 array( 'print_all_bug_page_excel', 'excel', '', 'fileicons/xls.gif', 'Excel 2000' ), 141 array( 'print_all_bug_page_excel', 'html', 'target="_blank"', 'ie.gif', 'Excel View' ), 142 array( 'print_all_bug_page_word', 'word', '', 'fileicons/doc.gif', 'Word 2000' ), 143 array( 'print_all_bug_page_word', 'html', 'target="_blank"', 'ie.gif', 'Word View' ) ); 144 145 foreach ( $t_icons as $t_icon ) { 146 echo '<a href="' . $t_icon[0] . '.php' . 147 "?search=$t_search" . 148 "&sort=$f_sort" . 149 "&dir=$t_new_dir" . 150 '&type_page=' . $t_icon[1] . 151 "&export=$f_export" . 152 "&show_flag=$t_show_flag" . 153 '" ' . $t_icon[2] . '>' . 154 '<img src="' . $t_icon_path . $t_icon[3] . '" border="0" align="absmiddle" alt="' . $t_icon[4] . '" /></a> '; 155 } 156 ?> 157 </td> 158 </tr> 159 <?php #<SQLI> ?> 160 </table> 161 162 </form> 163 164 <br /> 165 166 <form method="post" action="print_all_bug_page.php"> 167 <table class="width100" cellspacing="1" cellpadding="2px"> 168 <tr> 169 <td class="form-title" colspan="<?php echo $t_num_of_columns / 2 + $t_num_of_columns % 2; ?>"> 170 <?php echo lang_get( 'viewing_bugs_title' ) ?> 171 <?php 172 if ( $row_count > 0 ) { 173 $v_start = $f_offset+1; 174 $v_end = $f_offset+$row_count; 175 } else { 176 $v_start = 0; 177 $v_end = 0; 178 } 179 echo "( $v_start - $v_end )"; 180 ?> 181 </td> 182 <td class="right" colspan="<?php echo $t_num_of_columns / 2 ?>"> 183 <?php # print_bracket_link( 'print_all_bug_options_page.php', lang_get( 'printing_options_link' ) ) ?> 184 <?php # print_bracket_link( 'view_all_bug_page.php', lang_get( 'view_bugs_link' ) ) ?> 185 <?php # print_bracket_link( 'summary_page.php', lang_get( 'summary' ) ) ?> 186 </td> 187 </tr> 188 <tr class="row-category"> 189 <?php 190 $t_sort = $f_sort; // used within the custom function called in the loop (@@@ cleanup) 191 $t_dir = $f_dir; // used within the custom function called in the loop (@@@ cleanup) 192 193 foreach( $t_columns as $t_column ) { 194 $t_title_function = 'print_column_title'; 195 helper_call_custom_function( $t_title_function, array( $t_column, COLUMNS_TARGET_PRINT_PAGE ) ); 196 } 197 ?> 198 </tr> 199 <tr class="spacer"> 200 <td colspan="9"></td> 201 </tr> 202 <?php 203 for( $i=0; $i < $row_count; $i++ ) { 204 $t_row = $result[$i]; 205 206 # alternate row colors 207 $status_color = helper_alternate_colors( $i, '#ffffff', '#dddddd' ); 208 if ( isset( $t_bug_arr_sort[ $t_row['id'] ] ) || ( $t_show_flag==0 ) ) { 209 ?> 210 <tr bgcolor="<?php echo $status_color ?>" border="1"> 211 <?php 212 foreach( $t_columns as $t_column ) { 213 $t_column_value_function = 'print_column_value'; 214 helper_call_custom_function( $t_column_value_function, array( $t_column, $t_row, COLUMNS_TARGET_PRINT_PAGE ) ); 215 } 216 ?> 217 </tr> 218 <?php 219 } # isset_loop 220 } # for_loop 221 ?> 222 <input type="hidden" name="show_flag" value="1" /> 223 </table> 224 225 <br /> 226 227 <input type="submit" class="button" value="<?php echo lang_get( 'hide_button' ) ?>" /> 228 </form>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
| Généré le : Thu Nov 29 09:42:17 2007 | par Balluche grâce à PHPXref 0.7 |
|