Blame Extras/Mantis/1.1.2-1.fc9/bug_relationship_graph.php

4c79b5
4c79b5
# Mantis - a php based bugtracking system
4c79b5
4c79b5
# Copyright (C) 2000 - 2002  Kenzaburo Ito - kenito@300baud.org
4c79b5
# Copyright (C) 2002 - 2007  Mantis Team   - mantisbt-dev@lists.sourceforge.net
4c79b5
4c79b5
# Mantis is free software: you can redistribute it and/or modify
4c79b5
# it under the terms of the GNU General Public License as published by
4c79b5
# the Free Software Foundation, either version 2 of the License, or
4c79b5
# (at your option) any later version.
4c79b5
#
4c79b5
# Mantis is distributed in the hope that it will be useful,
4c79b5
# but WITHOUT ANY WARRANTY; without even the implied warranty of
4c79b5
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
4c79b5
# GNU General Public License for more details.
4c79b5
#
4c79b5
# You should have received a copy of the GNU General Public License
4c79b5
# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
4c79b5
4c79b5
	# --------------------------------------------------------
4c79b5
	# $Id: bug_relationship_graph.php,v 1.6.2.1 2007-10-13 22:32:47 giallu Exp $
4c79b5
	# --------------------------------------------------------
4c79b5
4c79b5
	require_once( 'core.php' );
4c79b5
4c79b5
	$t_core_path = config_get( 'core_path' );
4c79b5
4c79b5
	require_once( $t_core_path.'bug_api.php' );
4c79b5
	require_once( $t_core_path.'compress_api.php' );
4c79b5
	require_once( $t_core_path.'current_user_api.php' );
4c79b5
	require_once( $t_core_path.'relationship_graph_api.php' );
4c79b5
4c79b5
	# If relationship graphs were made disabled, we disallow any access to
4c79b5
	# this script.
4c79b5
4c79b5
	auth_ensure_user_authenticated();
4c79b5
4c79b5
	if ( ON != config_get( 'relationship_graph_enable' ) )
4c79b5
		access_denied();
4c79b5
4c79b5
	$f_bug_id		= gpc_get_int( 'bug_id' );
4c79b5
	$f_type			= gpc_get_string( 'graph', 'relation' );
4c79b5
	$f_orientation	= gpc_get_string( 'orientation', config_get( 'relationship_graph_orientation' ) );
4c79b5
4c79b5
	if ( 'relation' == $f_type ) {
4c79b5
		$t_graph_type = 'relation';
4c79b5
		$t_graph_relation = true;
4c79b5
	} else {
4c79b5
		$t_graph_type = 'dependency';
4c79b5
		$t_graph_relation = false;
4c79b5
	}
4c79b5
4c79b5
	if ( 'horizontal' == $f_orientation ) {
4c79b5
		$t_graph_orientation = 'horizontal';
4c79b5
		$t_graph_horizontal = true;
4c79b5
	} else {
4c79b5
		$t_graph_orientation = 'vertical';
4c79b5
		$t_graph_horizontal = false;
4c79b5
	}
4c79b5
4c79b5
	access_ensure_bug_level( VIEWER, $f_bug_id );
4c79b5
4c79b5
	$t_bug = bug_prepare_display( bug_get( $f_bug_id, true ) );
4c79b5
4c79b5
	if( $t_bug->project_id != helper_get_current_project() ) {
4c79b5
		# in case the current project is not the same project of the bug we are viewing...
4c79b5
		# ... override the current project. This to avoid problems with categories and handlers lists etc.
4c79b5
		$g_project_override = $t_bug->project_id;
4c79b5
	}
4c79b5
4c79b5
	compress_enable();
4c79b5
4c79b5
	html_page_top1( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) );
4c79b5
	html_page_top2();
4c79b5
?>
4c79b5

4c79b5
4c79b5
4c79b5
4c79b5
4c79b5
	
4c79b5
	
4c79b5
		
4c79b5
		if ( $t_graph_relation ) 
4c79b5
			echo lang_get( 'viewing_bug_relationship_graph_title' );
4c79b5
		else
4c79b5
			echo lang_get( 'viewing_bug_dependency_graph_title' );
4c79b5
		?>
4c79b5
	
4c79b5
	
4c79b5
	
4c79b5
		
4c79b5
		
4c79b5
4c79b5
		
4c79b5
		
4c79b5
4c79b5
		if ( $t_graph_relation )
4c79b5
			print_bracket_link( 'bug_relationship_graph.php?bug_id=' . $f_bug_id . '&graph=dependency', lang_get( 'dependency_graph' ) );
4c79b5
		else
4c79b5
			print_bracket_link( 'bug_relationship_graph.php?bug_id=' . $f_bug_id . '&graph=relation', lang_get( 'relation_graph' ) );
4c79b5
?>
4c79b5
		
4c79b5
4c79b5
		if ( !$t_graph_relation ) {
4c79b5
?>
4c79b5
		
4c79b5
		
4c79b5
4c79b5
			if ( $t_graph_horizontal )
4c79b5
				print_bracket_link( 'bug_relationship_graph.php?bug_id=' . $f_bug_id . '&graph=dependency&orientation=vertical', lang_get( 'vertical' ) );
4c79b5
			else
4c79b5
				print_bracket_link( 'bug_relationship_graph.php?bug_id=' . $f_bug_id . '&graph=dependency&orientation=horizontal', lang_get( 'horizontal' ) );
4c79b5
?>
4c79b5
		
4c79b5
4c79b5
		}
4c79b5
?>
4c79b5
	
4c79b5
4c79b5
4c79b5
4c79b5
	
4c79b5
	
4c79b5
4c79b5
	if ( $t_graph_relation )
4c79b5
		$t_graph = relgraph_generate_rel_graph( $f_bug_id, $t_bug );
4c79b5
	else
4c79b5
		$t_graph = relgraph_generate_dep_graph( $f_bug_id, $t_bug, $t_graph_horizontal );
4c79b5
4c79b5
	relgraph_output_map( $t_graph, 'relationship_graph_map' );
4c79b5
?>
4c79b5
		
4c79b5
			
4c79b5
				border="0" usemap="#relationship_graph_map" />
4c79b5
		
4c79b5
	
4c79b5
4c79b5
4c79b5
4c79b5
	
4c79b5
	
4c79b5
		
4c79b5
		
4c79b5
			
4c79b5
				
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
				
4c79b5
			
4c79b5
			
4c79b5
				
4c79b5
				
4c79b5
			
4c79b5
		
4c79b5
		
4c79b5
	
4c79b5
4c79b5
4c79b5
4c79b5
4c79b5

4c79b5
4c79b5
4c79b5
	include( 'bug_view_inc.php' );
4c79b5
	html_page_bottom1( __FILE__ );
4c79b5
?>