View Issue Details

IDProjectCategoryView StatusLast Update
0004828mantisbtbugtrackerpublic2005-05-31 11:36
Reportermarc Assigned Tothraxisp  
PrioritynormalSeverityfeatureReproducibilityalways
Status closedResolutionfixed 
Product Version0.19.1 
Fixed in Version1.0.0a3 
Summary0004828: workflow: defaults for status values
Description

In the bugview page, I'm missing the "Resolve Bug", "Reopen Bug" buttons from 0.17.5. Now there is only a list with all the statuses, which defaults to "new" most of the time. But when a bug is assigned to me, most of the time I want to resolve it, not set it to new.

Additional Information

in core/print_api I added this:
function get_status_option_list_default( $p_user_auth = 0, $p_current_value = 0, $p_show_current = true, $p_add_close = false ) {
$t_config_var_value = config_get( 'status_enum_string' );
$t_enum_workflow_default = config_get( 'status_enum_workflow_default' );

    if ( count( $t_enum_workflow_default ) >= 1 ) {
        # workflow defined - find allowed states
        if ( isset( $t_enum_workflow_default[$p_current_value] ) ) {
            return $t_enum_workflow_default[$p_current_value];
        }
    }
    return "";
}

in core/html_api.php: function html_button_bug_change_status i added:

    $t_enum_list_default = get_status_option_list_default( $t_current_access, $t_bug_current_state, false, 
            ( bug_get_field( $p_bug_id, 'reporter_id' ) == auth_get_current_user_id() && ( ON == config_get( 'allow_reporter_close' ) ) ) );

and the foreach loop now looks like this:
foreach ( $t_enum_list as $key => $val ) {
echo "<option value=\"$key\"";
if ($t_enum_list_default == $key) {
echo " selected";
}
echo ">$val</option>";
}
echo '</select>';

And an example from config_inc.php:
$g_status_enum_workflowdefault[NEW]='30:acknowledged';
$g_status_enum_workflow_default[FEEDBACK] ='50:assigned';
$g_status_enum_workflow_default[ACKNOWLEDGED] ='40:confirmed';
$g_status_enum_workflow_default[CONFIRMED] ='50:assigned';
$g_status_enum_workflow_default[ASSIGNED] ='80:resolved';
$g_status_enum_workflow_default[RESOLVED] ='90:closed';
$g_status_enum_workflow_default[CLOSED] ='';

I don't know if this all makes much sense, but it works for me...

TagsNo tags attached.

Relationships

has duplicate 0005436 closedthraxisp default value for change status should be next setting in workflow 

Activities

thraxisp

thraxisp

2004-11-22 18:52

reporter   ~0008402

Are you looking to set the default next state? The default is the first entry in the list. The items are shown in the order listed.

thraxisp

thraxisp

2005-05-01 11:02

reporter   ~0009983

Fixed in CVS.

The default next state has always been the first entry in the line in status_enum_workflow. The configuration UI now has a default selector that properly configures the values.

config_defaults_inc.php -> 1.261
manage_config_workflow_page.php -> 1.7
manage_config_workflow_set.php -> 1.3
core/config_api.php ->1.26
lang/strings_english.txt -> 1.256