View Issue Details

IDProjectCategoryView StatusLast Update
0006847mantisbtadministrationpublic2015-12-06 02:45
Reporterjiangxin Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version1.3.0-rc.1Fixed in Version1.3.0-rc.1 
Summary0006847: wrong set_overrides() calling
Description

in manage_config_workflow_page.php and manage_config_work_threshold_page.php.

  1. First do some customizations in ALL_PROJECTS;
  2. choose a specific project.
  3. There is a "Delete Project Specific Settings" button, which shouldn't be there.

It is because of the wrong set_overrides() calling. Patch is here.

Additional Information

Patch is here.

diff --exclude=CVS -u -r mantis-sf-mirror/manage_config_workflow_page.php mantis/manage_config_workflow_page.php
--- mantis-sf-mirror/manage_config_workflow_page.php 2006-03-15 16:44:39.343750000 +0800
+++ mantis/manage_config_workflow_page.php 2006-03-15 16:41:43.500000000 +0800
@@ -98,7 +106,7 @@

# Get the value associated with the specific action and flag.
function show_flag( $p_from_status_id, $p_to_status_id ) {
  • global $t_can_change_workflow, $t_overrides, $t_file_workflow, $t_global_workflow, $t_project_workflow, $t_colour_global, $t_colour_project;
  • global $t_can_change_workflow, $t_overrides, $t_file_workflow, $t_global_workflow, $t_project_workflow, $t_colour_global, $t_colour_project, $t_project_id;
    if ( $p_from_status_id <> $p_to_status_id ) {
    $t_file = isset( $t_file_workflow['exit'][$p_from_status_id][$p_to_status_id] ) ? 1 : 0 ;
    $t_global = isset( $t_global_workflow['exit'][$p_from_status_id][$p_to_status_id] ) ? 1 : 0 ;
    @@ -107,7 +115,7 @@
    $t_colour = '';
    if ( $t_global != $t_file ) {
    $t_colour = ' bgcolor="' . $t_colour_global . '" '; # all projects override
  • if ( $t_can_change_workflow ) {
  • if ( $t_can_change_workflow && ALL_PROJECTS == $t_project_id ) {
    set_overrides( 'status_enum_workflow' );
    }
    }
    @@ -160,7 +168,7 @@
    }

    function capability_row( $p_from_status ) {

  • global $t_file_workflow, $t_global_workflow, $t_project_workflow, $t_colour_global, $t_colour_project, $t_can_change_workflow;
  • global $t_file_workflow, $t_global_workflow, $t_project_workflow, $t_colour_global, $t_colour_project, $t_can_change_workflow, $t_project_id;
    $t_enum_status = get_enum_to_array( config_get( 'status_enum_string' ) );
    echo '<tr ' . helper_alternate_class() . '><td>' . string_no_break( get_enum_to_string( lang_get( 'status_enum_string' ), $p_from_status ) ) . '</td>';
    foreach ( $t_enum_status as $t_to_status_id => $t_to_status_label ) {
    @@ -174,7 +182,7 @@
    $t_colour = '';
    if ( $t_global != $t_file ) {
    $t_colour = ' bgcolor="' . $t_colour_global . '" '; # all projects override
  • if ( $t_can_change_workflow ) {
  • if ( $t_can_change_workflow && ALL_PROJECTS == $t_project_id ) {
    set_overrides( 'status_enum_workflow' );
    }
    }
    diff --exclude=CVS -u -r mantis-sf-mirror/manage_config_work_threshold_page.php mantis/manage_config_work_threshold_page.php
    --- mantis-sf-mirror/manage_config_work_threshold_page.php 2006-03-15 16:44:39.312500000 +0800
    +++ mantis/manage_config_work_threshold_page.php 2006-03-15 16:41:43.484375000 +0800
    @@ -100,7 +103,7 @@
    $t_colour = '';
    if ( $t_global != $t_file ) {
    $t_colour = ' bgcolor="' . $t_colour_global . '" '; # all projects override
  • if ( $t_can_change ) {
  • if ( $t_can_change && ALL_PROJECTS == $t_project_id ) {
    set_overrides( $p_threshold );
    }
    }
    @@ -197,7 +227,7 @@
    $t_colour = '';
    if ( $t_global != $t_file ) {
    $t_colour = ' bgcolor="' . $t_colour_global . '" '; # all projects override
  • if ( $t_can_change ) {
  • if ( $t_can_change && ALL_PROJECTS == $t_project_id ) {
    set_overrides( $p_threshold );
    }
    }
Tagspatch

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master 979be2df

2015-11-01 00:25

dregad


Details Diff
Refactor set_overrides() function

The code now properly detects project vs global overrides, which
prevents unnecessary display of the 'Delete' button when editing
workflow for a project which only has overrides at the global level.

Two parameters have been added, which allow moving the logic to detect
whether an override is applied within the function, reducing code
duplication.

Fixes 0006847
Affected Issues
0006847
mod - manage_config_workflow_page.php Diff File