Changelog clearly laid out, severity as background-color
Posted: 13 Jun 2007, 11:14
- using mantis 1.05 -
I changed the changelog to show it in some kind of table-format. It is formatted with spaces for better readability and allows copy/paste as before. Private bugs are marked with '(p)' and severity is shown with different background-colors.
Example
old format:
- 0001162: [User Interface] no access to config-dialog as 'tester' (misterX)
- 0001164: [Tcp/Ip-communication] missing command 'getId' (misterY)
new format: [spaces shown as '_' here]
0001162:___User Interface________no access to config-dialog as 'tester'_____misterX
0001164:(p)Tcp/Ip-communication__missing command 'getId'_______________misterY
The code is implemented in a customized function. Store the following code in a (new) file named ' custom_functions_inc.php' in directory '../mantis/'
I changed the changelog to show it in some kind of table-format. It is formatted with spaces for better readability and allows copy/paste as before. Private bugs are marked with '(p)' and severity is shown with different background-colors.
Example
old format:
- 0001162: [User Interface] no access to config-dialog as 'tester' (misterX)
- 0001164: [Tcp/Ip-communication] missing command 'getId' (misterY)
new format: [spaces shown as '_' here]
0001162:___User Interface________no access to config-dialog as 'tester'_____misterX
0001164:(p)Tcp/Ip-communication__missing command 'getId'_______________misterY
The code is implemented in a customized function. Store the following code in a (new) file named ' custom_functions_inc.php' in directory '../mantis/'
Code: Select all
<?php
# --------------------
# Prints one entry in the changelog.
# This custom function overrides the existing function
#
# * formatted as 'table' with spaces for better readability
# * allows copy/paste of changelog as before, without 'loosing table-format'
# * marks private bugs after bug-id with '(p)'
# * additional background-color to show severity of bug
# colors:
# FEATURE: green
# TRIVIAL, TEXT, TWEAK: floralwhite
# MINOR: yellow
# MAJOR: orange
# CRASH: red
# BLOCK: darker red
#
# example
# old format:
# - 0001162: [User Interface] no access to config-dialog as 'tester' (misterX)
# - 0001164: [Tcp/Ip-communication] missing command 'getId' (misterY)
# new format:
# 0001162: User Interface no access to config-dialog as 'tester' misterX
# 0001164:(p)Tcp/Ip-communication missing command 'getId' misterY
#
function custom_function_override_changelog_print_issue( $p_issue_id )
{
$t_bug = bug_get( $p_issue_id ); # get bug-info
# set background-color based on severity
switch ($t_bug->severity)
{
case FEATURE:
$bgColor = '#CCFFCC'; # green
break;
case TRIVIAL:
case TEXT:
case TWEAK:
$bgColor = '#FFFAF0'; # floralwhite
break;
case MINOR:
$bgColor = '#FFFFCC'; # yellow
break;
case MAJOR:
$bgColor = '#FFCC99'; # orange
break;
case CRASH:
$bgColor = '#FF9999'; # red
break;
case BLOCK:
$bgColor = '#FF6666'; # darker red
break;
}
echo('<div style="background-color: '); echo($bgColor); echo(';">');
echo('<small>'); # use small font
# print bug-id
echo string_get_bug_view_link( $p_issue_id ), ':';
# print view-state (p for private)
if ($t_bug->view_state == VS_PUBLIC)
{
echo('   ');
}
else
{
echo('(p)');
}
# print category (bold)
echo('<b>'); echo($t_bug->category); echo('</b>');
for ($i = strlen($t_bug->category); $i <= 25; $i++) # fillup with spaces (= tab)
{
echo(' ');
}
# print bug-summary
echo(' '); echo(string_display( $t_bug->summary ));
for ($i = strlen($t_bug->summary); $i <= 90; $i++) # fillup with spaces (= tab)
{
echo(' ');
}
# print handler if there is any
if ( $t_bug->handler_id != 0 )
{
echo(' '); echo(prepare_user_name( $t_bug->handler_id ));
}
echo ('</small>');
echo ('</div>');
}
?>