diff --git a/Source/Source.php b/Source/Source.php index 5cb222d..861c94a 100644 --- a/Source/Source.php +++ b/Source/Source.php @@ -86,6 +86,7 @@ 'EVENT_CORE_READY' => 'core_ready', 'EVENT_LAYOUT_RESOURCES' => 'css', 'EVENT_MENU_MAIN' => 'menu_main', + 'EVENT_FILTER_COLUMNS' => 'filter_columns', ); } @@ -111,6 +112,14 @@ } } + function filter_columns() + { + require_once( 'classes/RelatedChangesetsColumn.class.php' ); + return array( + 'SourceRelatedChangesetsColumn', + ); + } + function css() { return ''; } diff --git a/Source/classes/RelatedChangesetsColumn.class.php b/Source/classes/RelatedChangesetsColumn.class.php new file mode 100644 index 0000000..e60ef01 --- /dev/null +++ b/Source/classes/RelatedChangesetsColumn.class.php @@ -0,0 +1,41 @@ +id; + } + + $t_bug_ids = implode( ',', $t_bug_ids ); + + $t_query = "SELECT * FROM $t_bug_table WHERE bug_id IN ( $t_bug_ids )"; + $t_result = db_query_bound( $t_query ); + + while ( $t_row = db_fetch_array( $t_result ) ) { + if ( isset( $this->changeset_cache[ $t_row['bug_id'] ] ) ) { + $this->changeset_cache[ $t_row['bug_id'] ]++; + + } else { + $this->changeset_cache[ $t_row['bug_id'] ] = 1; + } + } + } + + public function display( $p_bug, $p_columns_target ) { + echo $this->changeset_cache[ $p_bug->id ]; + } + +}