Skip to content

Commit

Permalink
Issue #11405: Add link to bugnote revisions within bugnote display
Browse files Browse the repository at this point in the history
For bugnotes that have been edited, revisions may exist. If they do (ie.
they haven't been dropped by someone with permission to do so) then we
can display a count of revisions and a link to the page where users can
view previous revisions of a bugnote.
  • Loading branch information
davidhicks committed Jan 17, 2010
1 parent da6c133 commit dac9d0a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
9 changes: 8 additions & 1 deletion bugnote_view_inc.php
Expand Up @@ -26,6 +26,7 @@
* @uses access_api.php
* @uses authentication_api.php
* @uses bug_api.php
* @uses bug_revision_api.php
* @uses bugnote_api.php
* @uses collapse_api.php
* @uses config_api.php
Expand All @@ -44,6 +45,7 @@
require_api( 'access_api.php' );
require_api( 'authentication_api.php' );
require_api( 'bug_api.php' );
require_api( 'bug_revision_api.php' );
require_api( 'bugnote_api.php' );
require_api( 'collapse_api.php' );
require_api( 'config_api.php' );
Expand Down Expand Up @@ -165,7 +167,12 @@
<span class="small"><?php echo date( $t_normal_date_format, $t_bugnote->date_submitted ); ?></span><br />
<?php
if ( $t_bugnote_modified ) {
echo '<span class="small">' . lang_get( 'edited_on') . lang_get( 'word_separator' ) . date( $t_normal_date_format, $t_bugnote->last_modified ) . '</span><br />';
echo '<span class="small">' . lang_get( 'last_edited') . lang_get( 'word_separator' ) . date( $t_normal_date_format, $t_bugnote->last_modified ) . '</span><br />';
$t_revision_count = bug_revision_count( $f_bug_id, REV_BUGNOTE, $t_bugnote->id );
if ( $t_revision_count >= 1) {
$t_view_num_revisions_text = sprintf( lang_get( 'view_num_revisions' ), $t_revision_count );
echo '<span class="small"><a href="bug_revision_view_page.php?bugnote_id=' . $t_bugnote->id . '">' . $t_view_num_revisions_text . '</a></span><br />';
}
}
?>
<br /><div class="small">
Expand Down
3 changes: 2 additions & 1 deletion lang/strings_english.txt
Expand Up @@ -653,6 +653,7 @@ $s_updating_bug_simple_title = 'Updating Issue Information';

# bug_view*
$s_view_revisions = 'View Revisions';
$s_view_num_revisions = 'View %1$d revisions';
$s_revision = 'Revision';
$s_revision_by = '%1$s by %2$s';
$s_revision_drop = 'Drop';
Expand Down Expand Up @@ -683,7 +684,7 @@ $s_closed_bug_button = 'Close Issue';

# bugnote_update.php
$s_bugnote_updated_msg = 'Note has been successfully updated...';
$s_edited_on = 'edited on:';
$s_last_edited = 'Last edited:';

# file_api.php
$s_hide_content = 'Hide Content';
Expand Down
2 changes: 1 addition & 1 deletion print_all_bug_page_word.php
Expand Up @@ -534,7 +534,7 @@
<td class="print">
<?php echo $t_date_submitted ?>&nbsp;&nbsp;&nbsp;
<?php if ( $t_bugnote->date_submitted != $t_bugnote->last_modified ) {
echo '<br />(' . lang_get( 'edited_on') . lang_get( 'word_separator' ) . $t_last_modified . ')';
echo '<br />(' . lang_get( 'last_edited') . lang_get( 'word_separator' ) . $t_last_modified . ')';
} ?>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion print_bugnote_inc.php
Expand Up @@ -134,7 +134,7 @@
<td class="print">
<?php echo $v3_date_submitted ?>&nbsp;&nbsp;&nbsp;
<?php if ( $v3_date_submitted != $v3_last_modified ) {
echo '<br />(' . lang_get( 'edited_on') . lang_get( 'word_separator' ) . $v3_last_modified . ')';
echo '<br />(' . lang_get( 'last_edited') . lang_get( 'word_separator' ) . $v3_last_modified . ')';
} ?>
</td>
</tr>
Expand Down

0 comments on commit dac9d0a

Please sign in to comment.