View Issue Details

IDProjectCategoryView StatusLast Update
0012682mantisbtcustom fieldspublic2011-01-12 11:45
Reporterchiquiarce Assigned To 
PrioritylowSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version1.2.4 
Summary0012682: Better arrangement of checkbox custom field's options
Description

When a checkbox custom field is addedd to a project, its options are printed as a flow in the custom field area in Report Issue page. I've made a modification to make this look better (only this).
So sorry I'm not sending a patch, I lost the original file.

In the function cfdef_input_checkbox($p_field_def, $t_custom_field_value) (file mantis/core/cfdefs/cfdef_standard.php, modify the function body for what is in the file attached.

If you have any doubt, please contact me.

TagsNo tags attached.
Attached Files
cfdef_input_checkbox.txt (1,742 bytes)   
function cfdef_input_checkbox($p_field_def, $t_custom_field_value) {
	$t_values = explode( '|', custom_field_prepare_possible_values( $p_field_def['possible_values'] ) );
	$t_checked_values = explode( '|', $t_custom_field_value );

/* original function body
	foreach( $t_values as $t_option ) {
		echo '<input ', helper_get_tab_index(), ' type="checkbox" name="custom_field_' . $p_field_def['id'] . '[]"';
		if( in_array( $t_option, $t_checked_values, true ) ) {
			echo ' value="' . string_attribute( $t_option ) . '" checked="checked">&#160;' . string_display_line( $t_option ) . '&#160;&#160;';
		} else {
			echo ' value="' . string_attribute( $t_option ) . '">&#160;' . string_display_line( $t_option ) . '&#160;&#160;';
		}
	}
*/
	$t_column_number = 0;
	$i=0;
	$t_total_values = count($t_values);
	echo '<table>';
		while ( $i < count( $t_values ) ){
			if ( ( $t_column_number % 4 ) == 0 ){
				echo '<tr>';
					for( $i=0; $i < count( $t_values ); $i++ ) {
						echo '<td>';
						echo '<input ', helper_get_tab_index(), ' type="checkbox" name="custom_field_' . $p_field_def['id'] . '[]"';
						if( in_array( $t_values[$i], $t_checked_values, true ) ) {
							echo ' value="' . string_attribute( $t_values[$i] ) . '" checked="checked">&#160;' . string_display_line( $t_values[$i] ) . '&#160;&#160;';
						} else {
							echo ' value="' . string_attribute( $t_values[$i] ) . '">&#160;' . string_display_line( $t_values[$i] ) . '&#160;&#160;';
						}
						echo '</td>';
						$t_column_number = $t_column_number + 1;
						if ( ( $t_column_number % 4 ) == 0 ) { echo '</tr>'; }
						if ( ( $t_column_number % 4 ) == 0 ) { echo '<tr>'; }
					}
				echo '</tr>';
			}
		}
	echo '</table>';
}
cfdef_input_checkbox.txt (1,742 bytes)   

Activities