Fix #11417: Allow EVENT_MENU_MAIN plugin events to return null
[mantis/radio.git] / manage_custom_field_edit_page.php
blob9c083e35ebe2f8828d493b67e8441bcf28e17693
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 config_api.php
27 * @uses custom_field_api.php
28 * @uses form_api.php
29 * @uses gpc_api.php
30 * @uses helper_api.php
31 * @uses html_api.php
32 * @uses lang_api.php
33 * @uses print_api.php
34 * @uses string_api.php
37 require_once( 'core.php' );
38 require_api( 'access_api.php' );
39 require_api( 'authentication_api.php' );
40 require_api( 'config_api.php' );
41 require_api( 'custom_field_api.php' );
42 require_api( 'form_api.php' );
43 require_api( 'gpc_api.php' );
44 require_api( 'helper_api.php' );
45 require_api( 'html_api.php' );
46 require_api( 'lang_api.php' );
47 require_api( 'print_api.php' );
48 require_api( 'string_api.php' );
50 auth_reauthenticate();
52 access_ensure_global_level( config_get( 'manage_custom_fields_threshold' ) );
54 $f_field_id = gpc_get_int( 'field_id' );
55 $f_return = strip_tags( gpc_get_string( 'return', 'manage_custom_field_page.php' ) );
57 custom_field_ensure_exists( $f_field_id );
59 html_page_top();
61 print_manage_menu( 'manage_custom_field_edit_page.php' );
63 $t_definition = custom_field_get_definition( $f_field_id );
65 <br />
66 <div align="center">
67 <form method="post" action="manage_custom_field_update.php">
68 <?php echo form_security_field( 'manage_custom_field_update' ); ?>
69 <input type="hidden" name="field_id" value="<?php echo $f_field_id ?>" />
70 <input type="hidden" name="return" value="<?php echo $f_return ?>" />
72 <table class="width50" cellspacing="1">
73 <tr>
74 <td class="form-title" colspan="2">
75 <?php echo lang_get( 'edit_custom_field_title' ) ?>
76 </td>
77 </tr>
78 <tr <?php echo helper_alternate_class() ?>>
79 <td class="category">
80 <?php echo lang_get( 'custom_field_name' ) ?>
81 </td>
82 <td>
83 <input type="text" name="name" size="32" maxlength="64" value="<?php echo string_attribute( $t_definition['name'] ) ?>" />
84 </td>
85 </tr>
86 <tr <?php echo helper_alternate_class() ?>>
87 <td class="category">
88 <?php echo lang_get( 'custom_field_type' ) ?>
89 </td>
90 <td>
91 <select name="type">
92 <?php print_enum_string_option_list( 'custom_field_type', $t_definition['type'] ) ?>
93 </select>
94 </td>
95 </tr>
96 <tr <?php echo helper_alternate_class() ?>>
97 <td class="category">
98 <?php echo lang_get( 'custom_field_possible_values' ) ?>
99 </td>
100 <td>
101 <input type="text" name="possible_values" size="32" value="<?php echo string_attribute( $t_definition['possible_values'] ) ?>" />
102 </td>
103 </tr>
104 <tr <?php echo helper_alternate_class() ?>>
105 <td class="category">
106 <?php echo lang_get( 'custom_field_default_value' ) ?>
107 </td>
108 <td>
109 <input type="text" name="default_value" size="32" maxlength="255" value="<?php echo string_attribute( $t_definition['default_value'] ) ?>" />
110 </td>
111 </tr>
112 <tr <?php echo helper_alternate_class() ?>>
113 <td class="category">
114 <?php echo lang_get( 'custom_field_valid_regexp' ) ?>
115 </td>
116 <td>
117 <input type="text" name="valid_regexp" size="32" maxlength="255" value="<?php echo string_attribute( $t_definition['valid_regexp'] ) ?>" />
118 </td>
119 </tr>
120 <tr <?php echo helper_alternate_class() ?>>
121 <td class="category">
122 <?php echo lang_get( 'custom_field_access_level_r' ) ?>
123 </td>
124 <td>
125 <select name="access_level_r">
126 <?php print_enum_string_option_list( 'access_levels', $t_definition['access_level_r'] ) ?>
127 </select>
128 </td>
129 </tr>
130 <tr <?php echo helper_alternate_class() ?>>
131 <td class="category">
132 <?php echo lang_get( 'custom_field_access_level_rw' ) ?>
133 </td>
134 <td>
135 <select name="access_level_rw">
136 <?php print_enum_string_option_list( 'access_levels', $t_definition['access_level_rw'] ) ?>
137 </select>
138 </td>
139 </tr>
140 <tr <?php echo helper_alternate_class() ?>>
141 <td class="category">
142 <?php echo lang_get( 'custom_field_length_min' ) ?>
143 </td>
144 <td>
145 <input type="text" name="length_min" size="32" maxlength="64" value="<?php echo $t_definition['length_min'] ?>" />
146 </td>
147 </tr>
148 <tr <?php echo helper_alternate_class() ?>>
149 <td class="category">
150 <?php echo lang_get( 'custom_field_length_max' ) ?>
151 </td>
152 <td>
153 <input type="text" name="length_max" size="32" maxlength="64" value="<?php echo $t_definition['length_max'] ?>" />
154 </td>
155 </tr>
156 <tr <?php echo helper_alternate_class() ?>>
157 <td class="category">
158 <?php echo lang_get( 'custom_field_filter_by' ) ?>
159 </td>
160 <td>
161 <input type="checkbox" name="filter_by" <?php if ( $t_definition['filter_by'] ) { ?>checked="checked"<?php } ?> />
162 </td>
163 </tr>
164 <tr <?php echo helper_alternate_class() ?>>
165 <td class="category">
166 <?php echo lang_get( 'custom_field_display_report' ) ?>
167 </td>
168 <td>
169 <input type="checkbox" name="display_report" value="1" <?php check_checked( $t_definition['display_report'] ) ?> />
170 </td>
171 </tr>
172 <tr <?php echo helper_alternate_class() ?>>
173 <td class="category">
174 <?php echo lang_get( 'custom_field_display_update' ) ?>
175 </td>
176 <td>
177 <input type="checkbox" name="display_update" value="1" <?php check_checked( $t_definition['display_update'] ) ?> />
178 </td>
179 </tr>
180 <tr <?php echo helper_alternate_class() ?>>
181 <td class="category">
182 <?php echo lang_get( 'custom_field_display_resolved' ) ?>
183 </td>
184 <td>
185 <input type="checkbox" name="display_resolved" value="1" <?php check_checked( $t_definition['display_resolved'] ) ?> />
186 </td>
187 </tr>
188 <tr <?php echo helper_alternate_class() ?>>
189 <td class="category">
190 <?php echo lang_get( 'custom_field_display_closed' ) ?>
191 </td>
192 <td>
193 <input type="checkbox" name="display_closed" value="1" <?php check_checked( $t_definition['display_closed'] ) ?> />
194 </td>
195 </tr>
196 <tr <?php echo helper_alternate_class() ?>>
197 <td class="category">
198 <?php echo lang_get( 'custom_field_require_report' ) ?>
199 </td>
200 <td>
201 <input type="checkbox" name="require_report" value="1" <?php check_checked( $t_definition['require_report'] ) ?> />
202 </td>
203 </tr>
204 <tr <?php echo helper_alternate_class() ?>>
205 <td class="category">
206 <?php echo lang_get( 'custom_field_require_update' ) ?>
207 </td>
208 <td>
209 <input type="checkbox" name="require_update" value="1" <?php check_checked( $t_definition['require_update'] ) ?> />
210 </td>
211 </tr>
212 <tr <?php echo helper_alternate_class() ?>>
213 <td class="category">
214 <?php echo lang_get( 'custom_field_require_resolved' ) ?>
215 </td>
216 <td>
217 <input type="checkbox" name="require_resolved" value="1" <?php check_checked( $t_definition['require_resolved'] ) ?> />
218 </td>
219 </tr>
220 <tr <?php echo helper_alternate_class() ?>>
221 <td class="category">
222 <?php echo lang_get( 'custom_field_require_closed' ) ?>
223 </td>
224 <td>
225 <input type="checkbox" name="require_closed" value="1" <?php check_checked( $t_definition['require_closed'] ) ?> />
226 </td>
227 </tr>
228 <tr>
229 <td>&nbsp;</td>
230 <td>
231 <input type="submit" class="button" value="<?php echo lang_get( 'update_custom_field_button' ) ?>" />
232 </td>
233 </tr>
234 </table>
235 </form>
236 </div>
238 <br />
240 <div class="border center">
241 <form method="post" action="manage_custom_field_delete.php">
242 <?php echo form_security_field( 'manage_custom_field_delete' ); ?>
243 <input type="hidden" name="field_id" value="<?php echo $f_field_id ?>" />
244 <input type="hidden" name="return" value="<?php echo string_attribute( $f_return ) ?>" />
245 <input type="submit" class="button" value="<?php echo lang_get( 'delete_custom_field_button' ) ?>" />
246 </form>
247 </div>
249 <?php /** @todo There is access checking in the ADD action page and at the top of this file.
250 * We may need to add extra checks to exclude projects from the list that the user
251 * can't link/unlink fields from/to. */
253 <br />
254 <div align="center">
255 <form method="post" action="manage_custom_field_proj_add.php">
256 <?php echo form_security_field( 'manage_custom_field_proj_add' ); ?>
257 <table class="width75" cellspacing="1">
258 <!-- Title -->
259 <tr>
260 <td class="form-title" colspan="2">
261 <input type="hidden" name="field_id" value="<?php echo $f_field_id ?>" />
262 <?php echo lang_get( 'link_custom_field_to_project_title' ) ?>
263 </td>
264 </tr>
266 <!-- Assigned Projects -->
267 <tr <?php echo helper_alternate_class( 1 ) ?> valign="top">
268 <td class="category" width="30%">
269 <?php echo lang_get( 'linked_projects_label' ) ?>
270 </td>
271 <td width="70%">
272 <?php print_custom_field_projects_list( $f_field_id ) ?>
273 </td>
274 </tr>
276 <!-- Unassigend Project Selection -->
277 <tr <?php echo helper_alternate_class() ?> valign="top">
278 <td class="category">
279 <?php echo lang_get( 'projects_title_label' ) ?>
280 </td>
281 <td>
282 <select name="project_id[]" multiple="multiple" size="5">
283 <?php print_project_option_list( null, false ); ?>
284 </select>
285 </td>
286 </tr>
288 <!-- Sequence Number -->
289 <tr <?php echo helper_alternate_class() ?> valign="top">
290 <td class="category">
291 <?php echo lang_get( 'custom_field_sequence_label' ) ?>
292 </td>
293 <td>
294 <input type="text" name="sequence" value="0" />
295 </td>
296 </tr>
298 <!-- Submit Buttom -->
299 <tr>
300 <td class="center" colspan="2">
301 <input type="submit" class="button" value="<?php echo lang_get( 'link_custom_field_to_project_button' ) ?>" />
302 </td>
303 </tr>
304 </table>
305 </form>
306 </div>
308 <?php
309 html_page_bottom();