View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0004307 | mantisbt | bugtracker | public | 2004-08-11 03:13 | 2013-10-24 04:46 |
Reporter | jwolfgarten | Assigned To | |||
Priority | normal | Severity | feature | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Summary | 0004307: Highest version in "Fixed in version" preselected | ||||
Description | It would be very nice, if the field "Fixed in version" is predefined with the highest version available. So that, if I fix a bug, it is automatically part of the next version. | ||||
Tags | patch | ||||
Attached Files | 06-mantis-1.0.0rc1-latest_unreleased_ver.patch (1,643 bytes)
diff -Nru old/core/print_api.php new/core/print_api.php --- old/core/print_api.php 2005-07-29 15:27:30.000000000 +0300 +++ new/core/print_api.php 2005-07-29 15:24:42.000000000 +0300 @@ -575,6 +575,7 @@ } else { $versions = version_get_all_rows( $c_project_id, $p_released ); } + $p_version = ($p_version == '' ) ? version_get_last_unreleased_row( $c_project_id ) : $p_version; if ( $p_leading_blank ) { echo '<option value=""></option>'; diff -Nru old/core/version_api.php new/core/version_api.php --- old/core/version_api.php 2005-07-29 15:27:43.000000000 +0300 +++ new/core/version_api.php 2005-07-29 15:22:45.000000000 +0300 @@ -271,6 +271,33 @@ return $rows; } + function version_get_last_unreleased_row( $p_project_id, $p_released = 0 ) { + $c_project_id = db_prepare_int( $p_project_id ); + + if ( $p_released === null ) { + $t_released_where = ''; + } else { + $c_released = db_prepare_int( $p_released ); + $t_released_where = "AND ( released = $c_released )"; + } + + $t_project_version_table = config_get( 'mantis_project_version_table' ); + + $query = "SELECT * + FROM $t_project_version_table + WHERE project_id='$c_project_id' $t_released_where + ORDER BY date_order DESC + LIMIT 1"; + $result = db_query( $query ); + $count = db_num_rows( $result ); + $latest = ''; + if( $count == 1) { + $row = db_fetch_array( $result ); + $latest = $row['version']; + } + return $latest; + } + # -------------------- # Return all versions for the specified project, including subprojects function version_get_all_rows_with_subs( $p_project_id, $p_released = null ) { 20071011_0004307.patch (1,123 bytes)
Index: bug_change_status_page.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/bug_change_status_page.php,v retrieving revision 1.28 diff -u -r1.28 bug_change_status_page.php --- bug_change_status_page.php 13 Jul 2007 07:58:26 -0000 1.28 +++ bug_change_status_page.php 11 Oct 2007 12:37:03 -0000 @@ -215,6 +215,9 @@ || ( ( AUTO == config_get( 'show_product_version' ) ) && ( count( version_get_all_rows( $t_bug->project_id ) ) > 0 ) ); if ( $t_show_version ) { + $t_default_fixed_in_version = bug_get_field( $f_bug_id, 'fixed_in_version' ); + if ( $t_default_fixed_in_version == '' ) + $t_default_fixed_in_version = bug_get_field( $f_bug_id, 'target_version' ); ?> <!-- Fixed in Version --> <tr <?php echo helper_alternate_class() ?>> @@ -223,7 +226,7 @@ </td> <td> <select name="fixed_in_version"> - <?php print_version_option_list( bug_get_field( $f_bug_id, 'fixed_in_version' ), + <?php print_version_option_list( $t_default_fixed_in_version, bug_get_field( $f_bug_id, 'project_id' ), VERSION_ALL ) ?> </select> </td> | ||||
child of | 0004181 | closed | Features in Mantis 1.1 release |
There should still be an option to select 'no version'. Perhaps we could also make the default the next unreleased version, or one that has been set to be default? |
|
in our workflow there is always a version called "next release" which is not released. this version will be renamed if whe release a version and then we ad a new version "next release" :-) so it will be nice to sav in config 1. preselect highest number or preselect by name "yyxx" or preselect by not released |
|
I've made a quick patch right now. And BTW it's for Mantis-1.0.0rc1 |
|
I would prefer having that tunable ( config ? ): I usually fix bugs to a special version named CVS_HEAD and then, when the release is done, switch the field to the proper release number. |
|
I have attached a patch (20071011_4307.patch) which pre-selects the target version of a issue when resolving it. |
|
I've reprogrammed this bug fix for MANTIS 1.3.0devmaster-dcc0fbe. FILE: mantis/core/print_api.php
FILE: mantis/core/version_api.php
}
/**
Hope this help! |
|