From 573ab37ebf09b6f87a5caf76d9d1bf47a376b1be Mon Sep 17 00:00:00 2001
From: Brian Wrightson <brian.wrightson@gmail.com>
Date: Thu, 2 Apr 2009 00:19:54 -0400
Subject: [PATCH] Fix #8949: Some formatting tweaks for the Roadmap

I used the sort that @milliams posted and added a bold header at the top of each Priority section.
---
 roadmap_page.php |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/roadmap_page.php b/roadmap_page.php
index 7e050db..5731148 100644
--- a/roadmap_page.php
+++ b/roadmap_page.php
@@ -106,7 +106,7 @@
 			$query = "SELECT sbt.*, $t_relation_table.source_bug_id, dbt.target_version as parent_version FROM $t_bug_table AS sbt
 						LEFT JOIN $t_relation_table ON sbt.id=$t_relation_table.destination_bug_id AND $t_relation_table.relationship_type=2
 						LEFT JOIN $t_bug_table AS dbt ON dbt.id=$t_relation_table.source_bug_id
-						WHERE sbt.project_id='$c_project_id' AND sbt.target_version='$c_version' ORDER BY sbt.status ASC, sbt.last_updated DESC";
+						WHERE sbt.project_id='$c_project_id' AND sbt.target_version='$c_version' ORDER BY sbt.status ASC, sbt.priority DESC, sbt.last_updated DESC";
 
 			$t_description = $t_version_row['description'];
 
@@ -235,7 +235,15 @@
 			for ( $j = 0; $j < count( $t_issue_set_ids ); $j++ ) {
 				$t_issue_set_id = $t_issue_set_ids[$j];
 				$t_issue_set_level = $t_issue_set_levels[$j];
-				 
+
+				$t_bug = bug_get( $t_issue_set_id );
+
+				if ( $t_bug->priority != $t_priority
+				  && $t_bug->status < $t_resolved ) {
+					echo '<b>&nbsp;&nbsp;', strtoupper( get_enum_element( 'priority', $t_bug->priority ) ), '</b><br />';
+				    $t_priority = $t_bug->priority;
+				}
+
 				helper_call_custom_function( 'roadmap_print_issue', array( $t_issue_set_id, $t_issue_set_level ) );
 			}
 
-- 
1.6.1

