Ejemplo n.º 1
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 />';
    }
}
Ejemplo n.º 2
0
function project_copy_custom_fields($p_destination_id, $p_source_id)
{
    $t_custom_field_ids = custom_field_get_linked_ids($p_source_id);
    foreach ($t_custom_field_ids as $t_custom_field_id) {
        if (!custom_field_is_linked($t_custom_field_id, $p_destination_id)) {
            custom_field_link($t_custom_field_id, $p_destination_id);
            $t_sequence = custom_field_get_sequence($t_custom_field_id, $p_source_id);
            custom_field_set_sequence($t_custom_field_id, $p_destination_id, $t_sequence);
        }
    }
}
Ejemplo n.º 3
0
				</td>
				<td>
<form method="post" action="manage_proj_custom_field_update.php">
	<?php 
            echo form_security_field('manage_proj_custom_field_update');
            ?>
	<input type="hidden" name="project_id" value="<?php 
            echo $f_project_id;
            ?>
" />
	<input type="hidden" name="field_id" value="<?php 
            echo $t_field_id;
            ?>
" />
	<input type="text" name="sequence" value="<?php 
            echo custom_field_get_sequence($t_field_id, $f_project_id);
            ?>
" size="2" />
	<input type="submit" class="button-small" value="<?php 
            echo lang_get('update');
            ?>
" />
</form>
	<?php 
            $t_index++;
            ?>
				</td>
				<td class="center">
				<?php 
            # You need global permissions to edit custom field defs
            print_button("manage_proj_custom_field_remove.php?field_id={$t_field_id}&project_id={$f_project_id}", lang_get('remove_link'));
Ejemplo n.º 4
0
		<tr class="row-category">
			<th><?php echo lang_get( 'custom_field' ) ?></th>
			<th><?php echo lang_get( 'custom_field_sequence' ) ?></th>
			<th><?php echo lang_get( 'actions' ); ?></th>
		</tr><?php
		foreach( $t_custom_fields as $t_field_id ) {
			$t_desc = custom_field_get_definition( $t_field_id ); ?>
			<tr <?php echo helper_alternate_class() ?>>
				<td><?php echo string_display( $t_desc['name'] ) ?></td>
				<td>
					<form method="post" action="manage_proj_custom_field_update.php">
						<fieldset>
							<?php echo form_security_field( 'manage_proj_custom_field_update' ) ?>
							<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
							<input type="hidden" name="field_id" value="<?php echo $t_field_id ?>" />
							<input type="text" name="sequence" value="<?php echo custom_field_get_sequence( $t_field_id, $f_project_id ) ?>" size="2" />
							<input type="submit" class="button-small" value="<?php echo lang_get( 'update' ) ?>" />
						</fieldset>
					</form>
				</td>
				<td><?php
					# You need global permissions to edit custom field defs
					print_button( "manage_proj_custom_field_remove.php?field_id=$t_field_id&project_id=$f_project_id", lang_get( 'remove_link' ) ); ?>
				</td>
			</tr><?php
		} # end for loop ?>
	</table><?php
	}

	if( $t_custom_field_count > $t_linked_count ) { ?>
	<form method="post" action="manage_proj_custom_field_add_existing.php">