From: Glenn H. <thr...@us...> - 2005-06-11 19:32:51
|
Update of /cvsroot/mantisbt/mantisbt/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24034/core Modified Files: print_api.php html_api.php Log Message: Sort new status values into ascending order. They can be out of order if defaults are specified. Index: html_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/html_api.php,v retrieving revision 1.168 retrieving revision 1.169 diff -u -d -r1.168 -r1.169 --- html_api.php 28 May 2005 02:07:28 -0000 1.168 +++ html_api.php 11 Jun 2005 19:32:42 -0000 1.169 @@ -881,6 +881,12 @@ ( bug_get_field( $p_bug_id, 'reporter_id' ) == auth_get_current_user_id() && ( ON == config_get( 'allow_reporter_close' ) ) ) ); if ( count( $t_enum_list ) > 0 ) { + # resort the list into ascending order after noting the key from the first element (the default) + $t_default_arr = each( $t_enum_list ); + $t_default = $t_default_arr['key']; + ksort( $t_enum_list ); + reset( $t_enum_list ); + echo "<form method=\"post\" action=\"bug_change_status_page.php\">"; $t_button_text = lang_get( 'bug_status_to_button' ); @@ -888,7 +894,9 @@ echo " <select name=\"new_status\">"; # space at beginning of line is important foreach ( $t_enum_list as $key => $val ) { - echo "<option value=\"$key\">$val</option>"; + echo "<option value=\"$key\" "; + check_selected( $key, $t_default ); + echo ">$val</option>"; } echo '</select>'; Index: print_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/print_api.php,v retrieving revision 1.135 retrieving revision 1.136 diff -u -d -r1.135 -r1.136 --- print_api.php 28 May 2005 00:54:34 -0000 1.135 +++ print_api.php 11 Jun 2005 19:32:42 -0000 1.136 @@ -680,6 +680,9 @@ $t_enum_list = get_status_option_list( $t_current_auth, $p_current_value, true, $p_allow_close ); if ( count( $t_enum_list ) > 0 ) { + # resort the list into ascending order + ksort( $t_enum_list ); + reset( $t_enum_list ); echo '<select name="' . $p_select_label . '">'; foreach ( $t_enum_list as $key => $val ) { echo "<option value=\"$key\""; |