View Issue Details

IDProjectCategoryView StatusLast Update
0004617mantisbtfilterspublic2014-11-07 15:36
Reporterralfiii Assigned To 
PrioritynormalSeverityfeatureReproducibilityalways
Status newResolutionopen 
Product Version0.19.0 
Summary0004617: Hide "Child of" entries
Description

I'd like to be able to hide issues that are a "child of" another issue.

We use the "child of" relationship a lot to group issues together for upcoming releases. If it would be possible to hide issues that have been specified as "child of" something else, this would help a lot to concentrate on "normal" open issues.

TagsNo tags attached.
Attached Files
MantisFilterChildren.png (785 bytes)   
MantisFilterChildren.png (785 bytes)   
child_vs_100rc4.patch (6,411 bytes)   
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';
child_vs_100rc4.patch (6,411 bytes)   
MantisFilterChildren_.png (8,195 bytes)   
MantisFilterChildren_.png (8,195 bytes)   
mantis_child_vs_105.patch (6,810 bytes)   
? bug_timetrack_view_inc.php
? config_inc.php
Index: view_all_set.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/view_all_set.php,v
retrieving revision 1.57.4.1.2.1.4.1
diff -u -r1.57.4.1.2.1.4.1 view_all_set.php
--- view_all_set.php	6 Apr 2006 00:28:52 -0000	1.57.4.1.2.1.4.1
+++ view_all_set.php	25 Aug 2006 12:51:16 -0000
@@ -143,6 +143,8 @@
 	$f_per_page				= gpc_get_int( 'per_page', -1 );
 	$f_highlight_changed	= gpc_get_int( 'highlight_changed', config_get( 'default_show_changed' ) );
 	$f_sticky_issues		= gpc_get_bool( 'sticky_issues' );
+	# Sx: Hide child issues
+	$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,13 @@
 		$f_sticky_issues = 'off';
 	}
 
+        # Sx: Hide child issues
+	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 +373,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;
+                                # Sx: Hide child issues
+				$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	6 Jul 2006 09:36:55 -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>
+	<!-- Sx: Hide child issues -->
+	<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.2.5.2.3.2.1
diff -u -r1.122.2.2.2.3.2.5.2.3.2.1 filter_api.php
--- core/filter_api.php	6 May 2006 03:01:07 -0000	1.122.2.2.2.3.2.5.2.3.2.1
+++ core/filter_api.php	25 Aug 2006 12:51:22 -0000
@@ -311,6 +311,16 @@
 			}
 		}
 
+		# Sx: Hide child issues
+		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
@@ -1374,9 +1384,11 @@
 			<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>';
-			} ?>
+
+			<!-- Sx: Hide child issues -->
+			<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 +1617,14 @@
 	               }
 	              ?>
 	    	</td>
-			<?php if ( $t_filter_cols > 7 ) {
-				echo '<td class="small-caption" valign="top" colspan="' . ( $t_filter_cols - 7 ) . '">&nbsp;</td>';
-			} ?>
+			<!-- Sx: Hide child issues -->
+			<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 +2366,12 @@
 		if ( !isset( $p_filter_arr['sticky_issues'] ) ) {
 			$p_filter_arr['sticky_issues'] = config_get( 'show_sticky_issues' );
 		}
+
+		# Sx: Hide child 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";
 		}
@@ -2753,6 +2776,14 @@
 		<?php
 	}
 
+	# Sx: Hide child issues
+	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.10.1
diff -u -r1.267.10.1 strings_english.txt
--- lang/strings_english.txt	7 May 2006 05:56:22 -0000	1.267.10.1
+++ lang/strings_english.txt	11 Oct 2006 10:40:11 -0000
@@ -556,6 +556,8 @@
 $s_reporter = 'Reporter';
 $s_assigned_to = 'Assigned To';
 $s_priority = 'Priority';
+# Sx: Hide child issues
+$s_children = 'Show Children';
 $s_resolution = 'Resolution';
 $s_status = 'Status';
 $s_duplicate_id = 'Duplicate ID';
mantis_child_vs_105.patch (6,810 bytes)   

Activities

stevemagruder

stevemagruder

2004-09-27 10:23

reporter   ~0007771

I second this idea. I was about to log a feature request similar to this, for the same reasons.

vboctor

vboctor

2004-09-29 10:15

manager   ~0007825

Are you guys interested in this as a configuration option or something that is controllable at runtime?

stevemagruder

stevemagruder

2004-09-29 10:48

reporter   ~0007827

Last edited: 2004-09-29 10:51

I've been rethinking this one.

I also use the "child of" relationship to group issues together for upcoming releases. But I also usually make these groups prerequisites (children) of other group issues, like when a release of a software product depends on a release of a framework I'm also developing. So, in this case, eliminating issues that have parents wouldn't work so well.

Therefore, I think we'll need a filter that's even more refined. Actually, two filters: #/Children (None, One, Many, "Don't Care"-default) and #/Parents (None, One, Many, "Don't Care"-default).

Providing this feature if a configuration option is set would be fine to me if it doesn't make sense to include these filters amongst the normal set of filters.

