Skip to content

Commit

Permalink
Show file added event in timeline.
Browse files Browse the repository at this point in the history
1. Add class IssueFileAddedTimelineEvent to show file added event in
timeline.
2. Remove identical event from timeline.
Fixed issue #23161
  • Loading branch information
Zipher04 authored and atrol committed Mar 30, 2018
1 parent 32e30f3 commit 1067889
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions core/classes/IssueFileAddedTimelineEvent.class.php
Expand Up @@ -46,8 +46,7 @@ public function __construct( $p_timestamp, $p_user_id, $p_issue_id ) {
* @return string
*/
public function html() {
$t_show_summary = config_get( 'timeline_show_issue_summary' );
$t_link = string_get_bug_view_link( $this->issue_id, true, false, $t_show_summary );
$t_link = string_get_bug_view_link( $this->issue_id );

$t_html = $this->html_start( 'fa-plus' );
$t_html .= '<div class="action">' . sprintf( lang_get( 'timeline_issue_file_added' ), user_get_name( $this->user_id ), $t_link ) . '</div>';
Expand Down
9 changes: 5 additions & 4 deletions core/timeline_api.php
Expand Up @@ -65,10 +65,11 @@ function timeline_events( $p_start_time, $p_end_time, $p_max_events, $p_filter =
$t_issue_id = $t_history_event['bug_id'];

if ( $t_previous_history_event != null ) { //check repeated event
if ( $t_previous_history_event['userid'] == $t_history_event['userid'] &&
$t_previous_history_event['date'] == $t_history_event['date'] &&
$t_previous_history_event['bug_id'] == $t_history_event['bug_id'] &&
$t_previous_history_event['type'] == $t_history_event['type'] ) {
if ( $t_previous_history_event['userid'] == $t_history_event['userid']
&& $t_previous_history_event['date'] == $t_history_event['date']
&& $t_previous_history_event['bug_id'] == $t_history_event['bug_id']
&& $t_previous_history_event['type'] == $t_history_event['type']
) {
continue;
}
}
Expand Down
1 change: 0 additions & 1 deletion lang/strings_chinese_traditional.txt
Expand Up @@ -1238,7 +1238,6 @@ $s_month_october = '10 月';
$s_month_november = '11 月';
$s_month_december = '12 月';
$s_timeline_issue_created = '<span class="username">%1$s</span> 已建立問題 <span class="issue_id">%2$s</span>';
$s_timeline_issue_file_added = '<span class="username">%1$s</span> 已新增檔案於議題 <span class="issue_id">%2$s</span>';
$s_timeline_issue_note_created = '<span class="username">%1$s</span> 已說明問題 <span class="issue_id">%2$s</span>';
$s_timeline_issue_monitor = '<span class="username">%1$s</span> 正在監視問題 <span class="issue_id">%2$s</span>';
$s_timeline_issue_unmonitor = '<span class="username">%1$s</span> 停止監視問題 <span class="issue_id">%2$s</span>';
Expand Down
2 changes: 1 addition & 1 deletion lang/strings_english.txt
Expand Up @@ -1600,7 +1600,7 @@ $s_month_december = 'December';

# Timeline Feature Strings
$s_timeline_issue_created = '<span class="username">%1$s</span> created issue <span class="issue_id">%2$s</span>';
$s_timeline_issue_file_added = '<span class="username">%1$s</span> added attachment in issue <span class="issue_id">%2$s</span>';
$s_timeline_issue_file_added = '<span class="username">%1$s</span> added attachment(s) to issue <span class="issue_id">%2$s</span>';
$s_timeline_issue_note_created = '<span class="username">%1$s</span> commented on issue <span class="issue_id">%2$s</span>';
$s_timeline_issue_monitor = '<span class="username">%1$s</span> is monitoring issue <span class="issue_id">%2$s</span>';
$s_timeline_issue_unmonitor = '<span class="username">%1$s</span> stopped monitoring issue <span class="issue_id">%2$s</span>';
Expand Down

0 comments on commit 1067889

Please sign in to comment.