Fix #11417: Allow EVENT_MENU_MAIN plugin events to return null
[mantis/radio.git] / my_view_page.php
blob68969e22fc9ac9eef831f7d856d156058418f157
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 - 2010 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 category_api.php
27 * @uses compress_api.php
28 * @uses config_api.php
29 * @uses constant_inc.php
30 * @uses current_user_api.php
31 * @uses gpc_api.php
32 * @uses helper_api.php
33 * @uses html_api.php
34 * @uses lang_api.php
35 * @uses print_api.php
36 * @uses user_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() );
61 compress_enable();
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 );
72 html_page_top2();
74 print_recently_visited();
76 $f_page_number = gpc_get_int( 'page_number', 1 );
78 $t_per_page = config_get( 'my_view_bug_count' );
79 $t_bug_count = null;
80 $t_page_count = null;
82 $t_boxes = config_get( 'my_view_boxes' );
83 asort ($t_boxes);
84 reset ($t_boxes);
85 #print_r ($t_boxes);
87 $t_project_id = helper_get_current_project();
90 <div align="center">
91 <table class="hide" border="0" cellspacing="3" cellpadding="0">
93 <?php
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 ) {
97 echo '<tr>';
98 echo '<td colspan="2">';
99 html_status_legend();
100 echo '</td>';
101 echo '</tr>';
104 $t_number_of_boxes = count ( $t_boxes );
105 $t_boxes_position = config_get( 'my_view_boxes_fixed_position' );
106 $t_counter = 0;
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;
130 # display the box
131 else {
132 $t_counter++;
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';
140 echo '</td>';
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';
147 echo '</td></tr>';
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';
168 echo '<br />';
170 # close the first column for first half of boxes
171 if ( $t_counter == ceil ($t_number_of_boxes/2) ) {
172 echo '</td>';
175 # close the table row after all of the boxes
176 if ( $t_counter == $t_number_of_boxes ) {
177 echo '</td></tr>';
183 if ( $t_status_legend_position == STATUS_LEGEND_POSITION_BOTTOM || $t_status_legend_position == STATUS_LEGEND_POSITION_BOTH ) {
184 echo '<tr>';
185 echo '<td colspan="2">';
186 html_status_legend();
187 echo '</td>';
188 echo '</tr>';
192 </table>
193 </div>
195 <?php
196 html_page_bottom();