edited on: 09-29-04 10:51

tandler

tandler

2004-09-29 15:46

reporter   ~0007836

I agree that this would be helpful.

Some thoughts for this discussion:

Instead of using children to group issues to upcoming releases, we introduced a custom field "target version" (see my feature request 0004640 :-). This way, there would be no interference between hiding children and target versions.

And: I suggested to introduce a dependency relationship in addition to the children (see 0004639). So this discussion is in fact a good argument that this distinction makes sense: You can hide all children while keeping dependent issues visible.

Re vboctor: This should be configurable at runtime. Once you have a parent-children hierarchy, the next thing you wish is (of course) the hierarchy view like in MS Project etc. ... hiding children is the first small step in this direction ;-)

tandler

tandler

2004-09-29 15:50

reporter   ~0007837

An add-on idea: Maybe, if should be possible to hide all children, or to hide the children of some specified issue only (e.g. add a "Hide children of this issue" button to view.php)

stevemagruder

stevemagruder

2004-09-30 12:25

reporter   ~0007848

I like the idea of a target version field for the sake of filtering, but I still also like to group version children under a version parent. This is because of the scenario I stated where one version of an app depends on another version of a framework. Making all the issues under one app version individually dependent on the new version of a framework (which includes its own set of issues) would be inflexible without version parents.

Also consider the visual representation of these relationships--a target version field won't help me here.

Unless there's a way of creating and visually representating dependencies between target versions (and there's not now), I have to continue with version grouping.

ralfiii

ralfiii

2004-10-05 04:06

reporter   ~0007903

I would simply need a filter for hiding those entries who are in a "child of" relationship with an other issue.
And : This would have to be an option in the filter-interface, so this filtering could be easily switched on/off.

I especially disagree with tandler, because the grouping doesn't always corellate with a version.

stevemagruder

stevemagruder

2005-01-05 14:10

reporter   ~0008853

Has anyone looked at this issue lately? It would be cool if this were implemented. However, I'd call this issue a new feature rather than a bug.

ralfiii

ralfiii

2005-02-03 11:25

reporter   ~0009189

Last edited: 2005-09-20 06:32

To vboctor: Sorry, I didn't see your question so I didn't answer.

I'd like to see that as filter setting (controllable at runtime).

And, yes, it's a feature.

tandler

tandler

2005-05-24 04:09

reporter   ~0010195

For inspiration: http://www.trackplus.de/ has a nice way of visualizing child issues: The first column has [+] / [-] buttons to fold / unfold children, quite similar to MS Excel's grouping feature.

ralfiii

ralfiii

2005-06-24 08:21

reporter   ~0010620

VBoctor: could you give me a hint on how to implement this feature?

(0004853 unfortunately doesn't resolve this issue here.)

I'm quite sure I can add a checkbox to the filter-view. Then I would think that I have to modify the SQL-query that filters the issue that have to be displayed in view_all_bug_page.php, but I have no idea WHERE this query is generated.

Thanks,
Ralf S.

ralfiii

ralfiii

2005-09-20 06:37

reporter   ~0011399

Has someone a solution for that issue?
(I'd like not to do that, as I am far from good at PHP, and I'm also missing a bit the insight into Mantis's internal structures)

ralfiii

ralfiii

2006-05-12 05:01

reporter   ~0012819

A solution as described in 0004617:0010195 would naturally be fantastic.
However, for the moment I've implemented just an additional filter property, that alloes to hide all issed that have a child-status.
(see attached image). Let me know if anyone is interested...

stevemagruder

stevemagruder

2006-05-12 11:43

reporter   ~0012821

ralfiii, I'd be happy to check out your mod. Could you post it to this issue? Thanks!

ralfiii

ralfiii

2006-05-15 03:48

reporter   ~0012831

I attached the patch against version 1.0.0rc4.
Let me know if you have any problems with it...

stevemagruder

stevemagruder

2006-05-16 14:23

reporter   ~0012850

Well, I'm using 1.0.3 (latest version)... will the patch work against this as well?

ralfiii

ralfiii

2006-05-22 10:23

reporter   ~0012886

Eerh... To test this I checked out revision 1.0.3 and wanted to apply the patch ... and found out that I can MAKE patch-files, but I don't know how to apply them.

Any hint? (Win-user)

skipole

skipole

2006-10-10 21:42

reporter   ~0013602

Can someone put the attached files back?

ralfiii

ralfiii

2006-10-11 06:47

reporter   ~0013603

Additional to the patch I also uploaded the files that need to be changed in V1.0.5 as windows-users may find that easier to use.

n_vaughan

n_vaughan

2006-10-13 09:20

reporter   ~0013613

This is exactly what I've been looking for :D

Vadim_C

Vadim_C

2007-07-09 09:43

reporter   ~0014911

Typo:

<b>filter_api.php</b>:
function print_filter_children -> function print_filter_show_children
id="show_children" -> id="show_children_filter"

mtindall

mtindall

2008-09-11 08:51

reporter   ~0019384

Does this work on 1.1.2 ?