View Issue Details

IDProjectCategoryView StatusLast Update
0007569mantisbtfeaturepublic2009-04-03 01:03
Reportergiallu Assigned To 
PrioritynormalSeverityminorReproducibilityN/A
Status newResolutionopen 
Product Version1.0.6 
Summary0007569: "Add new version" shortcut in bug_report_page.php
Description

When reporting bugs, I often find myself in a situation where, when opening the
drop down menu for "Product Version", the version I need is not there.

The situation would be improved adding a "Add new version" field next to
"Product Version" (probably shown only to users with the proper level)
or at least a link to the project manage page (which is unfortunately
a few click away)

TagsNo tags attached.

Activities

djcarr

djcarr

2009-04-03 01:03

reporter   ~0021376

Last edited: 2009-04-03 01:11

I personally believe a properly managed Mantis install should have versions added when a release is produced, so anyone reporting a bug shouldn't need to add a version. In addition, people with mere "reporter" access can't be trusted to enter version strings correctly!

However, as a developer I wanted a shortcut to quickly add a version when resolving a bug. The changes I made are as follows:

Mantis 1.2.0a3.

bug_change_status_page.php, approx. line 253:


<!-- Fixed in Version -->
<tr <?php echo helper_alternate_class() ?>>
<td class="category">
<?php echo lang_get( 'fixed_in_version' ) ?>
</td>
<td>
<select name="fixed_in_version">
<?php print_version_option_list( bug_get_field( $f_bug_id, 'fixed_in_version' ),
bug_get_field( $f_bug_id, 'project_id' ), VERSION_ALL ) ?>
</select>

  • <?php if ( access_has_project_level( config_get( 'manage_project_threshold' ) , $t_bug_data->project_id ) ) { ?>
  • or create new version: <input type="text" name="new_fixed_in_version" />
  • <?php } ?>
    </td>
    </tr>

bug_update.php, approx line 84:


$t_bug_data->due_date = gpc_get_string( 'due_date', $t_bug_data->due_date);

  • $t_new_fixed_in_version = gpc_get_string( 'new_fixed_in_version', '' );
  • $t_new_fixed_in_version = trim( $t_new_fixed_in_version );
  • if ( !is_blank( $t_new_fixed_in_version ) ) {
  • if ( !access_has_project_level( config_get( 'manage_project_threshold' ) , $t_bug_data->project_id ) ) {
  • access_denied();
  • }
  • if ( version_is_unique( $t_new_fixed_in_version, $t_bug_data->project_id ) ) {
  • version_add( $t_bug_data->project_id, $t_new_fixed_in_version );
  • $t_bug_data->fixed_in_version = $t_new_fixed_in_version;
  • } else {
  • trigger_error( ERROR_VERSION_DUPLICATE, ERROR );
  • }
  • }

    if ( is_blank ( $t_bug_data->due_date ) ) {

While I don't think letting "reporters" create versions is a good feature for Mantis, you could easily customise your own install using similar code to this.