$t_custom_fields = custom_field_get_ids();
foreach ($t_custom_fields as $t_field_id) {
    $t_desc = custom_field_get_definition($t_field_id);
    ?>
		<tr>
			<td>
				<a href="manage_custom_field_edit_page.php?field_id=<?php 
    echo $t_field_id;
    ?>
"><?php 
    echo custom_field_get_display_name($t_desc['name']);
    ?>
</a>
			</td>
			<td><?php 
    echo count(custom_field_get_project_ids($t_field_id));
    ?>
</td>
			<td><?php 
    echo get_enum_element('custom_field_type', $t_desc['type']);
    ?>
</td>
			<td><?php 
    echo string_display($t_desc['possible_values']);
    ?>
</td>
			<td><?php 
    echo string_display($t_desc['default_value']);
    ?>
</td>
		</tr><?php 
Example #2
0
function print_custom_field_projects_list($p_field_id)
{
    $c_field_id = (int) $p_field_id;
    $t_project_ids = custom_field_get_project_ids($p_field_id);
    $t_security_token = form_security_param('manage_proj_custom_field_remove');
    foreach ($t_project_ids as $t_project_id) {
        $t_project_name = project_get_field($t_project_id, 'name');
        $t_sequence = custom_field_get_sequence($p_field_id, $t_project_id);
        echo '<strong>', string_display_line($t_project_name), '</strong>: ';
        print_bracket_link("manage_proj_custom_field_remove.php?field_id={$c_field_id}&project_id={$t_project_id}&return=custom_field{$t_security_token}", lang_get('remove_link'));
        echo '<br />- ';
        $t_linked_field_ids = custom_field_get_linked_ids($t_project_id);
        $t_current_project_fields = array();
        $t_first = true;
        foreach ($t_linked_field_ids as $t_current_field_id) {
            if ($t_first) {
                $t_first = false;
            } else {
                echo ', ';
            }
            if ($t_current_field_id == $p_field_id) {
                echo '<em>';
            }
            echo string_display_line(custom_field_get_field($t_current_field_id, 'name'));
            echo ' (', custom_field_get_sequence($t_current_field_id, $t_project_id), ')';
            if ($t_current_field_id == $p_field_id) {
                echo '</em>';
            }
        }
        echo '<br /><br />';
    }
}
 function customFieldIsInProject($p_field_name)
 {
     $t_field_id = custom_field_get_id_from_name($p_field_name);
     $t_result = custom_field_get_project_ids($t_field_id);
     return !empty($t_result);
 }
#
# You should have received a copy of the GNU General Public License
# along with Mantis.  If not, see <http://www.gnu.org/licenses/>.
# --------------------------------------------------------
# $Id: manage_custom_field_delete.php,v 1.17.2.1 2007-10-13 22:33:27 giallu Exp $
# --------------------------------------------------------
require_once 'core.php';
$t_core_path = config_get('core_path');
require_once $t_core_path . 'custom_field_api.php';
form_security_validate('manage_custom_field_delete');
auth_reauthenticate();
access_ensure_global_level(config_get('manage_custom_fields_threshold'));
$f_field_id = gpc_get_int('field_id');
$f_return = strip_tags(gpc_get_string('return', 'manage_custom_field_page.php'));
$t_definition = custom_field_get_definition($f_field_id);
if (0 < count(custom_field_get_project_ids($f_field_id))) {
    helper_ensure_confirmed(lang_get('confirm_used_custom_field_deletion') . '<br/>' . lang_get('custom_field') . ': ' . string_attribute($t_definition['name']), lang_get('field_delete_button'));
} else {
    helper_ensure_confirmed(lang_get('confirm_custom_field_deletion') . '<br/>' . lang_get('custom_field') . ': ' . string_attribute($t_definition['name']), lang_get('field_delete_button'));
}
custom_field_destroy($f_field_id);
form_security_purge('manage_custom_field_delete');
html_page_top1();
html_meta_redirect($f_return);
html_page_top2();
?>

<br />
<div align="center">
<?php 
echo lang_get('operation_successful') . '<br />';
	<table cellspacing="1" cellpadding="5" border="1">
		<tr>
			<th class="category"><?php echo lang_get( 'custom_field_name' ) ?></th>
			<th class="category"><?php echo lang_get( 'custom_field_project_count' ) ?></th>
			<th class="category"><?php echo lang_get( 'custom_field_type' ) ?></th>
			<th class="category"><?php echo lang_get( 'custom_field_possible_values' ) ?></th>
			<th class="category"><?php echo lang_get( 'custom_field_default_value' ) ?></th>
		</tr><?php
		$t_custom_fields = custom_field_get_ids();
		foreach( $t_custom_fields as $t_field_id ) {
			$t_desc = custom_field_get_definition( $t_field_id ); ?>
		<tr <?php echo helper_alternate_class() ?>>
			<td>
				<a href="manage_custom_field_edit_page.php?field_id=<?php echo $t_field_id ?>"><?php echo string_display( $t_desc['name'] ) ?></a>
			</td>
			<td><?php echo count( custom_field_get_project_ids( $t_field_id ) ) ?></td>
			<td><?php echo get_enum_element( 'custom_field_type', $t_desc['type'] ) ?></td>
			<td><?php echo string_display( $t_desc['possible_values'] ) ?></td>
			<td><?php echo string_display( $t_desc['default_value'] ) ?></td>
		</tr><?php
		} # Create Form END ?>
	</table>
	<form method="post" action="manage_custom_field_create.php">
		<fieldset>
			<?php echo form_security_field( 'manage_custom_field_create' ); ?>
			<input type="text" name="name" size="32" maxlength="64" />
			<input type="submit" class="button" value="<?php echo lang_get( 'add_custom_field_button' ) ?>" />
		</fieldset>
	</form>
</div><?php