Fix #11417: Allow EVENT_MENU_MAIN plugin events to return null
[mantis/radio.git] / manage_columns_inc.php
blobed4886e08c3a4597a6c32672c04fdf3dbe1a10d5
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 access_api.php
24 * @uses authentication_api.php
25 * @uses columns_api.php
26 * @uses constant_inc.php
27 * @uses current_user_api.php
28 * @uses file_api.php
29 * @uses form_api.php
30 * @uses helper_api.php
31 * @uses html_api.php
32 * @uses lang_api.php
33 * @uses print_api.php
36 require_api( 'access_api.php' );
37 require_api( 'authentication_api.php' );
38 require_api( 'columns_api.php' );
39 require_api( 'constant_inc.php' );
40 require_api( 'current_user_api.php' );
41 require_api( 'file_api.php' );
42 require_api( 'form_api.php' );
43 require_api( 'helper_api.php' );
44 require_api( 'html_api.php' );
45 require_api( 'lang_api.php' );
46 require_api( 'print_api.php' );
48 $t_manage_page = defined( 'MANAGE_COLUMNS' );
49 $t_account_page = defined( 'ACCOUNT_COLUMNS' );
51 # Protect against direct access to this script.
52 if ( !$t_manage_page && !$t_account_page ) {
53 access_denied();
56 $t_project_id = helper_get_current_project();
58 # Calculate the user id to set the configuration for.
59 if ( $t_manage_page ) {
60 $t_user_id = NO_USER;
61 } else {
62 $t_user_id = auth_get_current_user_id();
65 $t_columns = columns_get_all( $t_project_id );
66 $t_all = implode( ', ', $t_columns );
68 $t_columns = helper_get_columns_to_view( COLUMNS_TARGET_CSV_PAGE, /* $p_viewable_only */ false, $t_user_id );
69 $t_csv = implode( ', ', $t_columns );
71 $t_columns = helper_get_columns_to_view( COLUMNS_TARGET_VIEW_PAGE, /* $p_viewable_only */ false, $t_user_id );
72 $t_view_issues = implode( ', ', $t_columns );
74 $t_columns = helper_get_columns_to_view( COLUMNS_TARGET_PRINT_PAGE, /* $p_viewable_only */ false, $t_user_id );
75 $t_print_issues = implode( ', ', $t_columns );
77 $t_columns = helper_get_columns_to_view( COLUMNS_TARGET_EXCEL_PAGE, /* $p_viewable_only */ false, $t_user_id );
78 $t_excel = implode( ', ', $t_columns );
80 echo '<br />';
83 <div align="center">
84 <form name="report_bug_form" method="post" <?php if ( file_allow_bug_upload() ) { echo 'enctype="multipart/form-data"'; } ?> action="manage_config_columns_set.php">
85 <?php echo form_security_field( 'manage_config_columns_set' ) ?>
86 <table class="width50" cellspacing="1">
88 <!-- Title -->
89 <tr>
90 <td class="form-title">
91 <input type="hidden" name="project_id" value="<?php echo $t_project_id ?>" />
92 <input type="hidden" name="form_page" value="<?php echo $t_account_page ? 'account' : 'manage'; ?>" />
93 <?php echo lang_get( 'manage_columns_config' ) ?>
94 </td>
95 <td class="right">
96 <?php
97 if ( $t_account_page ) {
98 print_account_menu( 'account_manage_columns_page.php' );
101 </td>
102 </tr>
104 <!-- view issues columns -->
105 <tr <?php echo helper_alternate_class() ?>>
106 <td class="category">
107 <?php echo lang_get( 'all_columns_title' )?>
108 </td>
109 <td>
110 <textarea <?php echo helper_get_tab_index() ?> name="all_columns" readonly="readonly" cols="80" rows="5"><?php echo $t_all ?></textarea>
111 </td>
112 </tr>
114 <!-- view issues columns -->
115 <tr <?php echo helper_alternate_class() ?>>
116 <td class="category">
117 <?php echo lang_get( 'view_issues_columns_title' ), '<span class="required">*</span>' ?>
118 </td>
119 <td>
120 <textarea <?php echo helper_get_tab_index() ?> name="view_issues_columns" cols="80" rows="5"><?php echo $t_view_issues ?></textarea>
121 </td>
122 </tr>
124 <!-- print issues columns -->
125 <tr <?php echo helper_alternate_class() ?>>
126 <td class="category">
127 <?php echo lang_get( 'print_issues_columns_title' ), '<span class="required">*</span>' ?>
128 </td>
129 <td>
130 <textarea <?php echo helper_get_tab_index() ?> name="print_issues_columns" cols="80" rows="5"><?php echo $t_print_issues ?></textarea>
131 </td>
132 </tr>
134 <!-- csv columns -->
135 <tr <?php echo helper_alternate_class() ?>>
136 <td class="category">
137 <?php echo lang_get( 'csv_columns_title' ), '<span class="required">*</span>' ?>
138 </td>
139 <td>
140 <textarea <?php echo helper_get_tab_index() ?> name="csv_columns" cols="80" rows="5"><?php echo $t_csv ?></textarea>
141 </td>
142 </tr>
144 <!-- csv columns -->
145 <tr <?php echo helper_alternate_class() ?>>
146 <td class="category">
147 <?php echo lang_get( 'excel_columns_title' ), '<span class="required">*</span>' ?>
148 </td>
149 <td>
150 <textarea <?php echo helper_get_tab_index() ?> name="excel_columns" cols="80" rows="5"><?php echo $t_excel ?></textarea>
151 </td>
152 </tr>
154 <!-- Submit Button -->
155 <tr>
156 <td class="left">
157 <span class="required"> * <?php echo lang_get( 'required' ) ?></span>
158 </td>
159 <td class="center">
160 <?php
161 if ( $t_account_page ) {
162 if ( $t_project_id == ALL_PROJECTS ) { ?>
163 <input <?php echo helper_get_tab_index() ?> type="submit" class="button" name="update_columns_as_my_default" value="<?php echo lang_get( 'update_columns_as_my_default' ) ?>" />
164 <?php } else { ?>
165 <input <?php echo helper_get_tab_index() ?> type="submit" class="button" name="update_columns_for_current_project" value="<?php echo lang_get( 'update_columns_for_current_project' ) ?>" />
166 <?php } } ?>
167 <?php if ( $t_manage_page && current_user_is_administrator() ) { ?>
168 <input <?php echo helper_get_tab_index() ?> type="submit" class="button" name="update_columns_as_global_default" value="<?php echo lang_get( 'update_columns_as_global_default' ) ?>" />
169 <?php } ?>
170 </td>
171 </tr>
173 </table>
174 </form>
175 </div>
177 <div align="center">
178 <form method="post" action="manage_columns_copy.php">
179 <?php echo form_security_field( 'manage_columns_copy' ) ?>
180 <table class="width50" cellspacing="1">
182 <!-- Copy Columns -->
183 <tr>
184 <td class="left" colspan="3">
185 <input type="hidden" name="project_id" value="<?php echo $t_project_id ?>" />
186 <input type="hidden" name="manage_page" value="<?php echo $t_manage_page ?>" />
188 <select name="other_project_id">
189 <?php print_project_option_list( /* project_id */ null, /* include_all_projects */ true, /* filter_project_id */ $t_project_id ); ?>
190 </select>
191 <?php
192 # Skip "Copy From" if the current project is ALL PROJECTS, the current page is management page, and the user is not administrator
193 if ( !$t_manage_page || ( $t_project_id != ALL_PROJECTS ) || current_user_is_administrator() ) {
195 <input type="submit" name="copy_from" class="button" value="<?php echo lang_get( 'copy_columns_from' ) ?>" />
196 <?php
199 <input type="submit" name="copy_to" class="button" value="<?php echo lang_get( 'copy_columns_to' ) ?>" />
200 </td>
201 </tr>
202 </table>
203 </form>
204 </div>
206 <br />
208 <?php
209 if ( $t_account_page ) {
211 <!-- RESET CONFIGURATION -->
212 <div class="border center">
213 <!-- Reset Button -->
214 <form method="post" action="manage_config_columns_reset.php">
215 <?php echo form_security_field( 'manage_config_columns_reset' ) ?>
216 <input type="submit" class="button" value="<?php echo lang_get( 'reset_columns_configuration' ) ?>" />
217 </form>
218 </div>
219 <?php