From: <nuc...@us...> - 2008-03-13 15:33:45
|
Revision: 5106 http://mantisbt.svn.sourceforge.net/mantisbt/?rev=5106&view=rev Author: nuclear_eclipse Date: 2008-03-13 08:33:40 -0700 (Thu, 13 Mar 2008) Log Message: ----------- Ported Fix #8931: Circle Relations cause roadmap to malfunction. Roadmap and Changelog have cycle detection now. When a cycle is detected, one element from the cycle is placed into the roadmap as if it had no parent. The rest of the cycle is handled as normal. Modified Paths: -------------- branches/BRANCH_1_1_0/mantisbt/changelog_page.php branches/BRANCH_1_1_0/mantisbt/roadmap_page.php Modified: branches/BRANCH_1_1_0/mantisbt/changelog_page.php =================================================================== --- branches/BRANCH_1_1_0/mantisbt/changelog_page.php 2008-03-13 15:22:16 UTC (rev 5105) +++ branches/BRANCH_1_1_0/mantisbt/changelog_page.php 2008-03-13 15:33:40 UTC (rev 5106) @@ -167,11 +167,21 @@ $t_issue_set_levels = array(); $k = 0; + $t_cycle = false; + $t_cycle_ids = array(); + while ( 0 < count( $t_issue_ids ) ) { $t_issue_id = $t_issue_ids[$k]; $t_issue_parent = $t_issue_parents[$k]; - if ( !in_array( $t_issue_parent, $t_issue_ids ) ) { + if ( in_array( $t_issue_id, $t_cycle_ids ) || in_array( $t_parent_id, $t_cycle_ids ) ) { + $t_cycle = true; + } else { + $t_cycle = false; + $t_cycle_ids[] = $t_issue_id; + } + + if ( $t_cycle || !in_array( $t_issue_parent, $t_issue_ids ) ) { $l = array_search( $t_issue_parent, $t_issue_set_ids ); if ( $l !== false ) { for ( $m = $l+1; $m < count( $t_issue_set_ids ) && $t_issue_set_levels[$m] > $t_issue_set_levels[$l]; $m++ ) { @@ -190,6 +200,8 @@ } array_splice( $t_issue_ids, $k, 1 ); array_splice( $t_issue_parents, $k, 1 ); + + $t_cycle_ids = array(); } else { $k++; Modified: branches/BRANCH_1_1_0/mantisbt/roadmap_page.php =================================================================== --- branches/BRANCH_1_1_0/mantisbt/roadmap_page.php 2008-03-13 15:22:16 UTC (rev 5105) +++ branches/BRANCH_1_1_0/mantisbt/roadmap_page.php 2008-03-13 15:33:40 UTC (rev 5106) @@ -187,12 +187,22 @@ $t_issue_set_ids = array(); $t_issue_set_levels = array(); $k = 0; + + $t_cycle = false; + $t_cycle_ids = array(); while ( 0 < count( $t_issue_ids ) ) { $t_issue_id = $t_issue_ids[$k]; $t_issue_parent = $t_issue_parents[$k]; - if ( !in_array( $t_issue_parent, $t_issue_ids ) ) { + if ( in_array( $t_issue_id, $t_cycle_ids ) || in_array( $t_parent_id, $t_cycle_ids ) ) { + $t_cycle = true; + } else { + $t_cycle = false; + $t_cycle_ids[] = $t_issue_id; + } + + if ( $t_cycle || !in_array( $t_issue_parent, $t_issue_ids ) ) { $l = array_search( $t_issue_parent, $t_issue_set_ids ); if ( $l !== false ) { for ( $m = $l+1; $m < count( $t_issue_set_ids ) && $t_issue_set_levels[$m] > $t_issue_set_levels[$l]; $m++ ) { @@ -211,6 +221,8 @@ } array_splice( $t_issue_ids, $k, 1 ); array_splice( $t_issue_parents, $k, 1 ); + + $t_cycle_ids = array(); } else { $k++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |