View Issue Details

IDProjectCategoryView StatusLast Update
0010988mantisbtcustomizationpublic2009-10-10 12:10
Reportercmfitch1 Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
Status newResolutionopen 
Summary0010988: Make summary location configurable
Description

We prefer to have the summary at the top of the view and edit pages instead of in the middle. I have added a config option to accomplish this. The config option is set to either POSITION_TOP or POSITION_BOTTOM (default). POSITION_TOP places the summary above the reporter field, while POSITION_BOTTOM places it above the description where it currently resides.

Tagspatch
Attached Files
issue_10988.patch (4,703 bytes)   
From e51f56a5166b860c0c79a4e09578151fec23b850 Mon Sep 17 00:00:00 2001
From: Chris Fitch <cfitch@redcom.com>
Date: Fri, 25 Sep 2009 14:11:20 -0400
Subject: [PATCH] Make summary location configurable


diff --git a/bug_update_advanced_page.php b/bug_update_advanced_page.php
index 42d2fe0..a1e56d7 100644
--- a/bug_update_advanced_page.php
+++ b/bug_update_advanced_page.php
@@ -57,6 +57,7 @@ print_recently_visited();
 
 $t_fields = config_get( 'bug_update_page_fields' );
 $t_fields = columns_filter_disabled( $t_fields );
+$t_summary_position = config_get( 'summary_position' );
 
 $tpl_bug_id = $f_bug_id;
 
@@ -88,6 +89,8 @@ $tpl_show_target_version = $t_enable_product_version && in_array( BUG_FIELD_TARG
 $tpl_show_fixed_in_version = $t_enable_product_version && in_array( BUG_FIELD_FIXED_IN_VERSION, $t_fields );
 $tpl_show_due_date = in_array( BUG_FIELD_DUE_DATE, $t_fields ) && access_has_bug_level( config_get( 'due_date_view_threshold' ), $tpl_bug_id );
 $tpl_show_summary = in_array( BUG_FIELD_SUMMARY, $t_fields );
+$tpl_top_summary_enabled = $tpl_show_summary && ( $t_summary_position == POSITION_TOP );
+$tpl_bottom_summary_enabled = $tpl_show_summary && ( $t_summary_position == POSITION_BOTTOM );
 $tpl_summary_attribute = $tpl_show_summary ? string_attribute( $tpl_bug->summary ) : '';
 $tpl_show_description = in_array( BUG_FIELD_DESCRIPTION, $t_fields );
 $tpl_description_textarea = $tpl_show_description ? string_textarea( $tpl_bug->description ) : '';
@@ -187,6 +190,14 @@ if ( $tpl_show_id || $tpl_show_project || $tpl_show_category || $tpl_show_view_s
 	echo '<tr class="spacer"><td colspan="6"></td></tr>';
 }
 
+# Summary
+if ( $tpl_top_summary_enabled ) {
+	echo '<tr ', helper_alternate_class(), '>';
+	echo '<td class="category">', lang_get( 'summary' ), '</td>';
+	echo '<td colspan="5">', '<input ', helper_get_tab_index(), ' type="text" name="summary" size="105" maxlength="128" value="', $tpl_summary_attribute, '" />';
+	echo '</td></tr>';
+}
+
 #
 # Reporter
 #
@@ -561,7 +572,7 @@ event_signal( 'EVENT_UPDATE_BUG_FORM', array( $tpl_bug_id, true ) );
 echo '<tr class="spacer"><td colspan="6"></td></tr>';
 
 # Summary
-if ( $tpl_show_summary ) {
+if ( $tpl_bottom_summary_enabled ) {
 	echo '<tr ', helper_alternate_class(), '>';
 	echo '<td class="category">', lang_get( 'summary' ), '</td>';
 	echo '<td colspan="5">', '<input ', helper_get_tab_index(), ' type="text" name="summary" size="105" maxlength="128" value="', $tpl_summary_attribute, '" />';
diff --git a/bug_view_inc.php b/bug_view_inc.php
index 4d6ac30..639c40c 100644
--- a/bug_view_inc.php
+++ b/bug_view_inc.php
@@ -68,6 +68,7 @@
 	}
 
 	$t_action_button_position = config_get( 'action_button_position' );
+	$t_summary_position = config_get( 'summary_position' );
 
 	$t_bugslist = gpc_get_cookie( config_get( 'bug_list_cookie' ), false );
 
@@ -183,6 +184,8 @@
 	$tpl_show_resolution = in_array( BUG_FIELD_RESOLUTION, $t_fields );
 	$tpl_resolution = $tpl_show_resolution ? string_display_line( get_enum_element( 'resolution', $tpl_bug->resolution ) ) : '';
 	$tpl_show_summary = in_array( BUG_FIELD_SUMMARY, $t_fields );
+	$tpl_top_summary_enabled = $tpl_show_summary && ( $t_summary_position == POSITION_TOP );
+	$tpl_bottom_summary_enabled = $tpl_show_summary && ( $t_summary_position == POSITION_BOTTOM );
 	$tpl_show_description = in_array( BUG_FIELD_DESCRIPTION, $t_fields );
 
 	$tpl_summary = $tpl_show_summary ? string_display_line_links( bug_format_summary( $f_bug_id, SUMMARY_FIELD ) ) : '';
@@ -311,6 +314,14 @@
 		echo '<tr class="spacer"><td colspan="6"></td></tr>';
 	}
 
+	# Summary
+	if ( $tpl_top_summary_enabled ) {
+		echo '<tr ', helper_alternate_class(), '>';
+		echo '<td class="category">', lang_get( 'summary' ), '</td>';
+		echo '<td colspan="5">', $tpl_summary, '</td>';
+		echo '</tr>';
+	}
+
 	#
 	# Reporter
 	#
@@ -587,7 +598,7 @@
 	#
 
 	# Summary
-	if ( $tpl_show_summary ) {
+	if ( $tpl_bottom_summary_enabled ) {
 		echo '<tr ', helper_alternate_class(), '>';
 		echo '<td class="category">', lang_get( 'summary' ), '</td>';
 		echo '<td colspan="5">', $tpl_summary, '</td>';
diff --git a/config_defaults_inc.php b/config_defaults_inc.php
index be9d273..5924b68 100644
--- a/config_defaults_inc.php
+++ b/config_defaults_inc.php
@@ -891,6 +891,13 @@
 	$g_filter_position	= FILTER_POSITION_TOP;
 
 	/**
+	 * Position of summary when viewing/editing issues
+	 * Can be: POSITION_TOP or POSITION_BOTTOM
+	 * @global int $g_summary_position
+	 */
+	$g_summary_position = POSITION_BOTTOM;
+
+	/**
 	 * Position of action buttons when viewing issues.
 	 * Can be: POSITION_TOP, POSITION_BOTTOM, or POSITION_BOTH.
 	 * @global int $g_action_button_position
-- 
1.6.0.4

issue_10988.patch (4,703 bytes)   

Activities