View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0008269 | mantisbt | roadmap | public | 2007-08-16 05:19 | 2007-10-04 01:38 |
| Reporter | ruslan | Assigned To | jreese | ||
| Priority | normal | Severity | minor | Reproducibility | have not tried |
| Status | closed | Resolution | fixed | ||
| Product Version | 1.1.0a4 | ||||
| Fixed in Version | 1.1.0rc1 | ||||
| Summary | 0008269: Reporting a new issue, ADMIN/MANAGER/DEVELOPER should see field "Target Version" | ||||
| Description | Really, because no I seat before Mantis. and currently I need after report of issue, click UPDATE and set menu with Target Version. | ||||
| Tags | No tags attached. | ||||
| Attached Files | mantis-target-2007-08-20.patch (3,935 bytes)
diff -urN --exclude=CVS --exclude=.svn --exclude=.swp --exclude='.git*' --exclude=config_inc.php mantis-cvs/bug_report_advanced_page.php mantis-target/bug_report_advanced_page.php
--- mantis-cvs/bug_report_advanced_page.php 2007-08-07 10:47:14.000000000 -0400
+++ mantis-target/bug_report_advanced_page.php 2007-08-20 15:30:32.000000000 -0400
@@ -66,6 +66,7 @@
$f_os = $t_bug->os;
$f_os_build = $t_bug->os_build;
$f_product_version = $t_bug->version;
+ $f_target_version = $t_bug->target_version;
$f_profile_id = 0;
$f_handler_id = $t_bug->handler_id;
@@ -88,6 +89,7 @@
$f_os = gpc_get_string( 'os', '' );
$f_os_build = gpc_get_string( 'os_build', '' );
$f_product_version = gpc_get_string( 'product_version', '' );
+ $f_target_version = gpc_get_string( 'target_version', '' );
$f_profile_id = gpc_get_int( 'profile_id', 0 );
$f_handler_id = gpc_get_int( 'handler_id', 0 );
@@ -356,6 +358,20 @@
</tr>
<?php } ?>
+<!-- Target Version (if permissions allow) -->
+<?php if ( access_has_project_level( config_get( 'handle_bug_threshold' ) ) ) { ?>
+<tr <?php echo helper_alternate_class() ?>>
+ <td class="category">
+ <?php echo lang_get( 'target_version' ) ?>
+ </td>
+ <td>
+ <select <?php echo helper_get_tab_index() ?> name="target_version">
+ <?php print_version_option_list() ?>
+ </select>
+ </td>
+</tr>
+<?php } ?>
+
<!-- spacer -->
<tr class="spacer">
diff -urN --exclude=CVS --exclude=.svn --exclude=.swp --exclude='.git*' --exclude=config_inc.php mantis-cvs/bug_report.php mantis-target/bug_report.php
--- mantis-cvs/bug_report.php 2007-08-07 10:47:14.000000000 -0400
+++ mantis-target/bug_report.php 2007-08-20 15:30:27.000000000 -0400
@@ -28,6 +28,7 @@
$t_bug_data->os = gpc_get_string( 'os', '' );
$t_bug_data->os_build = gpc_get_string( 'os_build', '' );
$t_bug_data->version = gpc_get_string( 'product_version', '' );
+ $t_bug_data->target_version = access_has_project_level( config_get( 'handle_bug_threshold' ) ) ? gpc_get_string( 'target_version', '' ) : '';
$t_bug_data->profile_id = gpc_get_int( 'profile_id', 0 );
$t_bug_data->handler_id = gpc_get_int( 'handler_id', 0 );
$t_bug_data->view_state = gpc_get_int( 'view_state', config_get( 'default_bug_view_status' ) );
@@ -165,6 +166,7 @@
<input type="hidden" name="os" value="<?php echo $t_bug_data->os ?>" />
<input type="hidden" name="os_build" value="<?php echo $t_bug_data->os_build ?>" />
<input type="hidden" name="product_version" value="<?php echo $t_bug_data->version ?>" />
+ <input type="hidden" name="target_version" value="<?php echo $t_bug_data->target_version ?>" />
<input type="hidden" name="build" value="<?php echo $t_bug_data->build ?>" />
<input type="hidden" name="report_stay" value="1" />
<input type="hidden" name="view_state" value="<?php echo $t_bug_data->view_state ?>" />
diff -urN --exclude=CVS --exclude=.svn --exclude=.swp --exclude='.git*' --exclude=config_inc.php mantis-cvs/core/bug_api.php mantis-target/core/bug_api.php
--- mantis-cvs/core/bug_api.php 2007-08-07 10:47:13.000000000 -0400
+++ mantis-target/core/bug_api.php 2007-08-20 15:20:27.000000000 -0400
@@ -345,6 +345,7 @@
$c_os_build = db_prepare_string( $p_bug_data->os_build );
$c_platform = db_prepare_string( $p_bug_data->platform );
$c_version = db_prepare_string( $p_bug_data->version );
+ $c_target_version = db_prepare_string( $p_bug_data->target_version );
$c_build = db_prepare_string( $p_bug_data->build );
$c_profile_id = db_prepare_int( $p_bug_data->profile_id );
$c_view_state = db_prepare_int( $p_bug_data->view_state );
@@ -441,7 +442,7 @@
'$c_platform', '$c_version',
'$c_build',
'$c_profile_id', '$c_summary', '$c_view_state', '$c_sponsorship_total', '$c_sticky', '',
- ''
+ '$c_target_version'
)";
db_query( $query );
mantis-target-2007-08-23.patch (6,856 bytes)
diff -urN --exclude=CVS --exclude=.svn --exclude=.swp --exclude='.git*' --exclude=config_inc.php mantis-cvs/bug_report_advanced_page.php mantis-target/bug_report_advanced_page.php
--- mantis-cvs/bug_report_advanced_page.php 2007-08-07 10:47:14.000000000 -0400
+++ mantis-target/bug_report_advanced_page.php 2007-08-21 08:39:50.000000000 -0400
@@ -66,6 +66,7 @@
$f_os = $t_bug->os;
$f_os_build = $t_bug->os_build;
$f_product_version = $t_bug->version;
+ $f_target_version = $t_bug->target_version;
$f_profile_id = 0;
$f_handler_id = $t_bug->handler_id;
@@ -88,6 +89,7 @@
$f_os = gpc_get_string( 'os', '' );
$f_os_build = gpc_get_string( 'os_build', '' );
$f_product_version = gpc_get_string( 'product_version', '' );
+ $f_target_version = gpc_get_string( 'target_version', '' );
$f_profile_id = gpc_get_int( 'profile_id', 0 );
$f_handler_id = gpc_get_int( 'handler_id', 0 );
@@ -356,6 +358,20 @@
</tr>
<?php } ?>
+<!-- Target Version (if permissions allow) -->
+<?php if ( access_has_project_level( config_get( 'roadmap_update_threshold' ) ) ) { ?>
+<tr <?php echo helper_alternate_class() ?>>
+ <td class="category">
+ <?php echo lang_get( 'target_version' ) ?>
+ </td>
+ <td>
+ <select <?php echo helper_get_tab_index() ?> name="target_version">
+ <?php print_version_option_list() ?>
+ </select>
+ </td>
+</tr>
+<?php } ?>
+
<!-- spacer -->
<tr class="spacer">
diff -urN --exclude=CVS --exclude=.svn --exclude=.swp --exclude='.git*' --exclude=config_inc.php mantis-cvs/bug_report.php mantis-target/bug_report.php
--- mantis-cvs/bug_report.php 2007-08-07 10:47:14.000000000 -0400
+++ mantis-target/bug_report.php 2007-08-21 08:40:50.000000000 -0400
@@ -28,6 +28,7 @@
$t_bug_data->os = gpc_get_string( 'os', '' );
$t_bug_data->os_build = gpc_get_string( 'os_build', '' );
$t_bug_data->version = gpc_get_string( 'product_version', '' );
+ $t_bug_data->target_version = access_has_project_level( config_get( 'roadmap_update_threshold' ) ) ? gpc_get_string( 'target_version', '' ) : '';
$t_bug_data->profile_id = gpc_get_int( 'profile_id', 0 );
$t_bug_data->handler_id = gpc_get_int( 'handler_id', 0 );
$t_bug_data->view_state = gpc_get_int( 'view_state', config_get( 'default_bug_view_status' ) );
@@ -165,6 +166,7 @@
<input type="hidden" name="os" value="<?php echo $t_bug_data->os ?>" />
<input type="hidden" name="os_build" value="<?php echo $t_bug_data->os_build ?>" />
<input type="hidden" name="product_version" value="<?php echo $t_bug_data->version ?>" />
+ <input type="hidden" name="target_version" value="<?php echo $t_bug_data->target_version ?>" />
<input type="hidden" name="build" value="<?php echo $t_bug_data->build ?>" />
<input type="hidden" name="report_stay" value="1" />
<input type="hidden" name="view_state" value="<?php echo $t_bug_data->view_state ?>" />
diff -urN --exclude=CVS --exclude=.svn --exclude=.swp --exclude='.git*' --exclude=config_inc.php mantis-cvs/bug_update_advanced_page.php mantis-target/bug_update_advanced_page.php
--- mantis-cvs/bug_update_advanced_page.php 2007-08-07 10:47:14.000000000 -0400
+++ mantis-target/bug_update_advanced_page.php 2007-08-21 08:38:50.000000000 -0400
@@ -417,7 +417,7 @@
<tr <?php echo helper_alternate_class() ?>>
<?php
- if ( access_has_bug_level( config_get( 'roadmap_view_threshold' ), $f_bug_id ) ) {
+ if ( access_has_bug_level( config_get( 'roadmap_update_threshold' ), $f_bug_id ) ) {
?>
<!-- spacer -->
<td colspan="2"> </td>
diff -urN --exclude=CVS --exclude=.svn --exclude=.swp --exclude='.git*' --exclude=config_inc.php mantis-cvs/config_defaults_inc.php mantis-target/config_defaults_inc.php
--- mantis-cvs/config_defaults_inc.php 2007-08-16 13:23:56.000000000 -0400
+++ mantis-target/config_defaults_inc.php 2007-08-21 08:43:13.000000000 -0400
@@ -1113,6 +1113,9 @@
# threshold for viewing roadmap
$g_roadmap_view_threshold = VIEWER;
+ # threshold for updating roadmap, target_version, etc
+ $g_roadmap_update_threshold = DEVELOPER;
+
# status change thresholds
$g_update_bug_status_threshold = DEVELOPER;
diff -urN --exclude=CVS --exclude=.svn --exclude=.swp --exclude='.git*' --exclude=config_inc.php mantis-cvs/core/bug_api.php mantis-target/core/bug_api.php
--- mantis-cvs/core/bug_api.php 2007-08-07 10:47:13.000000000 -0400
+++ mantis-target/core/bug_api.php 2007-08-21 08:37:33.000000000 -0400
@@ -370,6 +370,13 @@
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
+ # Only set target_version if user has access to do so
+ if ( access_has_project_level( config_get( 'roadmap_update_threshold' ) ) ) {
+ $c_target_version = db_prepare_string( $p_bug_data->target_version );
+ } else {
+ $c_target_version = '';
+ }
+
$t_bug_table = config_get( 'mantis_bug_table' );
$t_bug_text_table = config_get( 'mantis_bug_text_table' );
$t_project_category_table = config_get( 'mantis_project_category_table' );
@@ -441,7 +448,7 @@
'$c_platform', '$c_version',
'$c_build',
'$c_profile_id', '$c_summary', '$c_view_state', '$c_sponsorship_total', '$c_sticky', '',
- ''
+ '$c_target_version'
)";
db_query( $query );
@@ -802,8 +809,16 @@
platform='$c_bug_data->platform',
version='$c_bug_data->version',
build='$c_bug_data->build',
- fixed_in_version='$c_bug_data->fixed_in_version',
- target_version='$c_bug_data->target_version',
+ fixed_in_version='$c_bug_data->fixed_in_version',";
+
+ $t_roadmap_updated = false;
+ if ( access_has_project_level( config_get( 'roadmap_update_threshold' ) ) ) {
+ $query .= "
+ target_version='$c_bug_data->target_version',";
+ $t_roadmap_updated = true;
+ }
+
+ $query .= "
view_state='$c_bug_data->view_state',
summary='$c_bug_data->summary',
sponsorship_total='$c_bug_data->sponsorship_total',
@@ -832,7 +847,9 @@
history_log_event_direct( $p_bug_id, 'version', $t_old_data->version, $p_bug_data->version );
history_log_event_direct( $p_bug_id, 'build', $t_old_data->build, $p_bug_data->build );
history_log_event_direct( $p_bug_id, 'fixed_in_version', $t_old_data->fixed_in_version, $p_bug_data->fixed_in_version );
- history_log_event_direct( $p_bug_id, 'target_version', $t_old_data->target_version, $p_bug_data->target_version );
+ if ( $t_roadmap_updated ) {
+ history_log_event_direct( $p_bug_id, 'target_version', $t_old_data->target_version, $p_bug_data->target_version );
+ }
history_log_event_direct( $p_bug_id, 'view_state', $t_old_data->view_state, $p_bug_data->view_state );
history_log_event_direct( $p_bug_id, 'summary', $t_old_data->summary, $p_bug_data->summary );
history_log_event_direct( $p_bug_id, 'sponsorship_total', $t_old_data->sponsorship_total, $p_bug_data->sponsorship_total );
| ||||
| child of | 0008306 | new | Ruslan's Vision: PUSH MANTIS to Project Maagment. |
|
I would love to see this as well, and I think this just might be the next thing I do. Maybe I can knock it out over the weekend, since my PS3 toasted in the summer heat and humidity (piss-poor AC is almost worse than no AC). |
|
|
Patch 'mantis-target-2007-08-20.patch' was created from CVS head on Monday, Aug 20, 2007. Allows users with handle_bug_threshold (default DEVELOPER) access or higher to set Target Version for a bug during the advanced report bug process:
|
|
|
The patch looks good. I just have one comment.
The reason for doing the second check in the API rather than the bug_report.php is to handle the case where a bug is reported via MantisConnect rather than via the web interface. |
|
|
I had a look at the update code. The current user is allowed to update the roadmap if they have roadmap_view_threshold. I am thinking we should do the following:
|
|
|
Sounds good and makes sense, I'll make those modifications today and create a new patch. |
|
|
Patch 'mantis-target-2007-08-21.patch' was created from CVS head on Monday, Aug 21, 2007. Allows users with roadmap_update_threshold (default DEVELOPER) access or higher to set Target Version while both reporting and updating bugs with the advanced pages. Without access, the fields will not be shown.
|
|
|
I've tried to adopt your patch to the MANTIS 1.1.0a4 release, because I would love this feature too. |
|
|
That was my mistake, a result of quick patching without full testing. That function call should be to access_has_project_level() instead. I've fixed the and re-uploaded the patch (now named for the 23rd instead). Thank you for catching this. |
|
|
jreese, are you using the following configuration in your dev instance?
This is to make sure that PHP won't just suppress any errors or notices. My assumption is that is why this syntax error was missed, right? Or maybe stegang tested a different scenario. |
|
|
I'm assuming it was more because I have multiple parallel instances of Mantis running, each with different sets of code on top of the CVS head (thanks to Git). I most likely made the change and inadvertantly tested in the wrong instance of Mantis, since that part of the changes were minor. But anyways, no, I didn't have those set at the time, but they are already in my test sites now. In the future, I will also be more careful to test in the proper site. I'm still getting into the swing of non-linear development for Mantis, compared to the debug-fix-commit cycles from the previous project (which is what Mantis will be replacing). |
|
|
Works like a charm now on top of release 1.1.0a4. |
|
|
In bug_report.php, you check the access level against the current project. You should check against the project_id that is retrieved via gpc_get_int(). These may be different if a user does the following:
You can override the current project using $g_project_override. See the bug_view_page.php for an example. When you are checking the access level in APIs, you should explicitly pass in the project id, i.e. don't check against current project. Other than that, I guess you are ready to go with this feature. Lets get it committed. |
|
|
You will also need to update bug_actiongroup.php to check the appropriate access level when updating target version for multiple issues. |
|
|
Committed changes to CVS with modifications specified by Victor. |
|