Skip to content

Commit

Permalink
Sort custom field table
Browse files Browse the repository at this point in the history
Fixes: #25975
  • Loading branch information
cproensa authored and vboctor committed Aug 25, 2019
1 parent 7786bfd commit e9e8f4e
Showing 1 changed file with 21 additions and 11 deletions.
32 changes: 21 additions & 11 deletions manage_custom_field_page.php
Expand Up @@ -54,6 +54,14 @@
layout_page_begin( 'manage_overview_page.php' );

print_manage_menu( 'manage_custom_field_page.php' );

$t_all_ids = custom_field_get_ids();
$t_all_defs = array();
foreach( $t_all_ids as $t_id ) {
$t_all_defs[] = custom_field_get_definition( $t_id );
}
$t_all_defs = multi_sort( $t_all_defs, 'name' );

?>

<div class="col-md-12 col-xs-12">
Expand All @@ -79,24 +87,26 @@
<th class="category"><?php echo lang_get( 'custom_field_default_value' ) ?></th>
</tr>
</thead>
<tbody><?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 ); ?>
<tbody>
<?php
foreach( $t_all_defs as $t_def ) {
?>
<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>
<a href="manage_custom_field_edit_page.php?field_id=<?php echo $t_def['id'] ?>"><?php echo custom_field_get_display_name( $t_def['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 count( custom_field_get_project_ids( $t_def['id'] ) ) ?></td>
<td><?php echo get_enum_element( 'custom_field_type', $t_def['type'] ) ?></td>
<?php
# workaround to enforce line break displaying custom field values
# @todo replace by CSS after we don't support any longer browsers without CSS3 support
?>
<td><?php echo str_replace( '|', ' | ', string_display_line( $t_desc['possible_values'] ) ) ?></td>
<td><?php echo string_display( $t_desc['default_value'] ) ?></td>
</tr><?php
} # Create Form END ?>
<td><?php echo str_replace( '|', ' | ', string_display_line( $t_def['possible_values'] ) ) ?></td>
<td><?php echo string_display( $t_def['default_value'] ) ?></td>
</tr>
<?php
} # foreach end
?>
</tbody>
</table>
</div>
Expand Down

0 comments on commit e9e8f4e

Please sign in to comment.