[ 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_bugnote_inc.php,v 1.34.22.1 2007-10-13 22:34:19 giallu Exp $ 22 # -------------------------------------------------------- 23 ?> 24 <?php 25 # This include file prints out the list of bugnotes attached to the bug 26 # $f_bug_id must be set and be set to the bug id 27 ?> 28 <?php 29 $t_core_path = config_get( 'core_path' ); 30 31 require_once( $t_core_path.'current_user_api.php' ); 32 require_once( $t_core_path.'string_api.php' ); 33 ?> 34 <?php 35 $f_bug_id = gpc_get_int( 'bug_id' ); 36 37 # grab the user id currently logged in 38 $t_user_id = auth_get_current_user_id(); 39 $c_bug_id = (integer)$f_bug_id; 40 41 if ( !access_has_bug_level( config_get( 'private_bugnote_threshold' ), $f_bug_id ) ) { 42 $t_restriction = 'AND view_state=' . VS_PUBLIC; 43 } else { 44 $t_restriction = ''; 45 } 46 47 $t_bugnote_table = config_get( 'mantis_bugnote_table' ); 48 $t_bugnote_text_table = config_get( 'mantis_bugnote_text_table' ); 49 # get the bugnote data 50 $t_bugnote_order = current_user_get_pref( 'bugnote_order' ); 51 52 $query = "SELECT * 53 FROM $t_bugnote_table 54 WHERE bug_id='$c_bug_id' $t_restriction 55 ORDER BY date_submitted $t_bugnote_order"; 56 $result = db_query($query); 57 $num_notes = db_num_rows($result); 58 ?> 59 60 <?php # Bugnotes BEGIN ?> 61 <br /> 62 <table class="width100" cellspacing="1"> 63 <?php 64 # no bugnotes 65 if ( 0 == $num_notes ) { 66 ?> 67 <tr> 68 <td class="print" colspan="2"> 69 <?php echo lang_get( 'no_bugnotes_msg' ) ?> 70 </td> 71 </tr> 72 <?php } else { # print bugnotes ?> 73 <tr> 74 <td class="form-title" colspan="2"> 75 <?php echo lang_get( 'bug_notes_title' ) ?> 76 </td> 77 </tr> 78 <?php 79 for ( $i=0; $i < $num_notes; $i++ ) { 80 # prefix all bugnote data with v3_ 81 $row = db_fetch_array( $result ); 82 extract( $row, EXTR_PREFIX_ALL, 'v3' ); 83 $v3_date_submitted = date( config_get( 'normal_date_format' ), ( db_unixtimestamp( $v3_date_submitted ) ) ); 84 $v3_last_modified = date( config_get( 'normal_date_format' ), ( db_unixtimestamp( $v3_last_modified ) ) ); 85 86 # grab the bugnote text and id and prefix with v3_ 87 $query = "SELECT note, id 88 FROM $t_bugnote_text_table 89 WHERE id='$v3_bugnote_text_id'"; 90 $result2 = db_query( $query ); 91 $v3_note = db_result( $result2, 0, 0 ); 92 $v3_bugnote_text_id = db_result( $result2, 0, 1 ); 93 94 $v3_note = string_display_links( $v3_note ); 95 ?> 96 <tr> 97 <td class="print-spacer" colspan="2"> 98 <hr size="1" /> 99 </td> 100 </tr> 101 <tr> 102 <td class="nopad" valign="top" width="20%"> 103 <table class="hide" cellspacing="1"> 104 <tr> 105 <td class="print"> 106 (<?php echo bugnote_format_id( $v3_id ) ?>) 107 </td> 108 </tr> 109 <tr> 110 <td class="print"> 111 <?php 112 echo print_user( $v3_reporter_id ); 113 ?> 114 </td> 115 </tr> 116 <tr> 117 <td class="print"> 118 <?php echo $v3_date_submitted ?> 119 <?php if ( db_unixtimestamp( $v3_date_submitted ) != db_unixtimestamp( $v3_last_modified ) ) { 120 echo '<br />(' . lang_get( 'edited_on').' '. $v3_last_modified . ')'; 121 } ?> 122 </td> 123 </tr> 124 </table> 125 </td> 126 <td class="nopad" valign="top" width="85%"> 127 <table class="hide" cellspacing="1"> 128 <tr> 129 <td class="print"> 130 <?php 131 switch ( $v3_note_type ) { 132 case REMINDER: 133 echo '<div class="italic">' . lang_get( 'reminder_sent_to' ) . ': '; 134 $v3_note_attr = substr( $v3_note_attr, 1, strlen( $v3_note_attr ) - 2 ); 135 $t_to = array(); 136 foreach ( explode( '|', $v3_note_attr ) as $t_recipient ) { 137 $t_to[] = user_get_name( $t_recipient ); 138 } 139 echo implode( ', ', $t_to ) . '</div><br />'; 140 default: 141 echo $v3_note; 142 } 143 ?> 144 </td> 145 </tr> 146 </table> 147 </td> 148 </tr> 149 <?php 150 } # end for loop 151 } # end else 152 ?> 153 </table> 154 <?php # Bugnotes END ?>
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 |
![]() |