Fix #11417: Allow EVENT_MENU_MAIN plugin events to return null
[mantis/radio.git] / bug_monitor_list_view_inc.php
bloba92830dbc9955000f1a44de2d6cb7a15ccd16ef8
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 * This include file prints out the list of users monitoring the current
19 * bug. $f_bug_id must be set and be set to the bug id
21 * @package MantisBT
22 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
23 * @copyright Copyright (C) 2002 - 2010 MantisBT Team - mantisbt-dev@lists.sourceforge.net
24 * @link http://www.mantisbt.org
26 * @uses access_api.php
27 * @uses collapse_api.php
28 * @uses config_api.php
29 * @uses database_api.php
30 * @uses form_api.php
31 * @uses helper_api.php
32 * @uses lang_api.php
33 * @uses print_api.php
34 * @uses user_api.php
37 require_api( 'access_api.php' );
38 require_api( 'collapse_api.php' );
39 require_api( 'config_api.php' );
40 require_api( 'database_api.php' );
41 require_api( 'form_api.php' );
42 require_api( 'helper_api.php' );
43 require_api( 'lang_api.php' );
44 require_api( 'print_api.php' );
45 require_api( 'user_api.php' );
47 if ( access_has_bug_level( config_get( 'show_monitor_list_threshold' ), $f_bug_id ) ) {
48 $c_bug_id = db_prepare_int( $f_bug_id );
49 $t_bug_monitor_table = db_get_table( 'bug_monitor' );
50 $t_user_table = db_get_table( 'user' );
52 # get the bugnote data
53 $query = "SELECT user_id, enabled
54 FROM $t_bug_monitor_table m, $t_user_table u
55 WHERE m.bug_id=" . db_param() . " AND m.user_id = u.id
56 ORDER BY u.realname, u.username";
57 $result = db_query_bound($query, Array( $c_bug_id ) );
58 $num_users = db_num_rows($result);
60 $t_users = array();
61 for ( $i = 0; $i < $num_users; $i++ ) {
62 $row = db_fetch_array( $result );
63 $t_users[$i] = $row['user_id'];
65 user_cache_array_rows( $t_users );
67 echo '<a name="monitors" id="monitors" /><br />';
69 collapse_open( 'monitoring' );
71 <table class="width100" cellspacing="1">
72 <tr>
73 <td class="form-title" colspan="2">
74 <?php
75 collapse_icon( 'monitoring' );
77 <?php echo lang_get( 'users_monitoring_bug' ); ?>
78 </td>
79 </tr>
80 <tr class="row-1">
81 <td class="category" width="15%">
82 <?php echo lang_get( 'monitoring_user_list' ); ?>
83 </td>
84 <td>
85 <?php
86 if ( 0 == $num_users ) {
87 echo lang_get( 'no_users_monitoring_bug' );
88 } else {
89 $t_can_delete_others = access_has_bug_level( config_get( 'monitor_delete_others_bug_threshold' ), $f_bug_id );
90 for ( $i = 0; $i < $num_users; $i++ ) {
91 echo ($i > 0) ? ', ' : '';
92 echo print_user( $t_users[$i] );
93 if ( $t_can_delete_others ) {
94 echo ' [<a class="small" href="' . helper_mantis_url( 'bug_monitor_delete.php' ) . '?bug_id=' . $f_bug_id . '&user_id=' . $t_users[$i] . form_security_param( 'bug_monitor_delete' ) . '">' . lang_get( 'delete_link' ) . '</a>]';
99 if ( access_has_bug_level( config_get( 'monitor_add_others_bug_threshold' ), $f_bug_id ) ) {
100 echo '<br /><br />', lang_get( 'username' );
102 <form method="get" action="bug_monitor_add.php">
103 <?php echo form_security_field( 'bug_monitor_add' ) ?>
104 <input type="hidden" name="bug_id" value="<?php echo (integer)$f_bug_id; ?>" />
105 <input type="text" name="username" />
106 <input type="submit" class="button" value="<?php echo lang_get( 'add_user_to_monitor' ) ?>" />
107 </form>
108 <?php } ?>
109 </td>
110 </tr>
111 </table>
112 <?php
113 collapse_closed( 'monitoring' );
115 <table class="width100" cellspacing="1">
116 <tr>
117 <td class="form-title" colspan="2"><?php collapse_icon( 'monitoring' ); ?>
118 <?php echo lang_get( 'users_monitoring_bug' ); ?>
119 </td>
120 </tr>
121 </table>
122 <?php
123 collapse_end( 'monitoring' );
126 <?php
127 } # show monitor list