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 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
21 * @link http://www.mantisbt.org
24 * @uses access_api.php
25 * @uses authentication_api.php
26 * @uses category_api.php
27 * @uses compress_api.php
28 * @uses config_api.php
29 * @uses constant_inc.php
30 * @uses current_user_api.php
32 * @uses helper_api.php
39 require_once( 'core.php' );
40 require_api( 'access_api.php' );
41 require_api( 'authentication_api.php' );
42 require_api( 'category_api.php' );
43 require_api( 'compress_api.php' );
44 require_api( 'config_api.php' );
45 require_api( 'constant_inc.php' );
46 require_api( 'current_user_api.php' );
47 require_api( 'gpc_api.php' );
48 require_api( 'helper_api.php' );
49 require_api( 'html_api.php' );
50 require_api( 'lang_api.php' );
51 require_api( 'print_api.php' );
52 require_api( 'user_api.php' );
54 auth_ensure_user_authenticated();
56 $t_current_user_id = auth_get_current_user_id();
58 # Improve performance by caching category data in one pass
59 category_get_all_rows( helper_get_current_project() );
63 # don't index my view page
64 html_robots_noindex();
66 html_page_top1( lang_get( 'my_view_link' ) );
68 if ( current_user_get_pref( 'refresh_delay' ) > 0 ) {
69 html_meta_redirect( 'my_view_page.php', current_user_get_pref( 'refresh_delay' )*60 );
74 print_recently_visited();
76 $f_page_number = gpc_get_int( 'page_number', 1 );
78 $t_per_page = config_get( 'my_view_bug_count' );
82 $t_boxes = config_get( 'my_view_boxes' );
87 $t_project_id = helper_get_current_project();
91 <table
class="hide" border
="0" cellspacing
="3" cellpadding
="0">
94 $t_status_legend_position = config_get( 'status_legend_position' );
96 if ( $t_status_legend_position == STATUS_LEGEND_POSITION_TOP ||
$t_status_legend_position == STATUS_LEGEND_POSITION_BOTH
) {
98 echo '<td colspan="2">';
104 $t_number_of_boxes = count ( $t_boxes );
105 $t_boxes_position = config_get( 'my_view_boxes_fixed_position' );
108 while (list ($t_box_title, $t_box_display) = each ($t_boxes)) {
109 # don't display bugs that are set as 0
110 if ($t_box_display == 0) {
111 $t_number_of_boxes = $t_number_of_boxes - 1;
114 # don't display "Assigned to Me" bugs to users that bugs can't be assigned to
115 else if ( $t_box_title == 'assigned' && ( current_user_is_anonymous() OR user_get_assigned_open_bug_count( $t_current_user_id, $t_project_id ) == 0 ) ) {
116 $t_number_of_boxes = $t_number_of_boxes - 1;
119 # don't display "Monitored by Me" bugs to users that can't monitor bugs
120 else if ( $t_box_title == 'monitored' && ( current_user_is_anonymous() OR !access_has_project_level( config_get( 'monitor_bug_threshold' ), $t_project_id, $t_current_user_id ) ) ) {
121 $t_number_of_boxes = $t_number_of_boxes - 1;
124 # don't display "Reported by Me" bugs to users that can't report bugs
125 else if ( in_array( $t_box_title, array( 'reported', 'feedback', 'verify' ) ) &&
126 ( current_user_is_anonymous() OR !access_has_project_level( config_get( 'report_bug_threshold' ), $t_project_id, $t_current_user_id ) ) ) {
127 $t_number_of_boxes = $t_number_of_boxes - 1;
134 # check the style of displaying boxes - fixed (ie. each box in a separate table cell) or not
135 if ( ON
== $t_boxes_position ) {
136 # for even box number start new row and column
137 if ( 1 == $t_counter%2
) {
138 echo '<tr><td valign="top" width="50%">';
139 include 'my_view_inc.php';
143 # for odd box number only start new column
144 else if ( 0 == $t_counter%2
) {
145 echo '<td valign="top" width="50%">';
146 include 'my_view_inc.php';
150 # for odd number of box display one empty table cell in second column
151 if ( ( $t_counter == $t_number_of_boxes ) && 1 == $t_counter%2
) {
152 echo '<td valign="top" width="50%"></td></tr>';
155 else if ( OFF
== $t_boxes_position ) {
156 # start new table row and column for first box
157 if ( 1 == $t_counter ) {
158 echo '<tr><td valign="top" width="50%">';
161 # start new table column for the second half of boxes
162 if ( $t_counter == ceil ($t_number_of_boxes/2) +
1 ) {
163 echo '<td valign="top" width="50%">';
166 # display the required box
167 include 'my_view_inc.php';
170 # close the first column for first half of boxes
171 if ( $t_counter == ceil ($t_number_of_boxes/2) ) {
175 # close the table row after all of the boxes
176 if ( $t_counter == $t_number_of_boxes ) {
183 if ( $t_status_legend_position == STATUS_LEGEND_POSITION_BOTTOM ||
$t_status_legend_position == STATUS_LEGEND_POSITION_BOTH
) {
185 echo '<td colspan="2">';
186 html_status_legend();