View Issue Details

IDProjectCategoryView StatusLast Update
0006792mantisbtbugtrackerpublic2010-03-08 19:26
ReporterSivan Greenberg Assigned Tovboctor  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0rc2 
Target Version1.2.0Fixed in Version1.2.0 
Summary0006792: Option to update the severity of selected bugs
Description

In the bottom of the "View Issues" page, there's a dropdown allowing to update things like priority of selected bugs.
I think there should also be an "Update Severity" in this dropdown.

TagsNo tags attached.
Attached Files
bug_actiongroup_set_severity_inc.php (2,635 bytes)   
<?php
# Mantis Plugin : Set Severity group action
# By: Daniel Carr, 2007
# Available to the Mantis project under the Mantis license 
#
# -- Requires the following in custom_strings_inc.php:
#    $s_set_severity_title = 'Update Severity';
#    $s_set_severity_msg = 'Choose the new severity of the issue(s)';
#    $s_set_severity_button = 'Update Severity';
#    $s_actiongroup_menu_set_severity = 'Update Severity';
	
	/**
	 * Prints the title for the custom action page.	 
	 */
	function action_set_severity_print_title() {
        echo '<tr class="form-title">';
        echo '<td colspan="2">';
        echo lang_get( 'set_severity_title' );
        echo '</td></tr>';		
	}
	
	/**
	 * Prints the field within the custom action form.  This has an entry for
	 * every field the user need to supply + the submit button.  The fields are
	 * added as rows in a table that is already created by the calling code.
	 * A row has two columns.         	 
	 */
	function action_set_severity_print_fields() {
?>
	<tr class="row-1" valign="top"><td class="category">
<?php echo lang_get( 'set_severity_msg' ); ?>
	</td>
	<!-- Severity -->
	<td>
	<select name="severity">
	<?php print_enum_string_option_list( 'severity', $t_bug->severity) ?>
	</select>
	</td>
	</tr>
	<?php
		echo '<tr><td colspan="2"><center><input type="submit" class="button" value="' . lang_get( 'set_severity_button' ) . ' " /></center></td></tr>';
	}

	/**
	 * Validates the action on the specified bug id.
	 * 
	 * @returns true    Action can be applied.
	 * @returns array( bug_id => reason for failure )	 
	 */
	function action_set_severity_validate( $p_bug_id ) {
		$f_severity = gpc_get_string( 'severity' );

		$t_failed_validation_ids = array();

		$t_set_severity_threshold = config_get( 'update_bug_threshold' );
		$t_bug_id = $p_bug_id;

		if ( bug_is_readonly( $t_bug_id ) ) {
			$t_failed_validation_ids[$t_bug_id] = lang_get( 'actiongroup_error_issue_is_readonly' );
			return $t_failed_validation_ids;
		}

		if ( !access_has_bug_level( $t_set_severity_threshold, $t_bug_id ) ) {
			$t_failed_validation_ids[$t_bug_id] = lang_get( 'access_denied' );
			return $t_failed_validation_ids;
		}

		return true;
	}

	/**
	 * Executes the custom action on the specified bug id.
	 * 
	 * @param $p_bug_id  The bug id to execute the custom action on.
	 * 
	 * @returns true   Action executed successfully.
	 * @returns array( bug_id => reason for failure )               	 
	 */
	function action_set_severity_process( $p_bug_id ) {
		$f_severity = gpc_get_string( 'severity' );
		bug_set_field( $p_bug_id, 'severity', $f_severity );
        return true;
    }
?>

Relationships

has duplicate 0006522 closedgrangeway The action "Update Severity" is missing from the "Select All" drop down menu. 

Activities

hoy

hoy

2006-09-28 07:26

reporter   ~0013525

Last edited: 2006-09-28 07:27

I add a zip file containing a really hard coded solution allowing action group for severity, eta, projection and resolution.
This is compatible with Mantis 1.0.3. Applying it to 1.0.5 should lead to void 0007300. Impact on 1.0.6 is unkown.
Text file is given only for french and english.
Hope this help.

vboctor

vboctor

2006-09-29 01:55

manager   ~0013544

I haven't reviewed the patch, but I agree to the feature request. We need to review the patch and integrate the functionality into latest Mantis code base.

djcarr

djcarr

2008-01-08 19:11

reporter   ~0016595

Last edited: 2008-01-08 19:15

I have reimplemented this in 1.1.0 using the new EXT_ plugin model and attached the necessary file. To install:

  1. place bug_actiongroup_set_severity_inc.php in mantis main directory.

  2. Add the four custom strings into custom_strings_inc.php (or language file):

    $s_set_severity_title = 'Update Severity';
    $s_set_severity_msg = 'Choose the new severity of the issue(s)';
    $s_set_severity_button = 'Update Severity';
    $s_actiongroup_menu_set_severity = 'Update Severity';

  3. Add the action to config_inc.php:

    $g_custom_group_actions = array(
    array( 'action' => 'EXT_SET_SEVERITY',
    'label' => 'actiongroup_menu_set_severity' )
    );

This may tide some people over until the option is hardcoded into the code base. And of course it's easy to duplicate for other fields as well.

joshribakoff

joshribakoff

2009-10-28 23:33

reporter   ~0023467

Last edited: 2009-10-28 23:33

I am going to try out these plugins, I also agree this feature is neccessary. I need to change something between "feature" and "bug" way more then I need to update issues to a different "priority"

$25 to whoever adds this.

joshribakoff

joshribakoff

2009-11-01 06:11

reporter   ~0023515

I just donated $50 in advance. Hopefully we can see this is the future!

vboctor

vboctor

2009-11-01 12:46

manager   ~0023520

This is now checked in. I've used djcarr's patch as the basis, but did some modifications. Thanks @djcarr.

Related Changesets

MantisBT: master-1.2.x 816cefd5

2009-11-01 12:45

vboctor


Details Diff
Fixes 0006792: Option to update the severity of selected bugs. Affected Issues
0006792
add - bug_actiongroup_update_severity_inc.php Diff File
mod - lang/strings_english.txt Diff File
mod - core/print_api.php Diff File

MantisBT: master 0d3f955c

2009-11-01 12:45

vboctor


Details Diff
Fixes 0006792: Option to update the severity of selected bugs. Affected Issues
0006792
add - bug_actiongroup_update_severity_inc.php Diff File
mod - core/print_api.php Diff File
mod - lang/strings_english.txt Diff File