# Patch : copy custom field from and to other project # -------------------- # Copy all customs fields from the source project to the destination project function project_copy_custom_field($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); } } } # End