2 # MantisBT - A PHP based bugtracking system
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.
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.
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/>.
19 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
20 * @copyright Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net
21 * @link http://www.mantisbt.org
24 * @uses access_api.php
25 * @uses authentication_api.php
27 * @uses compress_api.php
28 * @uses config_api.php
29 * @uses constant_inc.php
31 * @uses helper_api.php
35 * @uses relationship_graph_api.php
41 require_once( 'core.php' );
42 require_api( 'access_api.php' );
43 require_api( 'authentication_api.php' );
44 require_api( 'bug_api.php' );
45 require_api( 'compress_api.php' );
46 require_api( 'config_api.php' );
47 require_api( 'constant_inc.php' );
48 require_api( 'gpc_api.php' );
49 require_api( 'helper_api.php' );
50 require_api( 'html_api.php' );
51 require_api( 'lang_api.php' );
52 require_api( 'print_api.php' );
53 require_api( 'relationship_graph_api.php' );
55 # If relationship graphs were made disabled, we disallow any access to
58 auth_ensure_user_authenticated();
60 if ( ON
!= config_get( 'relationship_graph_enable' ) )
63 $f_bug_id = gpc_get_int( 'bug_id' );
64 $f_type = gpc_get_string( 'graph', 'relation' );
65 $f_orientation = gpc_get_string( 'orientation', config_get( 'relationship_graph_orientation' ) );
67 if ( 'relation' == $f_type ) {
68 $t_graph_type = 'relation';
69 $t_graph_relation = true;
71 $t_graph_type = 'dependency';
72 $t_graph_relation = false;
75 if ( 'horizontal' == $f_orientation ) {
76 $t_graph_orientation = 'horizontal';
77 $t_graph_horizontal = true;
79 $t_graph_orientation = 'vertical';
80 $t_graph_horizontal = false;
83 $t_bug = bug_get( $f_bug_id, true );
85 if( $t_bug->project_id
!= helper_get_current_project() ) {
86 # in case the current project is not the same project of the bug we are viewing...
87 # ... override the current project. This to avoid problems with categories and handlers lists etc.
88 $g_project_override = $t_bug->project_id
;
91 access_ensure_bug_level( VIEWER
, $f_bug_id );
95 html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION
) );
99 <table
class="width100" cellspacing
="1">
103 <td
class="form-title">
105 if ( $t_graph_relation )
106 echo lang_get( 'viewing_bug_relationship_graph_title' );
108 echo lang_get( 'viewing_bug_dependency_graph_title' );
114 <span
class="small"><?php
print_bracket_link( 'view.php?id=' . $f_bug_id, lang_get( 'view_issue' ) ) ?
></span
>
116 <!-- Relation
/Dependency Graph
Switch -->
119 if ( $t_graph_relation )
120 print_bracket_link( "bug_relationship_graph.php?bug_id=$f_bug_id&graph=dependency", lang_get( 'dependency_graph' ) );
122 print_bracket_link( "bug_relationship_graph.php?bug_id=$f_bug_id&graph=relation", lang_get( 'relation_graph' ) );
126 if ( !$t_graph_relation ) {
128 <!-- Horizontal
/Vertical
Switch -->
131 if ( $t_graph_horizontal )
132 print_bracket_link( "bug_relationship_graph.php?bug_id=$f_bug_id&graph=dependency&orientation=vertical", lang_get( 'vertical' ) );
134 print_bracket_link( "bug_relationship_graph.php?bug_id=$f_bug_id&graph=dependency&orientation=horizontal", lang_get( 'horizontal' ) );
147 if ( $t_graph_relation )
148 $t_graph = relgraph_generate_rel_graph( $f_bug_id, $t_bug );
150 $t_graph = relgraph_generate_dep_graph( $f_bug_id, $t_bug, $t_graph_horizontal );
152 relgraph_output_map( $t_graph, 'relationship_graph_map' );
154 <div
class="center relationship-graph">
155 <img src
="bug_relationship_graph_img.php?bug_id=<?php echo $f_bug_id ?>&graph=<?php echo $t_graph_type ?>&orientation=<?php echo $t_graph_orientation ?>"
156 border
="0" usemap
="#relationship_graph_map" />
167 <img alt
="" src
="images/rel_related.png" />
168 <?php
echo lang_get( 'related_to' ) ?
>
171 <img alt
="" src
="images/rel_dependant.png" />
172 <?php
echo lang_get( 'blocks' ) ?
>
175 <img alt
="" src
="images/rel_duplicate.png" />
176 <?php
echo lang_get( 'duplicate_of' ) ?
>
188 $_GET['id'] = $f_bug_id;
189 $tpl_fields_config_option = 'bug_view_page_fields';
190 $tpl_show_page_header = false;
191 $tpl_force_readonly = true;
192 $tpl_mantis_dir = dirname( __FILE__
) . DIRECTORY_SEPARATOR
;
193 $tpl_file = __FILE__
;
195 define ( 'BUG_VIEW_INC_ALLOW', true );
196 include( dirname( __FILE__
) . DIRECTORY_SEPARATOR
. 'bug_view_inc.php' );