| [ 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 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org 19 * @copyright Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net 20 * @link http://www.mantisbt.org 21 * @package MantisBT 22 * 23 * @uses access_api.php 24 * @uses bug_api.php 25 * @uses category_api.php 26 * @uses config_api.php 27 * @uses constant_inc.php 28 * @uses current_user_api.php 29 * @uses file_api.php 30 * @uses filter_api.php 31 * @uses filter_constants_inc.php 32 * @uses helper_api.php 33 * @uses icon_api.php 34 * @uses lang_api.php 35 * @uses print_api.php 36 * @uses project_api.php 37 * @uses string_api.php 38 */ 39 40 if ( !defined( 'MY_VIEW_INC_ALLOW' ) ) { 41 return; 42 } 43 44 require_api( 'access_api.php' ); 45 require_api( 'bug_api.php' ); 46 require_api( 'category_api.php' ); 47 require_api( 'config_api.php' ); 48 require_api( 'constant_inc.php' ); 49 require_api( 'current_user_api.php' ); 50 require_api( 'file_api.php' ); 51 require_api( 'filter_api.php' ); 52 require_api( 'filter_constants_inc.php' ); 53 require_api( 'helper_api.php' ); 54 require_api( 'icon_api.php' ); 55 require_api( 'lang_api.php' ); 56 require_api( 'print_api.php' ); 57 require_api( 'project_api.php' ); 58 require_api( 'string_api.php' ); 59 60 $t_filter = current_user_get_bug_filter(); 61 if( $t_filter === false ) { 62 $t_filter = filter_get_default(); 63 } 64 65 $t_sort = $t_filter['sort']; 66 $t_dir = $t_filter['dir']; 67 68 $t_icon_path = config_get( 'icon_path' ); 69 $t_update_bug_threshold = config_get( 'update_bug_threshold' ); 70 $t_bug_resolved_status_threshold = config_get( 'bug_resolved_status_threshold' ); 71 $t_hide_status_default = config_get( 'hide_status_default' ); 72 $t_default_show_changed = config_get( 'default_show_changed' ); 73 74 $c_filter['assigned'] = array( 75 FILTER_PROPERTY_CATEGORY_ID => Array( 76 '0' => META_FILTER_ANY, 77 ), 78 FILTER_PROPERTY_SEVERITY => Array( 79 '0' => META_FILTER_ANY, 80 ), 81 FILTER_PROPERTY_STATUS => Array( 82 '0' => META_FILTER_ANY, 83 ), 84 FILTER_PROPERTY_HIGHLIGHT_CHANGED => $t_default_show_changed, 85 FILTER_PROPERTY_REPORTER_ID => Array( 86 '0' => META_FILTER_ANY, 87 ), 88 FILTER_PROPERTY_HANDLER_ID => Array( 89 '0' => $t_current_user_id, 90 ), 91 FILTER_PROPERTY_RESOLUTION => Array( 92 '0' => META_FILTER_ANY, 93 ), 94 FILTER_PROPERTY_BUILD => Array( 95 '0' => META_FILTER_ANY, 96 ), 97 FILTER_PROPERTY_VERSION => Array( 98 '0' => META_FILTER_ANY, 99 ), 100 FILTER_PROPERTY_HIDE_STATUS => Array( 101 '0' => $t_bug_resolved_status_threshold, 102 ), 103 FILTER_PROPERTY_MONITOR_USER_ID => Array( 104 '0' => META_FILTER_ANY, 105 ), 106 ); 107 $url_link_parameters['assigned'] = FILTER_PROPERTY_HANDLER_ID . '=' . $t_current_user_id . '&' . FILTER_PROPERTY_HIDE_STATUS . '=' . $t_bug_resolved_status_threshold; 108 109 $c_filter['recent_mod'] = array( 110 FILTER_PROPERTY_CATEGORY_ID => Array( 111 '0' => META_FILTER_ANY, 112 ), 113 FILTER_PROPERTY_SEVERITY => Array( 114 '0' => META_FILTER_ANY, 115 ), 116 FILTER_PROPERTY_STATUS => Array( 117 '0' => META_FILTER_ANY, 118 ), 119 FILTER_PROPERTY_HIGHLIGHT_CHANGED => $t_default_show_changed, 120 FILTER_PROPERTY_REPORTER_ID => Array( 121 '0' => META_FILTER_ANY, 122 ), 123 FILTER_PROPERTY_HANDLER_ID => Array( 124 '0' => META_FILTER_ANY, 125 ), 126 FILTER_PROPERTY_RESOLUTION => Array( 127 '0' => META_FILTER_ANY, 128 ), 129 FILTER_PROPERTY_BUILD => Array( 130 '0' => META_FILTER_ANY, 131 ), 132 FILTER_PROPERTY_VERSION => Array( 133 '0' => META_FILTER_ANY, 134 ), 135 FILTER_PROPERTY_HIDE_STATUS => Array( 136 '0' => META_FILTER_NONE, 137 ), 138 FILTER_PROPERTY_MONITOR_USER_ID => Array( 139 '0' => META_FILTER_ANY, 140 ), 141 ); 142 $url_link_parameters['recent_mod'] = FILTER_PROPERTY_HIDE_STATUS . '=none'; 143 144 $c_filter['reported'] = array( 145 FILTER_PROPERTY_CATEGORY_ID => Array( 146 '0' => META_FILTER_ANY, 147 ), 148 FILTER_PROPERTY_SEVERITY => Array( 149 '0' => META_FILTER_ANY, 150 ), 151 FILTER_PROPERTY_STATUS => Array( 152 '0' => META_FILTER_ANY, 153 ), 154 FILTER_PROPERTY_HIGHLIGHT_CHANGED => $t_default_show_changed, 155 FILTER_PROPERTY_REPORTER_ID => Array( 156 '0' => $t_current_user_id, 157 ), 158 FILTER_PROPERTY_HANDLER_ID => Array( 159 '0' => META_FILTER_ANY, 160 ), 161 FILTER_PROPERTY_SORT_FIELD_NAME => 'last_updated', 162 FILTER_PROPERTY_RESOLUTION => Array( 163 '0' => META_FILTER_ANY, 164 ), 165 FILTER_PROPERTY_BUILD => Array( 166 '0' => META_FILTER_ANY, 167 ), 168 FILTER_PROPERTY_VERSION => Array( 169 '0' => META_FILTER_ANY, 170 ), 171 FILTER_PROPERTY_HIDE_STATUS => Array( 172 '0' => $t_hide_status_default, 173 ), 174 FILTER_PROPERTY_MONITOR_USER_ID => Array( 175 '0' => META_FILTER_ANY, 176 ), 177 ); 178 $url_link_parameters['reported'] = FILTER_PROPERTY_REPORTER_ID . '=' . $t_current_user_id . '&' . FILTER_PROPERTY_HIDE_STATUS . '=' . $t_hide_status_default; 179 180 $c_filter['resolved'] = array( 181 FILTER_PROPERTY_CATEGORY_ID => Array( 182 '0' => META_FILTER_ANY, 183 ), 184 FILTER_PROPERTY_SEVERITY => Array( 185 '0' => META_FILTER_ANY, 186 ), 187 FILTER_PROPERTY_STATUS => Array( 188 '0' => $t_bug_resolved_status_threshold, 189 ), 190 FILTER_PROPERTY_HIGHLIGHT_CHANGED => $t_default_show_changed, 191 FILTER_PROPERTY_REPORTER_ID => Array( 192 '0' => META_FILTER_ANY, 193 ), 194 FILTER_PROPERTY_HANDLER_ID => Array( 195 '0' => META_FILTER_ANY, 196 ), 197 FILTER_PROPERTY_RESOLUTION => Array( 198 '0' => META_FILTER_ANY, 199 ), 200 FILTER_PROPERTY_BUILD => Array( 201 '0' => META_FILTER_ANY, 202 ), 203 FILTER_PROPERTY_VERSION => Array( 204 '0' => META_FILTER_ANY, 205 ), 206 FILTER_PROPERTY_HIDE_STATUS => Array( 207 '0' => $t_hide_status_default, 208 ), 209 FILTER_PROPERTY_MONITOR_USER_ID => Array( 210 '0' => META_FILTER_ANY, 211 ), 212 ); 213 $url_link_parameters['resolved'] = FILTER_PROPERTY_STATUS . '=' . $t_bug_resolved_status_threshold . '&' . FILTER_PROPERTY_HIDE_STATUS . '=' . $t_bug_resolved_status_threshold; 214 215 $c_filter['unassigned'] = array( 216 FILTER_PROPERTY_CATEGORY_ID => Array( 217 '0' => META_FILTER_ANY, 218 ), 219 FILTER_PROPERTY_SEVERITY => Array( 220 '0' => META_FILTER_ANY, 221 ), 222 FILTER_PROPERTY_STATUS => Array( 223 '0' => META_FILTER_ANY, 224 ), 225 FILTER_PROPERTY_HIGHLIGHT_CHANGED => $t_default_show_changed, 226 FILTER_PROPERTY_REPORTER_ID => Array( 227 '0' => META_FILTER_ANY, 228 ), 229 FILTER_PROPERTY_HANDLER_ID => Array( 230 '0' => META_FILTER_NONE, 231 ), 232 FILTER_PROPERTY_RESOLUTION => Array( 233 '0' => META_FILTER_ANY, 234 ), 235 FILTER_PROPERTY_BUILD => Array( 236 '0' => META_FILTER_ANY, 237 ), 238 FILTER_PROPERTY_VERSION => Array( 239 '0' => META_FILTER_ANY, 240 ), 241 FILTER_PROPERTY_HIDE_STATUS => Array( 242 '0' => $t_hide_status_default, 243 ), 244 FILTER_PROPERTY_MONITOR_USER_ID => Array( 245 '0' => META_FILTER_ANY, 246 ), 247 ); 248 $url_link_parameters['unassigned'] = FILTER_PROPERTY_HANDLER_ID . '=[none]' . '&' . FILTER_PROPERTY_HIDE_STATUS . '=' . $t_hide_status_default; 249 250 # TODO: check. handler value looks wrong 251 252 $c_filter['monitored'] = array( 253 FILTER_PROPERTY_CATEGORY_ID => Array( 254 '0' => META_FILTER_ANY, 255 ), 256 FILTER_PROPERTY_SEVERITY => Array( 257 '0' => META_FILTER_ANY, 258 ), 259 FILTER_PROPERTY_STATUS => Array( 260 '0' => META_FILTER_ANY, 261 ), 262 FILTER_PROPERTY_HIGHLIGHT_CHANGED => $t_default_show_changed, 263 FILTER_PROPERTY_REPORTER_ID => Array( 264 '0' => META_FILTER_ANY, 265 ), 266 FILTER_PROPERTY_HANDLER_ID => Array( 267 '0' => META_FILTER_ANY, 268 ), 269 FILTER_PROPERTY_RESOLUTION => Array( 270 '0' => META_FILTER_ANY, 271 ), 272 FILTER_PROPERTY_BUILD => Array( 273 '0' => META_FILTER_ANY, 274 ), 275 FILTER_PROPERTY_VERSION => Array( 276 '0' => META_FILTER_ANY, 277 ), 278 FILTER_PROPERTY_HIDE_STATUS => Array( 279 '0' => $t_hide_status_default, 280 ), 281 FILTER_PROPERTY_MONITOR_USER_ID => Array( 282 '0' => $t_current_user_id, 283 ), 284 ); 285 $url_link_parameters['monitored'] = FILTER_PROPERTY_MONITOR_USER_ID . '=' . $t_current_user_id . '&' . FILTER_PROPERTY_HIDE_STATUS . '=' . $t_hide_status_default; 286 287 288 $c_filter['feedback'] = array( 289 FILTER_PROPERTY_CATEGORY_ID => Array( 290 '0' => META_FILTER_ANY, 291 ), 292 FILTER_PROPERTY_SEVERITY => Array( 293 '0' => META_FILTER_ANY, 294 ), 295 FILTER_PROPERTY_STATUS => Array( 296 '0' => config_get( 'bug_feedback_status' ), 297 ), 298 FILTER_PROPERTY_HIGHLIGHT_CHANGED => $t_default_show_changed, 299 FILTER_PROPERTY_REPORTER_ID => Array( 300 '0' => $t_current_user_id, 301 ), 302 FILTER_PROPERTY_HANDLER_ID => Array( 303 '0' => META_FILTER_ANY, 304 ), 305 FILTER_PROPERTY_RESOLUTION => Array( 306 '0' => META_FILTER_ANY, 307 ), 308 FILTER_PROPERTY_BUILD => Array( 309 '0' => META_FILTER_ANY, 310 ), 311 FILTER_PROPERTY_VERSION => Array( 312 '0' => META_FILTER_ANY, 313 ), 314 FILTER_PROPERTY_HIDE_STATUS => Array( 315 '0' => $t_hide_status_default, 316 ), 317 FILTER_PROPERTY_MONITOR_USER_ID => Array( 318 '0' => META_FILTER_ANY, 319 ), 320 ); 321 $url_link_parameters['feedback'] = FILTER_PROPERTY_REPORTER_ID . '=' . $t_current_user_id . '&' . FILTER_PROPERTY_STATUS . '=' . config_get( 'bug_feedback_status' ) . '&' . FILTER_PROPERTY_HIDE_STATUS . '=' . $t_hide_status_default; 322 323 $c_filter['verify'] = array( 324 FILTER_PROPERTY_CATEGORY_ID => Array( 325 '0' => META_FILTER_ANY, 326 ), 327 FILTER_PROPERTY_SEVERITY => Array( 328 '0' => META_FILTER_ANY, 329 ), 330 FILTER_PROPERTY_STATUS => Array( 331 '0' => $t_bug_resolved_status_threshold, 332 ), 333 FILTER_PROPERTY_HIGHLIGHT_CHANGED => $t_default_show_changed, 334 FILTER_PROPERTY_REPORTER_ID => Array( 335 '0' => $t_current_user_id, 336 ), 337 FILTER_PROPERTY_HANDLER_ID => Array( 338 '0' => META_FILTER_ANY, 339 ), 340 FILTER_PROPERTY_RESOLUTION => Array( 341 '0' => META_FILTER_ANY, 342 ), 343 FILTER_PROPERTY_BUILD => Array( 344 '0' => META_FILTER_ANY, 345 ), 346 FILTER_PROPERTY_VERSION => Array( 347 '0' => META_FILTER_ANY, 348 ), 349 FILTER_PROPERTY_HIDE_STATUS => Array( 350 '0' => $t_hide_status_default, 351 ), 352 FILTER_PROPERTY_MONITOR_USER_ID => Array( 353 '0' => META_FILTER_ANY, 354 ), 355 ); 356 $url_link_parameters['verify'] = FILTER_PROPERTY_REPORTER_ID . '=' . $t_current_user_id . '&' . FILTER_PROPERTY_STATUS . '=' . $t_bug_resolved_status_threshold; 357 358 $c_filter['my_comments'] = array( 359 FILTER_PROPERTY_CATEGORY_ID => Array( 360 '0' => META_FILTER_ANY, 361 ), 362 FILTER_PROPERTY_SEVERITY => Array( 363 '0' => META_FILTER_ANY, 364 ), 365 FILTER_PROPERTY_STATUS => Array( 366 '0' => META_FILTER_ANY, 367 ), 368 FILTER_PROPERTY_HIGHLIGHT_CHANGED => $t_default_show_changed, 369 FILTER_PROPERTY_REPORTER_ID => Array( 370 '0' => META_FILTER_ANY, 371 ), 372 FILTER_PROPERTY_HANDLER_ID => Array( 373 '0' => META_FILTER_ANY, 374 ), 375 FILTER_PROPERTY_RESOLUTION => Array( 376 '0' => META_FILTER_ANY, 377 ), 378 FILTER_PROPERTY_BUILD => Array( 379 '0' => META_FILTER_ANY, 380 ), 381 FILTER_PROPERTY_VERSION => Array( 382 '0' => META_FILTER_ANY, 383 ), 384 FILTER_PROPERTY_HIDE_STATUS => Array( 385 '0' => $t_hide_status_default, 386 ), 387 FILTER_PROPERTY_MONITOR_USER_ID => Array( 388 '0' => META_FILTER_ANY, 389 ), 390 FILTER_PROPERTY_NOTE_USER_ID=> Array( 391 '0' => META_FILTER_MYSELF, 392 ), 393 ); 394 395 $url_link_parameters['my_comments'] = FILTER_PROPERTY_NOTE_USER_ID. '=' . META_FILTER_MYSELF . '&' . FILTER_PROPERTY_HIDE_STATUS . '=' . $t_hide_status_default; 396 $rows = filter_get_bug_rows( $f_page_number, $t_per_page, $t_page_count, $t_bug_count, $c_filter[$t_box_title] ); 397 398 # Improve performance by caching category data in one pass 399 if( helper_get_current_project() == 0 ) { 400 $t_categories = array(); 401 foreach( $rows as $t_row ) { 402 $t_categories[] = $t_row->category_id; 403 } 404 405 category_cache_array_rows( array_unique( $t_categories ) ); 406 } 407 408 $t_filter = array_merge( $c_filter[$t_box_title], $t_filter ); 409 410 $box_title = lang_get( 'my_view_title_' . $t_box_title ); 411 412 # -- ====================== BUG LIST ========================= -- 413 ?> 414 415 <table class="width100 my-buglist" cellspacing="1"> 416 <?php 417 # -- Navigation header row --?> 418 <thead> 419 <tr class="my-buglist-nav"> 420 <?php 421 # -- Viewing range info --?> 422 <td class="form-title" colspan="2"> 423 <?php 424 print_link( 'view_all_set.php?type=1&temporary=y&' . $url_link_parameters[$t_box_title], $box_title, false, 'subtle' ); 425 426 if( count( $rows ) > 0 ) { 427 $v_start = $t_filter[FILTER_PROPERTY_ISSUES_PER_PAGE] * ( $f_page_number - 1 ) + 1; 428 $v_end = $v_start + count( $rows ) - 1; 429 } 430 else { 431 $v_start = 0; 432 $v_end = 0; 433 } 434 echo "<span class=\"my-buglist-count\">($v_start - $v_end / $t_bug_count)</span>"; 435 ?> 436 </td> 437 </tr> 438 </thead><tbody> 439 <?php 440 # -- Loop over bug rows and create $v_* variables -- 441 $t_count = count( $rows ); 442 if( $t_count == 0 ) { 443 echo '<tr><td> </td></tr>'; 444 } 445 for( $i = 0;$i < $t_count; $i++ ) { 446 $t_bug = $rows[$i]; 447 448 $t_summary = string_display_line_links( $t_bug->summary ); 449 $t_last_updated = date( config_get( 'normal_date_format' ), $t_bug->last_updated ); 450 451 # choose color based on status 452 $status_label = html_get_status_css_class( $t_bug->status ); 453 454 # Check for attachments 455 $t_attachment_count = 0; 456 # TODO: factor in the allow_view_own_attachments configuration option 457 # instead of just using a global check. 458 if(( file_can_view_bug_attachments( $t_bug->id, null ) ) ) { 459 $t_attachment_count = file_bug_attachment_count( $t_bug->id ); 460 } 461 462 # grab the project name 463 $project_name = project_get_field( $t_bug->project_id, 'name' ); 464 465 if ( VS_PRIVATE == $t_bug->view_state ) { 466 $t_bug_class = 'my-buglist-private'; 467 } else { 468 $t_bug_class = ''; 469 } 470 ?> 471 472 <tr class="my-buglist-bug <?php echo $t_bug_class?> <?php echo $status_label; ?>"> 473 <?php 474 # -- Bug ID and details link + Pencil shortcut --?> 475 <td class="center nowrap my-buglist-id"> 476 <span class="small"> 477 <?php 478 print_bug_link( $t_bug->id ); 479 480 echo '<br />'; 481 482 if( !bug_is_readonly( $t_bug->id ) && access_has_bug_level( $t_update_bug_threshold, $t_bug->id ) ) { 483 echo '<a class="edit" href="' . string_get_bug_update_url( $t_bug->id ) . '"><img src="' . $t_icon_path . 'update.png' . '" alt="' . lang_get( 'update_bug_button' ) . '" /></a>'; 484 } 485 486 if( ON == config_get( 'show_priority_text' ) ) { 487 print_formatted_priority_string( $t_bug->status, $t_bug->priority ); 488 } else { 489 print_status_icon( $t_bug->priority ); 490 } 491 492 if ( $t_attachment_count > 0 ) { 493 $t_href = string_get_bug_view_url( $t_bug->id ) . '#attachments'; 494 $t_href_title = sprintf( lang_get( 'view_attachments_for_issue' ), $t_attachment_count, $t_bug->id ); 495 $t_alt_text = $t_attachment_count . lang_get( 'word_separator' ) . lang_get( 'attachments' ); 496 echo "<a class=\"attachments\" href=\"$t_href\" title=\"$t_href_title\"><img src=\"$t_icon_path}attachment.png\" alt=\"$t_alt_text\" title=\"$t_alt_text\" /></a>"; 497 } 498 499 if( VS_PRIVATE == $t_bug->view_state ) { 500 echo '<img src="' . $t_icon_path . 'protected.gif" width="8" height="15" alt="' . lang_get( 'private' ) . '" />'; 501 } 502 ?> 503 </span> 504 </td> 505 506 <?php 507 # -- Summary --?> 508 <td class="left my-buglist-description"> 509 <?php 510 if( ON == config_get( 'show_bug_project_links' ) && helper_get_current_project() != $t_bug->project_id ) { 511 echo '<span class="small project">[', string_display_line( project_get_name( $t_bug->project_id ) ), '] </span>'; 512 } 513 $t_bug_url = string_get_bug_view_url( $t_bug->id, null ); 514 $t_bug_url_title = string_html_specialchars( sprintf( lang_get( 'label' ), lang_get( 'issue_id' ) . $t_bug->id ) . lang_get( 'word_separator' ) . $t_bug->summary ); 515 echo "<span class=\"small summary\"><a href=\"$t_bug_url\" title=\"$t_bug_url_title\">$t_summary</a></span><br />"; 516 ?> 517 <?php 518 # type project name if viewing 'all projects' or bug is in subproject 519 echo '<span class="small category">', string_display_line( category_full_name( $t_bug->category_id, true, $t_bug->project_id ) ), '</span>'; 520 521 echo '<span class="small last-modified"> - '; 522 if( $t_bug->last_updated > strtotime( '-' . $t_filter[FILTER_PROPERTY_HIGHLIGHT_CHANGED] . ' hours' ) ) { 523 echo '<strong>' . $t_last_updated . '</strong>'; 524 } else { 525 echo $t_last_updated; 526 } 527 echo '</span>'; 528 ?> 529 </td> 530 </tr> 531 <?php 532 # -- end of Repeating bug row -- 533 } 534 535 # -- ====================== end of BUG LIST ========================= -- 536 ?> 537 </tbody> 538 </table> 539 <?php 540 // Free the memory allocated for the rows in this box since it is not longer needed. 541 unset( $rows ); 542
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 |