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/>.
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
22 * @copyright Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
23 * @copyright Copyright (C) 2002 - 2011 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
31 * @uses helper_api.php
37 if ( !defined( 'BUG_MONITOR_LIST_VIEW_INC_ALLOW' ) ) {
41 require_api( 'access_api.php' );
42 require_api( 'collapse_api.php' );
43 require_api( 'config_api.php' );
44 require_api( 'database_api.php' );
45 require_api( 'form_api.php' );
46 require_api( 'helper_api.php' );
47 require_api( 'lang_api.php' );
48 require_api( 'print_api.php' );
49 require_api( 'user_api.php' );
51 if ( access_has_bug_level( config_get( 'show_monitor_list_threshold' ), $f_bug_id ) ) {
53 $t_users = bug_get_monitors( $f_bug_id );
54 $num_users = sizeof ( $t_users );
56 echo '<a id="monitors"></a><br />';
58 collapse_open( 'monitoring' );
60 <table
class="width100" cellspacing
="1">
62 <td
class="form-title" colspan
="2">
64 collapse_icon( 'monitoring' );
66 <?php
echo lang_get( 'users_monitoring_bug' ); ?
>
70 <th
class="category" width
="15%">
71 <?php
echo lang_get( 'monitoring_user_list' ); ?
>
75 if ( 0 == $num_users ) {
76 echo lang_get( 'no_users_monitoring_bug' );
78 $t_can_delete_others = access_has_bug_level( config_get( 'monitor_delete_others_bug_threshold' ), $f_bug_id );
79 for ( $i = 0; $i < $num_users; $i++
) {
80 echo ($i > 0) ?
', ' : '';
81 echo print_user( $t_users[$i] );
82 if ( $t_can_delete_others ) {
83 echo ' [<a class="small" href="' . helper_mantis_url( 'bug_monitor_delete.php' ) . '?bug_id=' . $f_bug_id . '&user_id=' . $t_users[$i] . htmlspecialchars(form_security_param( 'bug_monitor_delete' )) . '">' . lang_get( 'delete_link' ) . '</a>]';
88 if ( access_has_bug_level( config_get( 'monitor_add_others_bug_threshold' ), $f_bug_id ) ) {
91 <form method
="get" action
="bug_monitor_add.php">
92 <?php
echo form_security_field( 'bug_monitor_add' ) ?
>
93 <input type
="hidden" name
="bug_id" value
="<?php echo (integer)$f_bug_id; ?>" />
94 <label
for="bug_monitor_list_username"><?php
echo lang_get( 'username' ) ?
></label
>
95 <input type
="text" id
="bug_monitor_list_username" name
="username" />
96 <input type
="submit" class="button" value
="<?php echo lang_get( 'add_user_to_monitor' ) ?>" />
103 collapse_closed( 'monitoring' );
105 <table
class="width100" cellspacing
="1">
107 <td
class="form-title" colspan
="2"><?php
collapse_icon( 'monitoring' ); ?
>
108 <?php
echo lang_get( 'users_monitoring_bug' ); ?
>
113 collapse_end( 'monitoring' );
117 } # show monitor list