Blame Identity/Webenv/App/Mantis/1.1.2-1.fc9/print_bugnote_inc.php

f2e824
f2e824
# Mantis - a php based bugtracking system
f2e824
f2e824
# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
f2e824
# Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
f2e824
f2e824
# Mantis is free software: you can redistribute it and/or modify
f2e824
# it under the terms of the GNU General Public License as published by
f2e824
# the Free Software Foundation, either version 2 of the License, or
f2e824
# (at your option) any later version.
f2e824
#
f2e824
# Mantis is distributed in the hope that it will be useful,
f2e824
# but WITHOUT ANY WARRANTY; without even the implied warranty of
f2e824
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
f2e824
# GNU General Public License for more details.
f2e824
#
f2e824
# You should have received a copy of the GNU General Public License
f2e824
# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
f2e824
f2e824
	# --------------------------------------------------------
f2e824
	# $Id: print_bugnote_inc.php,v 1.34.22.1 2007-10-13 22:34:19 giallu Exp $
f2e824
	# --------------------------------------------------------
f2e824
?>
f2e824
f2e824
	# This include file prints out the list of bugnotes attached to the bug
f2e824
	# $f_bug_id must be set and be set to the bug id
f2e824
?>
f2e824
f2e824
	$t_core_path = config_get( 'core_path' );
f2e824
f2e824
	require_once( $t_core_path.'current_user_api.php' );
f2e824
	require_once( $t_core_path.'string_api.php' );
f2e824
?>
f2e824
f2e824
	$f_bug_id = gpc_get_int( 'bug_id' );
f2e824
f2e824
	# grab the user id currently logged in
f2e824
	$t_user_id	= auth_get_current_user_id();
f2e824
	$c_bug_id		= (integer)$f_bug_id;
f2e824
f2e824
 	if ( !access_has_bug_level( config_get( 'private_bugnote_threshold' ), $f_bug_id ) ) {
f2e824
 		$t_restriction = 'AND view_state=' . VS_PUBLIC;
f2e824
 	} else {
f2e824
 		$t_restriction = '';
f2e824
 	}
f2e824
f2e824
	$t_bugnote_table		= config_get( 'mantis_bugnote_table' );
f2e824
	$t_bugnote_text_table	= config_get( 'mantis_bugnote_text_table' );
f2e824
	# get the bugnote data
f2e824
	$t_bugnote_order = current_user_get_pref( 'bugnote_order' );
f2e824
f2e824
	$query = "SELECT *
f2e824
			FROM $t_bugnote_table
f2e824
			WHERE bug_id='$c_bug_id' $t_restriction
f2e824
			ORDER BY date_submitted $t_bugnote_order";
f2e824
	$result = db_query($query);
f2e824
	$num_notes = db_num_rows($result);
f2e824
?>
f2e824
f2e824
f2e824

f2e824
f2e824
f2e824
	# no bugnotes
f2e824
	if ( 0 == $num_notes ) {
f2e824
?>
f2e824
f2e824
	
f2e824
		
f2e824
	
f2e824
f2e824
f2e824
f2e824
	
f2e824
		
f2e824
	
f2e824
f2e824
f2e824
	for ( $i=0; $i < $num_notes; $i++ ) {
f2e824
		# prefix all bugnote data with v3_
f2e824
		$row = db_fetch_array( $result );
f2e824
		extract( $row, EXTR_PREFIX_ALL, 'v3' );
f2e824
		$v3_date_submitted = date( config_get( 'normal_date_format' ), ( db_unixtimestamp( $v3_date_submitted ) ) );
f2e824
		$v3_last_modified = date( config_get( 'normal_date_format' ), ( db_unixtimestamp( $v3_last_modified ) ) );
f2e824
f2e824
		# grab the bugnote text and id and prefix with v3_
f2e824
		$query = "SELECT note, id
f2e824
				FROM $t_bugnote_text_table
f2e824
				WHERE id='$v3_bugnote_text_id'";
f2e824
		$result2 = db_query( $query );
f2e824
		$v3_note = db_result( $result2, 0, 0 );
f2e824
		$v3_bugnote_text_id = db_result( $result2, 0, 1 );
f2e824
f2e824
		$v3_note = string_display_links( $v3_note );
f2e824
?>
f2e824
f2e824
	
f2e824
		
f2e824
	
f2e824
f2e824
f2e824
	
f2e824
		
f2e824
		
f2e824
			
f2e824
				()
f2e824
			
f2e824
		
f2e824
		
f2e824
			
f2e824
				
f2e824
				echo print_user( $v3_reporter_id );
f2e824
				?>   
f2e824
			
f2e824
		
f2e824
		
f2e824
			
f2e824
				   
f2e824
				
f2e824
					echo '
(' . lang_get( 'edited_on').' '. $v3_last_modified . ')';
f2e824
				} ?>
f2e824
			
f2e824
		
f2e824
		
f2e824
	
f2e824
	
f2e824
		
f2e824
		
f2e824
			
f2e824
				
f2e824
					switch ( $v3_note_type ) {
f2e824
						case REMINDER:
f2e824
							echo '
' . lang_get( 'reminder_sent_to' ) . ': ';
f2e824
							$v3_note_attr = substr( $v3_note_attr, 1, strlen( $v3_note_attr ) - 2 );
f2e824
							$t_to = array();
f2e824
							foreach ( explode( '|', $v3_note_attr ) as $t_recipient ) {
f2e824
								$t_to[] = user_get_name( $t_recipient );
f2e824
							}
f2e824
							echo implode( ', ', $t_to ) . '
';
f2e824
						default:
f2e824
							echo $v3_note;
f2e824
					}
f2e824
				?>
f2e824
			
f2e824
		
f2e824
		
f2e824
	
f2e824
f2e824
f2e824
		} # end for loop
f2e824
	} # end else
f2e824
?>
f2e824
f2e824