View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0012682 | mantisbt | custom fields | public | 2011-01-12 11:45 | 2011-01-12 11:45 |
| Reporter | chiquiarce | Assigned To | |||
| Priority | low | Severity | feature | Reproducibility | always |
| Status | new | Resolution | open | ||
| Product Version | 1.2.4 | ||||
| Summary | 0012682: 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). 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. | ||||
| Tags | No 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"> ' . string_display_line( $t_option ) . '  ';
} else {
echo ' value="' . string_attribute( $t_option ) . '"> ' . string_display_line( $t_option ) . '  ';
}
}
*/
$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"> ' . string_display_line( $t_values[$i] ) . '  ';
} else {
echo ' value="' . string_attribute( $t_values[$i] ) . '"> ' . string_display_line( $t_values[$i] ) . '  ';
}
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>';
} | ||||