diff --git a/Source/SourceIntegration.php b/Source/SourceIntegration.php
index e0ea2d2..bce93ab 100644
--- a/Source/SourceIntegration.php
+++ b/Source/SourceIntegration.php
@@ -21,9 +21,20 @@
return array(
'EVENT_VIEW_BUG_EXTRA' => 'display_bug',
'EVENT_DISPLAY_FORMATTED' => 'display_formatted',
+ 'EVENT_MENU_ISSUE' => 'display_changeset_link'
);
}
+ function display_changeset_link( $p_event, $p_bug_id ) {
+ $this->changesets = SourceChangeset::load_by_bug( $p_bug_id, true );
+
+ if ( count( $this->changesets ) > 1 ) {
+ return array( lang_get( 'related_changesets' ) => '#changesets' );
+ }
+
+ return array();
+ }
+
function display_bug( $p_event, $p_bug_id ) {
require_once( 'Source.ViewAPI.php' );
@@ -31,7 +42,7 @@
return;
}
- $t_changesets = SourceChangeset::load_by_bug( $p_bug_id, true );
+ $t_changesets = $this->changesets;
$t_repos = SourceRepo::load_by_changesets( $t_changesets );
if ( count( $t_changesets ) < 1 ) {
@@ -39,8 +50,10 @@
}
collapse_open( 'Source' );
+
?>
+