Index: view_all_set.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/view_all_set.php,v
retrieving revision 1.57.4.1
diff -u -r1.57.4.1 view_all_set.php
--- view_all_set.php	10 Dec 2005 03:02:07 -0000	1.57.4.1
+++ view_all_set.php	24 Feb 2006 13:55:02 -0000
@@ -143,6 +143,8 @@
 	$f_per_page				= gpc_get_int( 'per_page', -1 );
 	$f_highlight_changed	= gpc_get_string( 'highlight_changed', config_get( 'default_show_changed' ) );
 	$f_sticky_issues		= gpc_get_bool( 'sticky_issues' );
+	# by Mike:
+	$f_show_children		= gpc_get_bool( 'show_children' );
 	# sort direction
 	$f_sort_d					= gpc_get_string( 'sort', '' );
 	$f_dir_d					= gpc_get_string( 'dir', '' );
@@ -248,6 +250,11 @@
 		$f_sticky_issues = 'off';
 	}
 
+	if ( $f_show_children ) {
+		$f_show_children = 'on';
+	} else {
+		$f_show_children = 'off';
+	}
 	if ( $f_type < 0 ) {
 		print_header_redirect( 'view_all_bug_page.php' );
 	}
@@ -364,6 +371,8 @@
 				$t_setting_arr['view_state'] = $f_view_state;
 				$t_setting_arr['custom_fields'] = $f_custom_fields_data;
 				$t_setting_arr['sticky_issues'] = $f_sticky_issues;
+				# by Mike
+				$t_setting_arr['show_children'] = $f_show_children;
 				$t_setting_arr['relationship_type'] = $f_relationship_type;
 				$t_setting_arr['relationship_bug'] = $f_relationship_bug;
 				$t_setting_arr['show_profile'] = $f_show_profile;
Index: view_filters_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/view_filters_page.php,v
retrieving revision 1.38.6.2
diff -u -r1.38.6.2 view_filters_page.php
--- view_filters_page.php	10 Dec 2005 03:02:07 -0000	1.38.6.2
+++ view_filters_page.php	2 Mar 2006 14:21:22 -0000
@@ -241,7 +241,7 @@
 		<td class="small-caption" colspan="<?php echo ( 1 * $t_custom_cols ); ?>">&nbsp;</td>
 	<?php } ?>
 	<td class="small-caption" colspan="<?php echo ( 1 * $t_custom_cols ); ?>"><?php echo lang_get( 'priority' ) ?></td>
-	<td class="small-caption" colspan="<?php echo ( ( $t_filter_cols - 7 ) * $t_custom_cols ); ?>">&nbsp;</td>
+	<td class="small-caption" colspan="<?php echo ( 1 * $t_custom_cols ); ?>"><?php echo lang_get( 'children' ) ?></td>
 </tr>
 <tr class="row-1">
 	<!-- Status -->
@@ -282,7 +282,10 @@
 	<td valign="top" colspan="<?php echo ( 1 * $t_custom_cols ); ?>">
 		<?php print_filter_show_priority(); ?>
 	</td>
-	<td colspan="<?php echo ( ( $t_filter_cols - 7 ) * $t_custom_cols ); ?>">&nbsp;</td>
+	<!-- Mike: children -->
+	<td valign="top" colspan="<?php echo ( 1 * $t_custom_cols ); ?>">
+		<?php print_filter_children(); ?>
+	</td>
 </tr>
 
 <tr class="row-category2">
Index: core/filter_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/filter_api.php,v
retrieving revision 1.122.2.2.2.3
diff -u -r1.122.2.2.2.3 filter_api.php
--- core/filter_api.php	12 Dec 2005 02:46:19 -0000	1.122.2.2.2.3
+++ core/filter_api.php	2 Mar 2006 14:19:37 -0000
@@ -311,6 +311,15 @@
 			}
 		}
 
