Skip to content

Commit 60e87d4

Browse files
committed
Show status color box next to issue id in view page
The view page was not consistently formatting resolved issue IDs; a regular link was displayed in Attached Issues list, whereas if the same resolved/closed issue was referenced in the Changeset messages it would be printed with strikethrough ('resolved' CSS class). An attempt to fix this by using the same string_get_bug_view_link() function for the Affected Issues list was not looking good due to the tooltip with issue description (the same text is already displayed next to the issue id). Finally, displaying a box with the issue's status color (similar to the display in My View and View Issues pages) was implemented. Fixes #234
1 parent b705427 commit 60e87d4

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

Source/pages/view.php

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,31 @@
139139

140140
<?php
141141
$t_first = true;
142+
$t_user_id = auth_get_current_user_id();
142143
foreach ( $t_bug_rows as $t_bug_id => $t_bug_row ) {
144+
$t_color_class = html_get_status_css_class(
145+
$t_bug_row['status'],
146+
$t_user_id,
147+
$t_bug_row['project_id']
148+
);
149+
$t_status_description = get_enum_element(
150+
'status',
151+
bug_get_field( $t_bug_id, 'status' ),
152+
$t_bug_row['project_id']
153+
);
154+
143155
echo ( $t_first ? '' : '<tr>' );
144156
?>
145-
<td colspan="<?php echo $t_columns-( $t_can_update ? 2 : 1 ) ?>"><?php echo '<a href="view.php?id=', $t_bug_id, '">', bug_format_id( $t_bug_id ), '</a>: ', string_display_line( $t_bug_row['summary'] ) ?></td>
157+
<td colspan="<?php echo $t_columns-( $t_can_update ? 2 : 1 ) ?>"><?php
158+
# Status color box with tooltip
159+
echo '<i class="fa fa-square fa-status-box ' . $t_color_class
160+
. '" title="' . string_attribute( $t_status_description ) . '"></i>&nbsp;';
161+
162+
# Issue ID and description
163+
echo '<a href="view.php?id=', $t_bug_id, '">',
164+
bug_format_id( $t_bug_id ), '</a>: ',
165+
string_display_line( $t_bug_row['summary'] ) ?>
166+
</td>
146167
<?php if ( $t_can_update ) { ?>
147168
<td class="center">
148169
<?php print_small_button( plugin_page( 'detach' ) . '&id=' . $t_changeset->id . '&bug_id=' . $t_bug_id . form_security_param( 'plugin_Source_detach' ), plugin_lang_get( 'detach' ) ) ?>

0 commit comments

Comments
 (0)