SOAP API: do not try to unserialize an invalid filter
[mantis.git] / my_view_page.php
blob2665be5fd37e7499870ca7d9cc129e1f8257c1e8
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 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 /**
40 * MantisBT Core API's
42 require_once( 'core.php' );
43 require_api( 'access_api.php' );
44 require_api( 'authentication_api.php' );
45 require_api( 'category_api.php' );
46 require_api( 'compress_api.php' );
47 require_api( 'config_api.php' );
48 require_api( 'constant_inc.php' );
49 require_api( 'current_user_api.php' );
50 require_api( 'gpc_api.php' );
51 require_api( 'helper_api.php' );
52 require_api( 'html_api.php' );
53 require_api( 'lang_api.php' );
54 require_api( 'print_api.php' );
55 require_api( 'user_api.php' );
56 require_css( 'status_config.php' );
58 auth_ensure_user_authenticated();
60 $t_current_user_id = auth_get_current_user_id();
62 # Improve performance by caching category data in one pass
63 category_get_all_rows( helper_get_current_project() );
65 compress_enable();
67 # don't index my view page
68 html_robots_noindex();
70 html_page_top1( lang_get( 'my_view_link' ) );
72 if ( current_user_get_pref( 'refresh_delay' ) > 0 ) {
73 html_meta_redirect( 'my_view_page.php', current_user_get_pref( 'refresh_delay' )*60 );
76 html_page_top2();
78 print_recently_visited();
80 $f_page_number = gpc_get_int( 'page_number', 1 );
82 $t_per_page = config_get( 'my_view_bug_count' );
83 $t_bug_count = null;
84 $t_page_count = null;
86 $t_boxes = config_get( 'my_view_boxes' );
87 asort ($t_boxes);
88 reset ($t_boxes);
89 #print_r ($t_boxes);
91 $t_project_id = helper_get_current_project();
94 <div>
95 <table class="hide" cellspacing="3" cellpadding="0">
97 <?php
98 $t_status_legend_position = config_get( 'status_legend_position' );
100 if ( $t_status_legend_position == STATUS_LEGEND_POSITION_TOP || $t_status_legend_position == STATUS_LEGEND_POSITION_BOTH ) {
101 echo '<tr>';
102 echo '<td colspan="2">';
103 html_status_legend();
104 echo '</td>';
105 echo '</tr>';
108 $t_number_of_boxes = count ( $t_boxes );
109 $t_boxes_position = config_get( 'my_view_boxes_fixed_position' );
110 $t_counter = 0;
112 define( 'MY_VIEW_INC_ALLOW', true );
114 while (list ($t_box_title, $t_box_display) = each ($t_boxes)) {
115 # don't display bugs that are set as 0
116 if ($t_box_display == 0) {
117 $t_number_of_boxes = $t_number_of_boxes - 1;
120 # don't display "Assigned to Me" bugs to users that bugs can't be assigned to
121 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 ) ) {
122 $t_number_of_boxes = $t_number_of_boxes - 1;
125 # don't display "Monitored by Me" bugs to users that can't monitor bugs
126 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 ) ) ) {
127 $t_number_of_boxes = $t_number_of_boxes - 1;
130 # don't display "Reported by Me" bugs to users that can't report bugs
131 else if ( in_array( $t_box_title, array( 'reported', 'feedback', 'verify' ) ) &&
132 ( current_user_is_anonymous() OR !access_has_project_level( config_get( 'report_bug_threshold' ), $t_project_id, $t_current_user_id ) ) ) {
133 $t_number_of_boxes = $t_number_of_boxes - 1;
136 # display the box
137 else {
138 $t_counter++;
140 # check the style of displaying boxes - fixed (ie. each box in a separate table cell) or not
141 if ( ON == $t_boxes_position ) {
142 # for even box number start new row and column
143 if ( 1 == $t_counter%2 ) {
144 echo '<tr><td class="myview-left-col">';
145 include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
146 echo '</td>';
149 # for odd box number only start new column
150 else if ( 0 == $t_counter%2 ) {
151 echo '<td class="myview-right-col">';
152 include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
153 echo '</td></tr>';
156 else if ( OFF == $t_boxes_position ) {
157 # start new table row and column for first box
158 if ( 1 == $t_counter ) {
159 echo '<tr><td class="myview-left-col">';
162 # start new table column for the second half of boxes
163 if ( $t_counter == ceil ($t_number_of_boxes/2) + 1 ) {
164 echo '<td class="myview-right-col">';
167 # display the required box
168 include( dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'my_view_inc.php' );
169 echo '<br />';
171 # close the first column for first half of boxes
172 if ( $t_counter == ceil ($t_number_of_boxes/2) ) {
173 echo '</td>';
179 # Close the box groups depending on the layout mode and whether an empty cell
180 # is required to pad the number of cells in the last row to the full width of
181 # the table.
182 if ( ON == $t_boxes_position && $t_counter == $t_number_of_boxes && 1 == $t_counter%2 ) {
183 echo '<td class="myview-right-col"></td></tr>';
184 } else if ( OFF == $t_boxes_position && $t_counter == $t_number_of_boxes ) {
185 echo '</td></tr>';
188 if ( $t_status_legend_position == STATUS_LEGEND_POSITION_BOTTOM || $t_status_legend_position == STATUS_LEGEND_POSITION_BOTH ) {
189 echo '<tr>';
190 echo '<td colspan="2">';
191 html_status_legend();
192 echo '</td>';
193 echo '</tr>';
197 </table>
198 </div>
200 <?php
201 html_page_bottom();