SOAP API: do not try to unserialize an invalid filter
[mantis.git] / bug_relationship_graph.php
blobb74da52e773cde942792a0df3570b82ede7b48d8
1 <?php
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/>.
17 /**
18 * @package MantisBT
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
23 * @uses core.php
24 * @uses access_api.php
25 * @uses authentication_api.php
26 * @uses bug_api.php
27 * @uses compress_api.php
28 * @uses config_api.php
29 * @uses constant_inc.php
30 * @uses gpc_api.php
31 * @uses helper_api.php
32 * @uses html_api.php
33 * @uses lang_api.php
34 * @uses print_api.php
35 * @uses relationship_graph_api.php
38 /**
39 * MantisBT Core API's
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
56 # this script.
58 auth_ensure_user_authenticated();
60 if ( ON != config_get( 'relationship_graph_enable' ) )
61 access_denied();
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;
70 } else {
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;
78 } else {
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 );
93 compress_enable();
95 html_page_top( bug_format_summary( $f_bug_id, SUMMARY_CAPTION ) );
97 <br />
99 <table class="width100" cellspacing="1">
101 <tr>
102 <!-- Title -->
103 <td class="form-title">
104 <?php
105 if ( $t_graph_relation )
106 echo lang_get( 'viewing_bug_relationship_graph_title' );
107 else
108 echo lang_get( 'viewing_bug_dependency_graph_title' );
110 </td>
111 <!-- Links -->
112 <td class="right">
113 <!-- View Issue -->
114 <span class="small"><?php print_bracket_link( 'view.php?id=' . $f_bug_id, lang_get( 'view_issue' ) ) ?></span>
116 <!-- Relation/Dependency Graph Switch -->
117 <span class="small">
118 <?php
119 if ( $t_graph_relation )
120 print_bracket_link( "bug_relationship_graph.php?bug_id=$f_bug_id&graph=dependency", lang_get( 'dependency_graph' ) );
121 else
122 print_bracket_link( "bug_relationship_graph.php?bug_id=$f_bug_id&graph=relation", lang_get( 'relation_graph' ) );
124 </span>
125 <?php
126 if ( !$t_graph_relation ) {
128 <!-- Horizontal/Vertical Switch -->
129 <span class="small">
130 <?php
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' ) );
133 else
134 print_bracket_link( "bug_relationship_graph.php?bug_id=$f_bug_id&graph=dependency&orientation=horizontal", lang_get( 'horizontal' ) );
136 </span>
137 <?php
140 </td>
141 </tr>
143 <tr>
144 <!-- Graph -->
145 <td colspan="2">
146 <?php
147 if ( $t_graph_relation )
148 $t_graph = relgraph_generate_rel_graph( $f_bug_id, $t_bug );
149 else
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 ?>&amp;graph=<?php echo $t_graph_type ?>&amp;orientation=<?php echo $t_graph_orientation ?>"
156 border="0" usemap="#relationship_graph_map" />
157 </div>
158 </td>
159 </tr>
161 <tr>
162 <!-- Legend -->
163 <td colspan="2">
164 <table class="hide">
165 <tr>
166 <td class="center">
167 <img alt="" src="images/rel_related.png" />
168 <?php echo lang_get( 'related_to' ) ?>
169 </td>
170 <td class="center">
171 <img alt="" src="images/rel_dependant.png" />
172 <?php echo lang_get( 'blocks' ) ?>
173 </td>
174 <td class="center">
175 <img alt="" src="images/rel_duplicate.png" />
176 <?php echo lang_get( 'duplicate_of' ) ?>
177 </td>
178 </tr>
179 </table>
180 </td>
181 </tr>
183 </table>
185 <br />
187 <?php
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' );