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/>.
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
24 * @uses access_api.php
25 * @uses authentication_api.php
26 * @uses config_api.php
27 * @uses custom_field_api.php
30 * @uses helper_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 );
61 print_manage_menu( 'manage_custom_field_edit_page.php' );
63 $t_definition = custom_field_get_definition( $f_field_id );
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">
74 <td
class="form-title" colspan
="2">
75 <?php
echo lang_get( 'edit_custom_field_title' ) ?
>
78 <tr
<?php
echo helper_alternate_class() ?
>>
80 <?php
echo lang_get( 'custom_field_name' ) ?
>
83 <input type
="text" name
="name" size
="32" maxlength
="64" value
="<?php echo string_attribute( $t_definition['name'] ) ?>" />
86 <tr
<?php
echo helper_alternate_class() ?
>>
88 <?php
echo lang_get( 'custom_field_type' ) ?
>
92 <?php
print_enum_string_option_list( 'custom_field_type', $t_definition['type'] ) ?
>
96 <tr
<?php
echo helper_alternate_class() ?
>>
98 <?php
echo lang_get( 'custom_field_possible_values' ) ?
>
101 <input type
="text" name
="possible_values" size
="32" value
="<?php echo string_attribute( $t_definition['possible_values'] ) ?>" />
104 <tr
<?php
echo helper_alternate_class() ?
>>
105 <td
class="category">
106 <?php
echo lang_get( 'custom_field_default_value' ) ?
>
109 <input type
="text" name
="default_value" size
="32" maxlength
="255" value
="<?php echo string_attribute( $t_definition['default_value'] ) ?>" />
112 <tr
<?php
echo helper_alternate_class() ?
>>
113 <td
class="category">
114 <?php
echo lang_get( 'custom_field_valid_regexp' ) ?
>
117 <input type
="text" name
="valid_regexp" size
="32" maxlength
="255" value
="<?php echo string_attribute( $t_definition['valid_regexp'] ) ?>" />
120 <tr
<?php
echo helper_alternate_class() ?
>>
121 <td
class="category">
122 <?php
echo lang_get( 'custom_field_access_level_r' ) ?
>
125 <select name
="access_level_r">
126 <?php
print_enum_string_option_list( 'access_levels', $t_definition['access_level_r'] ) ?
>
130 <tr
<?php
echo helper_alternate_class() ?
>>
131 <td
class="category">
132 <?php
echo lang_get( 'custom_field_access_level_rw' ) ?
>
135 <select name
="access_level_rw">
136 <?php
print_enum_string_option_list( 'access_levels', $t_definition['access_level_rw'] ) ?
>
140 <tr
<?php
echo helper_alternate_class() ?
>>
141 <td
class="category">
142 <?php
echo lang_get( 'custom_field_length_min' ) ?
>
145 <input type
="text" name
="length_min" size
="32" maxlength
="64" value
="<?php echo $t_definition['length_min'] ?>" />
148 <tr
<?php
echo helper_alternate_class() ?
>>
149 <td
class="category">
150 <?php
echo lang_get( 'custom_field_length_max' ) ?
>
153 <input type
="text" name
="length_max" size
="32" maxlength
="64" value
="<?php echo $t_definition['length_max'] ?>" />
156 <tr
<?php
echo helper_alternate_class() ?
>>
157 <td
class="category">
158 <?php
echo lang_get( 'custom_field_filter_by' ) ?
>
161 <input type
="checkbox" name
="filter_by" <?php
if ( $t_definition['filter_by'] ) { ?
>checked
="checked"<?php
} ?
> />
164 <tr
<?php
echo helper_alternate_class() ?
>>
165 <td
class="category">
166 <?php
echo lang_get( 'custom_field_display_report' ) ?
>
169 <input type
="checkbox" name
="display_report" value
="1" <?php
check_checked( $t_definition['display_report'] ) ?
> />
172 <tr
<?php
echo helper_alternate_class() ?
>>
173 <td
class="category">
174 <?php
echo lang_get( 'custom_field_display_update' ) ?
>
177 <input type
="checkbox" name
="display_update" value
="1" <?php
check_checked( $t_definition['display_update'] ) ?
> />
180 <tr
<?php
echo helper_alternate_class() ?
>>
181 <td
class="category">
182 <?php
echo lang_get( 'custom_field_display_resolved' ) ?
>
185 <input type
="checkbox" name
="display_resolved" value
="1" <?php
check_checked( $t_definition['display_resolved'] ) ?
> />
188 <tr
<?php
echo helper_alternate_class() ?
>>
189 <td
class="category">
190 <?php
echo lang_get( 'custom_field_display_closed' ) ?
>
193 <input type
="checkbox" name
="display_closed" value
="1" <?php
check_checked( $t_definition['display_closed'] ) ?
> />
196 <tr
<?php
echo helper_alternate_class() ?
>>
197 <td
class="category">
198 <?php
echo lang_get( 'custom_field_require_report' ) ?
>
201 <input type
="checkbox" name
="require_report" value
="1" <?php
check_checked( $t_definition['require_report'] ) ?
> />
204 <tr
<?php
echo helper_alternate_class() ?
>>
205 <td
class="category">
206 <?php
echo lang_get( 'custom_field_require_update' ) ?
>
209 <input type
="checkbox" name
="require_update" value
="1" <?php
check_checked( $t_definition['require_update'] ) ?
> />
212 <tr
<?php
echo helper_alternate_class() ?
>>
213 <td
class="category">
214 <?php
echo lang_get( 'custom_field_require_resolved' ) ?
>
217 <input type
="checkbox" name
="require_resolved" value
="1" <?php
check_checked( $t_definition['require_resolved'] ) ?
> />
220 <tr
<?php
echo helper_alternate_class() ?
>>
221 <td
class="category">
222 <?php
echo lang_get( 'custom_field_require_closed' ) ?
>
225 <input type
="checkbox" name
="require_closed" value
="1" <?php
check_checked( $t_definition['require_closed'] ) ?
> />
231 <input type
="submit" class="button" value
="<?php echo lang_get( 'update_custom_field_button' ) ?>" />
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' ) ?>" />
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. */
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">
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' ) ?
>
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' ) ?
>
272 <?php
print_custom_field_projects_list( $f_field_id ) ?
>
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' ) ?
>
282 <select name
="project_id[]" multiple
="multiple" size
="5">
283 <?php
print_project_option_list( null, false ); ?
>
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' ) ?
>
294 <input type
="text" name
="sequence" value
="0" />
298 <!-- Submit Buttom
-->
300 <td
class="center" colspan
="2">
301 <input type
="submit" class="button" value
="<?php echo lang_get( 'link_custom_field_to_project_button' ) ?>" />