| [ 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: my_view_inc.php,v 1.18.2.2 2007-10-13 22:35:34 giallu Exp $ 22 # -------------------------------------------------------- 23 ?> 24 <?php 25 $t_core_path = config_get( 'core_path' ); 26 27 require_once ( $t_core_path . 'current_user_api.php' ); 28 require_once ( $t_core_path . 'bug_api.php' ); 29 require_once ( $t_core_path . 'string_api.php' ); 30 require_once ( $t_core_path . 'date_api.php' ); 31 require_once ( $t_core_path . 'icon_api.php' ); 32 ?> 33 <?php 34 $t_filter = current_user_get_bug_filter(); 35 $t_filter = $t_filter === false ? array() : $t_filter; 36 37 $t_sort = $t_filter['sort']; 38 $t_dir = $t_filter['dir']; 39 40 $t_checkboxes_exist = false; 41 42 $t_icon_path = config_get( 'icon_path' ); 43 $t_update_bug_threshold = config_get( 'update_bug_threshold' ); 44 $t_bug_resolved_status_threshold = config_get( 'bug_resolved_status_threshold' ); 45 $t_hide_status_default = config_get( 'hide_status_default' ); 46 $t_default_show_changed = config_get( 'default_show_changed' ); 47 ?> 48 49 <?php 50 $c_filter['assigned'] = array( 51 'show_category' => Array ( '0' => META_FILTER_ANY ), 52 'show_severity' => Array ( '0' => META_FILTER_ANY ), 53 'show_status' => Array ( '0' => META_FILTER_ANY ), 54 'highlight_changed' => $t_default_show_changed, 55 'reporter_id' => Array ( '0' => META_FILTER_ANY ), 56 'handler_id' => Array ( '0' => $t_current_user_id ), 57 'show_resolution' => Array ( '0' => META_FILTER_ANY ), 58 'show_build' => Array ( '0' => META_FILTER_ANY ), 59 'show_version' => Array ( '0' => META_FILTER_ANY ), 60 'hide_status' => Array ( '0' => $t_bug_resolved_status_threshold ), 61 'user_monitor' => Array ( '0' => META_FILTER_ANY ) 62 ); 63 $url_link_parameters['assigned'] = 'handler_id=' . $t_current_user_id . '&hide_status=' . $t_bug_resolved_status_threshold; 64 65 $c_filter['recent_mod'] = array( 66 'show_category' => Array ( '0' => META_FILTER_ANY ), 67 'show_severity' => Array ( '0' => META_FILTER_ANY ), 68 'show_status' => Array ( '0' => META_FILTER_ANY ), 69 'highlight_changed' => $t_default_show_changed, 70 'reporter_id' => Array ( '0' => META_FILTER_ANY ), 71 'handler_id' => Array ( '0' => META_FILTER_ANY ), 72 'show_resolution' => Array ( '0' => META_FILTER_ANY ), 73 'show_build' => Array ( '0' => META_FILTER_ANY ), 74 'show_version' => Array ( '0' => META_FILTER_ANY ), 75 'hide_status' => Array ( '0' => META_FILTER_NONE ), 76 'user_monitor' => Array ( '0' => META_FILTER_ANY ) 77 ); 78 $url_link_parameters['recent_mod'] = 'hide_status=none'; 79 80 $c_filter['reported'] = array( 81 'show_category' => Array ( '0' => META_FILTER_ANY ), 82 'show_severity' => Array ( '0' => META_FILTER_ANY ), 83 'show_status' => Array ( '0' => META_FILTER_ANY ), 84 'highlight_changed' => $t_default_show_changed, 85 'reporter_id' => Array ( '0' => $t_current_user_id ), 86 'handler_id' => Array ( '0' => META_FILTER_ANY ), 87 'sort' => 'last_updated', 88 'show_resolution' => Array ( '0' => META_FILTER_ANY ), 89 'show_build' => Array ( '0' => META_FILTER_ANY ), 90 'show_version' => Array ( '0' => META_FILTER_ANY ), 91 'hide_status' => Array ( '0' => $t_hide_status_default ), 92 'user_monitor' => Array ( '0' => META_FILTER_ANY ) 93 ); 94 $url_link_parameters['reported'] = 'reporter_id=' . $t_current_user_id . '&hide_status=' . $t_hide_status_default; 95 96 $c_filter['resolved'] = array( 97 'show_category' => Array ( '0' => META_FILTER_ANY ), 98 'show_severity' => Array ( '0' => META_FILTER_ANY ), 99 'show_status' => Array ( '0' => $t_bug_resolved_status_threshold ), 100 'highlight_changed' => $t_default_show_changed, 101 'reporter_id' => Array ( '0' => META_FILTER_ANY ), 102 'handler_id' => Array ( '0' => META_FILTER_ANY ), 103 'show_resolution' => Array ( '0' => META_FILTER_ANY ), 104 'show_build' => Array ( '0' => META_FILTER_ANY ), 105 'show_version' => Array ( '0' => META_FILTER_ANY ), 106 'hide_status' => Array ( '0' => $t_hide_status_default ), 107 'user_monitor' => Array ( '0' => META_FILTER_ANY ) 108 ); 109 $url_link_parameters['resolved'] = 'show_status=' . $t_bug_resolved_status_threshold . '&hide_status=' . $t_bug_resolved_status_threshold; 110 111 $c_filter['unassigned'] = array( 112 'show_category' => Array ( '0' => META_FILTER_ANY ), 113 'show_severity' => Array ( '0' => META_FILTER_ANY ), 114 'show_status' => Array ( '0' => META_FILTER_ANY ), 115 'highlight_changed' => $t_default_show_changed, 116 'reporter_id' => Array ( '0' => META_FILTER_ANY ), 117 'handler_id' => Array ( '0' => META_FILTER_NONE ), 118 'show_resolution' => Array ( '0' => META_FILTER_ANY ), 119 'show_build' => Array ( '0' => META_FILTER_ANY ), 120 'show_version' => Array ( '0' => META_FILTER_ANY ), 121 'hide_status' => Array ( '0' => $t_hide_status_default ), 122 'user_monitor' => Array ( '0' => META_FILTER_ANY ) 123 ); 124 $url_link_parameters['unassigned'] = 'handler_id=[none]' . '&hide_status=' . $t_hide_status_default; 125 126 $c_filter['monitored'] = array( 127 'show_category' => Array ( '0' => META_FILTER_ANY ), 128 'show_severity' => Array ( '0' => META_FILTER_ANY ), 129 'show_status' => Array ( '0' => META_FILTER_ANY ), 130 'highlight_changed' => $t_default_show_changed, 131 'reporter_id' => Array ( '0' => META_FILTER_ANY ), 132 'handler_id' => Array ( '0' => META_FILTER_ANY ), 133 'show_resolution' => Array ( '0' => META_FILTER_ANY ), 134 'show_build' => Array ( '0' => META_FILTER_ANY ), 135 'show_version' => Array ( '0' => META_FILTER_ANY ), 136 'hide_status' => Array ( '0' => $t_hide_status_default ), 137 'user_monitor' => Array ( '0' => $t_current_user_id ) 138 ); 139 $url_link_parameters['monitored'] = 'user_monitor=' . $t_current_user_id . '&hide_status=' . $t_hide_status_default; 140 141 142 $c_filter['feedback'] = array( 143 'show_category' => Array ( '0' => META_FILTER_ANY ), 144 'show_severity' => Array ( '0' => META_FILTER_ANY ), 145 'show_status' => Array ( '0' => FEEDBACK ), 146 'highlight_changed' => $t_default_show_changed, 147 'reporter_id' => Array ( '0' => $t_current_user_id ), 148 'handler_id' => Array ( '0' => META_FILTER_ANY ), 149 'show_resolution' => Array ( '0' => META_FILTER_ANY ), 150 'show_build' => Array ( '0' => META_FILTER_ANY ), 151 'show_version' => Array ( '0' => META_FILTER_ANY ), 152 'hide_status' => Array ( '0' => $t_hide_status_default ), 153 'user_monitor' => Array ( '0' => META_FILTER_ANY ) 154 ); 155 $url_link_parameters['feedback'] = 'reporter_id=' . $t_current_user_id . '&show_status=' . FEEDBACK . '&hide_status=' . $t_hide_status_default; 156 157 $c_filter['verify'] = array( 158 'show_category' => Array ( '0' => META_FILTER_ANY ), 159 'show_severity' => Array ( '0' => META_FILTER_ANY ), 160 'show_status' => Array ( '0' => $t_bug_resolved_status_threshold ), 161 'highlight_changed' => $t_default_show_changed, 162 'reporter_id' => Array ( '0' => $t_current_user_id ), 163 'handler_id' => Array ( '0' => META_FILTER_ANY ), 164 'show_resolution' => Array ( '0' => META_FILTER_ANY ), 165 'show_build' => Array ( '0' => META_FILTER_ANY ), 166 'show_version' => Array ( '0' => META_FILTER_ANY ), 167 'hide_status' => Array ( '0' => $t_hide_status_default ), 168 'user_monitor' => Array ( '0' => META_FILTER_ANY ) 169 ); 170 $url_link_parameters['verify'] = 'reporter_id=' . $t_current_user_id . '&show_status=' . $t_bug_resolved_status_threshold; 171 172 $rows = filter_get_bug_rows ( $f_page_number, $t_per_page, $t_page_count, $t_bug_count, $c_filter[$t_box_title] ); 173 $t_filter = array_merge( $c_filter[$t_box_title], $t_filter ); 174 175 $box_title = lang_get( 'my_view_title_' . $t_box_title ); 176 ?> 177 178 179 <?php # -- ====================== BUG LIST ========================= -- ?> 180 181 <table class="width100" cellspacing="1"> 182 <?php # -- Navigation header row -- ?> 183 <tr> 184 <?php # -- Viewing range info -- ?> 185 <td class="form-title" colspan="2"> 186 <?php 187 echo '<a class="subtle" href="view_all_set.php?type=1&temporary=y&' . $url_link_parameters[$t_box_title] . '">'; 188 echo $box_title; 189 echo '</a>'; 190 echo ' ['; 191 echo '<a class="subtle" href="view_all_set.php?type=1&temporary=y&' . $url_link_parameters[$t_box_title] . '" target="_blank">'; 192 echo '^'; 193 echo '</a>]'; 194 ?> 195 <?php 196 if ( sizeof( $rows ) > 0 ) { 197 $v_start = $t_filter['per_page'] * ($f_page_number-1) +1; 198 $v_end = $v_start + sizeof( $rows ) -1; 199 } else { 200 $v_start = 0; 201 $v_end = 0; 202 } 203 echo "($v_start - $v_end / $t_bug_count)"; 204 ?> 205 </td> 206 </tr> 207 208 <?php mark_time( 'begin loop' ); ?> 209 <?php # -- Loop over bug rows and create $v_* variables -- ?> 210 <?php 211 for($i=0; $i < sizeof( $rows ); $i++) { 212 # prefix bug data with v_ 213 214 extract( $rows[$i], EXTR_PREFIX_ALL, 'v' ); 215 216 $t_summary = string_attribute( $v_summary ); 217 $t_last_updated = date( config_get( 'normal_date_format' ), $v_last_updated ); 218 219 # choose color based on status 220 $status_color = get_status_color( $v_status ); 221 222 # grab the bugnote count 223 # @@@ thraxisp - not used??? 224 # $bugnote_info = bug_get_bugnote_stats( $v_id ); 225 226 # Check for attachments 227 $t_attachment_count = 0; 228 if ( ( file_can_view_bug_attachments( $v_id ) ) ) { 229 $t_attachment_count = file_bug_attachment_count( $v_id ); 230 } 231 232 # grab the project name 233 $project_name = project_get_field( $v_project_id, 'name' ); 234 ?> 235 236 <tr bgcolor="<?php echo $status_color ?>"> 237 <?php # -- Bug ID and details link + Pencil shortcut -- ?> 238 <td class="center" valign="top" width ="0" nowrap> 239 <span class="small"> 240 <?php 241 print_bug_link( $v_id ); 242 243 echo '<br />'; 244 245 if ( !bug_is_readonly( $v_id ) && access_has_bug_level( $t_update_bug_threshold, $v_id ) ) { 246 echo '<a href="' . string_get_bug_update_url( $v_id ) . '"><img border="0" src="' . $t_icon_path . 'update.png' . '" alt="' . lang_get( 'update_bug_button' ) . '" /></a>'; 247 } 248 249 if ( ON == config_get( 'show_priority_text' ) ) { 250 print_formatted_priority_string( $v_status, $v_priority ); 251 } else { 252 print_status_icon( $v_priority ); 253 } 254 255 if ( 0 < $t_attachment_count ) { 256 echo '<a href="' . string_get_bug_view_url( $v_id ) . '#attachments">'; 257 echo '<img border="0" src="' . $t_icon_path . 'attachment.png' . '"'; 258 echo ' alt="' . lang_get( 'attachment_alt' ) . '"'; 259 echo ' title="' . $t_attachment_count . ' ' . lang_get( 'attachments' ) . '"'; 260 echo ' />'; 261 echo '</a>'; 262 } 263 if ( VS_PRIVATE == $v_view_state ) { 264 echo '<img src="' . $t_icon_path . 'protected.gif" width="8" height="15" alt="' . lang_get( 'private' ) . '" />'; 265 } 266 ?> 267 </span> 268 </td> 269 270 <?php # -- Summary -- ?> 271 <td class="left" valign="top" width="100%"> 272 <span class="small"> 273 <?php 274 echo $t_summary; 275 ?> 276 <br /> 277 <?php 278 # type project name if viewing 'all projects' or bug is in subproject 279 if ( ON == config_get( 'show_bug_project_links' ) && 280 helper_get_current_project() != $v_project_id ) { 281 echo '['; 282 print( $project_name ); 283 echo '] '; 284 } 285 echo string_display( $v_category ); 286 287 if ( $v_last_updated > strtotime( '-'.$t_filter['highlight_changed'].' hours' ) ) { 288 echo ' - <b>' . $t_last_updated . '</b>'; 289 } else { 290 echo ' - ' . $t_last_updated; 291 } 292 ?> 293 </span> 294 </td> 295 </tr> 296 <?php # -- end of Repeating bug row -- ?> 297 <?php 298 } 299 ?> 300 <?php # -- ====================== end of BUG LIST ========================= -- ?> 301 302 </table> 303 304 <?php mark_time( 'end loop' ); ?>
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 |
|