+		# by Mike
+		if( $t_filter['show_children'] == 'off' ) {
+			$t_relationship_type = 2;
+			$t_sub_query_relationship = "SELECT DISTINCT $t_bug_table.id FROM $t_bug_relationship_table, $t_bug_table WHERE ($t_bug_table.id=$t_bug_relationship_table.destination_bug_id) AND ($t_bug_relationship_table.relationship_type=$t_relationship_type)";
+
+			$t_filter_children = "($t_bug_table.id NOT IN ($t_sub_query_relationship))";
+
+			array_push( $t_where_clauses, $t_filter_children);
+		}
 		# show / hide status
 		# take a list of all available statuses then remove the ones that we want hidden, then make sure
 		# the ones we want shown are still available
@@ -1377,9 +1386,9 @@
 			<td colspan="1" class="small-caption" valign="top">
 				<a href="<?php PRINT $t_filters_url . 'show_priority[]'; ?>" id="show_priority_filter"><?php PRINT lang_get( 'priority' ) ?>:</a>
 			</td>
-			<?php if ( $t_filter_cols > 7 ) {
-				echo '<td class="small-caption" valign="top" colspan="' . ( $t_filter_cols - 7 ) . '">&nbsp;</td>';
-			} ?>
+			<td colspan="1" class="small-caption" valign="top">
+				<a href="<?php PRINT $t_filters_url . 'show_children[]'; ?>" id="show_children"><?php PRINT lang_get( 'children' ) ?>:</a>
+			</td>
 		</tr>
 
 		<tr class="row-1">
@@ -1605,9 +1614,13 @@
 	               }
 	              ?>
 	    	</td>
-			<?php if ( $t_filter_cols > 7 ) {
-				echo '<td class="small-caption" valign="top" colspan="' . ( $t_filter_cols - 7 ) . '">&nbsp;</td>';
-			} ?>
+			<td class="small-caption" valign="top" id="show_children_filter_target">
+				<?php
+					$t_show_children_state = gpc_string_to_bool( $t_filter['show_children'] )  ;
+					PRINT ( $t_show_children_state ? lang_get( 'yes' ) : lang_get( 'no' ) );
+				?>
+				<input type="hidden" name="show_children" value="<?php echo $t_show_children_state ? 'on' : 'off';?>" />
+			</td>
 
 		</tr>
 
@@ -2349,6 +2362,9 @@
 		if ( !isset( $p_filter_arr['sticky_issues'] ) ) {
 			$p_filter_arr['sticky_issues'] = config_get( 'show_sticky_issues' );
 		}
+		if ( !isset( $p_filter_arr['show_children'] ) ) {
+					$p_filter_arr['show_children'] = "on"; #config_get( 'show_children' );
+		}
 		if ( !isset( $p_filter_arr['sort'] ) ) {
 			$p_filter_arr['sort'] = "last_updated";
 		}
@@ -2755,6 +2771,13 @@
 		<?php
 	}
 
+	function print_filter_children(){
+		global $t_filter;
+		?><!-- Show or hide sticky bugs -->
+			<input type="checkbox" name="show_children" <?php check_checked( gpc_string_to_bool( $t_filter['show_children'] ), 'on' ); ?> />
+		<?php
+	}
+
 	function print_filter_highlight_changed(){
 		global $t_filter;
 		?><!-- Highlight changed bugs -->
Index: lang/strings_english.txt
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/lang/strings_english.txt,v
retrieving revision 1.267
diff -u -r1.267 strings_english.txt
--- lang/strings_english.txt	7 Aug 2005 13:42:04 -0000	1.267
+++ lang/strings_english.txt	15 May 2006 07:36:00 -0000
@@ -555,6 +555,7 @@
 $s_reporter = 'Reporter';
 $s_assigned_to = 'Assigned To';
 $s_priority = 'Priority';
+$s_children = 'Show Children';
 $s_resolution = 'Resolution';
 $s_status = 'Status';
 $s_duplicate_id = 'Duplicate ID';
