Index: config_defaults_inc.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/config_defaults_inc.php,v retrieving revision 1.219 diff -u -r1.219 config_defaults_inc.php --- config_defaults_inc.php 17 Oct 2004 00:14:27 -0000 1.219 +++ config_defaults_inc.php 21 Oct 2004 06:21:59 -0000 @@ -431,6 +431,11 @@ # AUTO suppresses the display if there are no versions defined for the project $g_show_product_version = AUTO; + # --- if product versions are shown sort them by date or alphabetically + # ON sorts by version alphabetically + # OFF (or no config) sorts by date most recent first + $g_product_version_sort_alpha = OFF; + # -- show users with their real name or not $g_show_realname = OFF; $g_differentiate_duplicates = OFF; # leave off for now Index: core/version_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/version_api.php,v retrieving revision 1.18 diff -u -r1.18 version_api.php --- core/version_api.php 21 Jul 2004 22:05:00 -0000 1.18 +++ core/version_api.php 21 Oct 2004 06:01:55 -0000 @@ -257,10 +257,24 @@ $t_project_version_table = config_get( 'mantis_project_version_table' ); + # Sort order for product version. + # Either by date most recent first OR alphabetically ascending + if (ON == config_get( 'product_version_sort_alpha' )) { + + # Sort by version alphabetically + $t_product_version_sort_alpha = "version ASC"; + } else // --- if (OFF == config_get( 'product_version_sort_order' ) --> + { + + # Descending date_order + $t_product_version_sort_alpha = "date_order DESC"; + } + + $query = "SELECT version, date_order FROM $t_project_version_table WHERE project_id='$c_project_id' $t_released_where - ORDER BY date_order DESC"; + ORDER BY $t_product_version_sort_alpha"; $result = db_query( $query ); $count = db_num_rows( $result ); $rows = array();