View Issue Details

IDProjectCategoryView StatusLast Update
0004031mantisbtbugtrackerpublic2004-08-29 02:27
Reportergrangeway Assigned Tothraxisp  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Fixed in Version0.19.0rc1 
Summary0004031: Hiding/removing fixed_in_versions
Description

For projects that do not use fixed_in_verison, or would like to use a date/build number of some other string or custom field, it should be possible to remove the fixed in version field from the db schema.

For a project that does not support a version, the ability to not import the fixed_in_version field would save 4 bytes + size of index per bug.

TagsNo tags attached.
Attached Files
suppress_version.diff (5,065 bytes)   
Index: bug_report_advanced_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_report_advanced_page.php,v
retrieving revision 1.36
diff -r1.36 bug_report_advanced_page.php
200a201,206
> <?php
> 	$t_show_version = ( ON == config_get( 'show_product_version' ) ) 
> 			|| ( ( AUTO == config_get( 'show_product_version' ) ) 
> 						&& ( count( version_get_all_rows( $t_project_id ) ) > 0 ) );
> 	if ( $t_show_version ) { 
> ?>
212c218,220
< 
---
> <?php
> 	} 
> ?>
Index: bug_report_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_report_page.php,v
retrieving revision 1.38
diff -r1.38 bug_report_page.php
134c134,139
< 
---
> <?php
> 	$t_show_version = ( ON == config_get( 'show_product_version' ) ) 
> 			|| ( ( AUTO == config_get( 'show_product_version' ) ) 
> 						&& ( count( version_get_all_rows( $t_project_id ) ) > 0 ) );
> 	if ( $t_show_version ) { 
> ?>
145a151,153
> <?php
> 	} 
> ?>
Index: bug_update_advanced_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_update_advanced_page.php,v
retrieving revision 1.69
diff -r1.69 bug_update_advanced_page.php
284a285
> 	<!-- Fixed in Version -->
286c287,294
< 		<?php echo lang_get( 'fixed_in_version' ) ?>
---
> 		<?php
> 			$t_show_version = ( ON == config_get( 'show_product_version' ) ) 
> 					|| ( ( AUTO == config_get( 'show_product_version' ) ) 
> 								&& ( count( version_get_all_rows( $t_bug->project_id ) ) > 0 ) );
> 			if ( $t_show_version ) { 
> 				echo lang_get( 'fixed_in_version' ); 
> 			}
> 		?>
288a297,299
> 		<?php
> 			if ( $t_show_version ) { 
> 		?>
291a303,305
> 		<?php
> 			}
> 		?>
294c308
< 	<!-- Product Version -->
---
> 	<!-- Product Version  or Product Build, if version is suppressed -->
296c310,316
< 		<?php echo lang_get( 'product_version' ) ?>
---
> 		<?php 
> 			if ( $t_show_version ) { 
> 				echo lang_get( 'product_version' );
> 			}else{
> 				echo lang_get( 'build' );
> 			}
> 		?>
298a319,321
> 		<?php 
> 			if ( $t_show_version ) { 
> 		?>
301a325,332
> 		<?php
> 			}else{
> 		?>
> 		<input type="text" name="build" size="16" maxlength="32" value="<?php echo $t_bug->build ?>" />
> 		<?php
> 			}
> 		?>
> 		
305a337,339
> <?php 
> 	if ( $t_show_version ) { 
> ?>
320a355,357
> <?php
> 	}
> ?>
Index: bug_update_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_update_page.php,v
retrieving revision 1.70
diff -r1.70 bug_update_page.php
239c239,244
< 
---
> <?php
> 	$t_show_version = ( ON == config_get( 'show_product_version' ) ) 
> 			|| ( ( AUTO == config_get( 'show_product_version' ) ) 
> 						&& ( count( version_get_all_rows( $t_project_id ) ) > 0 ) );
> 	if ( $t_show_version ) { 
> ?>
250a256,258
> <?php
> 	}
> ?>
Index: bug_view_advanced_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_view_advanced_page.php,v
retrieving revision 1.54
diff -r1.54 bug_view_advanced_page.php
282c282
< 	<!-- spacer -->
---
> 	<!-- fixed in version -->
284c284,291
< 		<?php echo lang_get( 'fixed_in_version' ); ?>
---
> 		<?php 
> 			$t_show_version = ( ON == config_get( 'show_product_version' ) ) 
> 					|| ( ( AUTO == config_get( 'show_product_version' ) ) 
> 								&& ( count( version_get_all_rows( $t_bug->project_id ) ) > 0 ) );
> 			if ( $t_show_version ) { 
> 				echo lang_get( 'fixed_in_version' );
> 			}
> 		?>
287c294,298
< 		<?php echo $t_bug->fixed_in_version ?>
---
> 		<?php 
> 			if ( $t_show_version ) { 
> 				echo $t_bug->fixed_in_version; 
> 			}
> 		?>
290c301
< 	<!-- Product Version -->
---
> 	<!-- Product Version or Product Build, if version is suppressed -->
292c303,309
< 		<?php echo lang_get( 'product_version' ) ?>
---
> 		<?php 
> 			if ( $t_show_version ) { 
> 				echo lang_get( 'product_version' ); 
> 			}else{
> 				echo lang_get( 'product_build' );
> 			}
> 		?>
295c312,318
< 		<?php echo $t_bug->version ?>
---
> 		<?php  
> 			if ( $t_show_version ) { 
> 				echo $t_bug->version; 
> 			}else{
> 				echo $t_bug->build;
> 			}
> 		?>
300c323,325
< 
---
> <?php
> 	if( $t_show_version ) {
> ?>
315c340,342
< 
---
> <?php
> 	}
> ?>
Index: config_defaults_inc.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/config_defaults_inc.php,v
retrieving revision 1.173
diff -r1.173 config_defaults_inc.php
343a344,349
> 	# --- show product versions in create, view and update screens
> 	#  ON forces display even if none are defined
> 	#  OFF suppresses display
> 	#  AUTO suppresses the display if there are no versions defined for the project
> 	$g_show_product_version = AUTO;
> 
Index: core/constant_inc.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/constant_inc.php,v
retrieving revision 1.18
diff -r1.18 constant_inc.php
18a19
> 	define( 'AUTO', 3 );
suppress_version.diff (5,065 bytes)   
suppress_version.tar.gz (22,064 bytes)

