Skip to content

Commit

Permalink
Sort custom field names in dropdown
Browse files Browse the repository at this point in the history
Sort the custom field names in the dropsows selector in Manage project
page.

Fixes: #26368
  • Loading branch information
cproensa authored and dregad committed Nov 23, 2019
1 parent 33d1003 commit baebf92
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions manage_proj_edit_page.php
Expand Up @@ -655,13 +655,16 @@
<input type="hidden" name="project_id" value="<?php echo $f_project_id ?>" />
<select name="field_id" class="input-sm">
<?php
$t_custom_fields = custom_field_get_ids();
$t_cf_defs = array();
foreach( custom_field_get_ids() as $t_cfid ) {
$t_cf_defs[] = custom_field_get_definition( $t_cfid );
}
$t_custom_fields = multi_sort( $t_cf_defs, 'name' );

foreach( $t_custom_fields as $t_field_id )
foreach( $t_custom_fields as $t_field )
{
if( !custom_field_is_linked( $t_field_id, $f_project_id ) ) {
$t_desc = custom_field_get_definition( $t_field_id );
echo "<option value=\"$t_field_id\">" . string_attribute( lang_get_defaulted( $t_desc['name'] ) ) . '</option>' ;
if( !custom_field_is_linked( $t_field['id'], $f_project_id ) ) {
echo '<option value="', $t_field['id'], '">', string_attribute( lang_get_defaulted( $t_field['name'] ) ), '</option>' ;
}
}
?>
Expand Down

0 comments on commit baebf92

Please sign in to comment.