View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0007710 | mantisbt | filters | public | 2007-01-10 08:05 | 2013-04-03 15:47 |
| Reporter | polzin | Assigned To | |||
| Priority | normal | Severity | feature | Reproducibility | N/A |
| Status | new | Resolution | open | ||
| Summary | 0007710: Patch for: Filter relationship with any (e.g. all issues with children) | ||||
| Description | To get all issues with children: | ||||
| Tags | No tags attached. | ||||
| Attached Files | patch.txt (2,575 bytes)
Index: core/filter_api.php
===================================================================
RCS file: /cvs/TPS/mantis/core/filter_api.php,v
retrieving revision 1.10
diff -u -r1.10 filter_api.php
--- core/filter_api.php 12 Oct 2006 11:45:43 -0000 1.10
+++ core/filter_api.php 10 Jan 2007 13:00:30 -0000
@@ -583,7 +583,7 @@
$t_any_found = false;
$c_rel_type = $t_filter['relationship_type'];
$c_rel_bug = $t_filter['relationship_bug'];
- if ( -1 == $c_rel_type || 0 == $c_rel_bug) {
+ if ( -1 == $c_rel_type ) {
$t_any_found = true;
}
if ( !$t_any_found ) {
@@ -595,9 +595,19 @@
array_push( $t_join_clauses, "LEFT JOIN $t_bug_relationship_table $t_table_name ON $t_table_name.destination_bug_id = $t_bug_table.id" );
// get reverse relationships
if ( $c_rel_type == 1 ) array_push( $t_join_clauses, "LEFT JOIN $t_bug_relationship_table $t_table_name"."2 ON $t_table_name"."2.source_bug_id = $t_bug_table.id" );
- array_push( $t_clauses, "($t_table_name.relationship_type='$c_rel_type' AND $t_table_name.source_bug_id='$c_rel_bug')" );
- // get reverse relationships
- if ( $c_rel_type == 1 ) array_push( $t_clauses, "($t_table_name"."2.relationship_type='$c_rel_type' AND $t_table_name"."2.destination_bug_id='$c_rel_bug')" );
+ if ( $c_rel_bug == 0 ) {
+ array_push( $t_clauses, "($t_table_name.relationship_type='$c_rel_type')" );
+ } else {
+ array_push( $t_clauses, "($t_table_name.relationship_type='$c_rel_type' AND $t_table_name.source_bug_id='$c_rel_bug')" );
+ }
+ // get reverse relationships
+ if ( $c_rel_type == 1 ) {
+ if ( $c_rel_bug == 0 ) {
+ array_push( $t_clauses, "($t_table_name"."2.relationship_type='$c_rel_type')" );
+ } else {
+ array_push( $t_clauses, "($t_table_name"."2.relationship_type='$c_rel_type' AND $t_table_name"."2.destination_bug_id='$c_rel_bug')" );
+ }
+ }
array_push( $t_where_clauses, '('. implode( ' OR ', $t_clauses ) .')' );
}
@@ -1747,10 +1757,15 @@
<?php
$c_rel_type = $t_filter['relationship_type'];
$c_rel_bug = $t_filter['relationship_bug'];
- if ( -1 == $c_rel_type || 0 == $c_rel_bug ) {
+ if ( -1 == $c_rel_type ) {
PRINT lang_get( 'any' );
} else {
- PRINT relationship_get_description_for_history ($c_rel_type) . ' ' . $c_rel_bug;
+ PRINT relationship_get_description_for_history ($c_rel_type) . ' ';
+ if ( $c_rel_bug == 0 ) {
+ PRINT lang_get( 'any' );
+ } else {
+ PRINT $c_rel_bug;
+ }
}
?>
| ||||