Relationships

child of 0003987 closedvboctor Mantis 0.19.0 Release 

Activities

vboctor

vboctor

2004-07-08 07:06

manager   ~0005924

I don't think the some extra bytes per issue is a problem. However, I agree that some projects may not want to see it. I can see two solutions for this:

  • Hide it if the project has 0 versions defined.
  • Wait till templates and define your own templates that do not have it.
thraxisp

thraxisp

2004-07-08 20:14

reporter   ~0005944

I'll fix this.

I'll add a configuration variable $g_hide_empty_version to control it. The fixed in version, found in version, and production build will be hidden in the bug view, bug create, and bug update pages.

vboctor

vboctor

2004-07-08 20:21

manager   ~0005946

I think we can only hide Product Version / Fixed In Version since they are combo-boxes. However, with regards to the build, the user may want to keep it since users can enter any values. For example, date of use on website, or the version (if the user doesn't want to maintain a version list).

Also do we really need a config for this? If we do, should it be $g_show_product_version which can be ON / OFF / AUTO, with default set to AUTO? We should clearly document that this affects both product version and fixed in version.

What do you think? I can't spend too much time thinking at the moment :)

thraxisp

thraxisp

2004-07-08 20:38

reporter   ~0005948

Sounds good. AUTO would imply hide them if they are no versions defined.

I agree on the build field.

thraxisp

thraxisp

2004-07-09 10:27

reporter   ~0005958

The patch (.diff) is attached, as well as a tarball with the changed files. These include bug_report_advanced_page.php bug_report_page.php bug_update_advanced_page.php bug_update_page.php bug_view_advanced_page.php config_defaults_inc.php core/constant_inc.php.

Note that some of the changed files also have my patches for NIS and workflow in them.

thraxisp

thraxisp

2004-07-20 18:05

reporter   ~0006192

Clean files have been uploaded again (suppress_version.tar.gz). The diff was correct.

thraxisp

thraxisp

2004-07-25 16:09

reporter   ~0006352

patch applied to CVS