How to show "Severity" of issue in changelog?

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
mishutka
Posts: 3
Joined: 02 Oct 2006, 06:02
Contact:

How to show "Severity" of issue in changelog?

Post by mishutka »

Is there any way to show "Severity" of an issue in changelog page?

We want to get something like this:
- 040: [Interface][feature] Allow to user to re-enter registrtion key if old one has not been expired yet. (MiSHuTka)

Thank you in advance.
mishutka
Posts: 3
Joined: 02 Oct 2006, 06:02
Contact:

Solution

Post by mishutka »

This was solved by adding something like the following to custom_functions_inc.php

Code: Select all

function custom_function_override_changelog_print_issue( $p_issue_id )
{
    $t_bug = bug_get( $p_issue_id );
    echo '#', string_get_bug_view_link( $p_issue_id ), ' <b>[', get_enum_element( 'severity', $t_bug->severity ),
         '][', $t_bug->category, ']</b> ',
         string_attribute( $t_bug->summary );

    if ( $t_bug->handler_id != 0 )
    {
      echo ' (<b>', prepare_user_name( $t_bug->handler_id ), '</b>)';
    }

    echo '<br />';
	}
Thanks to Victor for pushing me in right way. :)
Last edited by mishutka on 02 Oct 2006, 08:33, edited 1 time in total.
mishutka
Posts: 3
Joined: 02 Oct 2006, 06:02
Contact:

Even more customized output

Post by mishutka »

That is my final solution :)

Code: Select all

function custom_function_override_changelog_print_issue( $p_issue_id )
{
	$t_bug = bug_get( $p_issue_id );

	$sCategory = ' <b>[' . $t_bug->category . '][' . get_enum_element('severity', $t_bug->severity)
	             . '-' . get_enum_element('priority', $t_bug->priority) . ']</b> ';
	if($t_bug->severity == MAJOR || $t_bug->prority > NORMAL)
		$sCategory = "<font color=\"Red\">$sCategory</font>";

  echo '#', string_get_bug_view_link( $p_issue_id ), $sCategory, string_attribute( $t_bug->summary );

  if ( $t_bug->handler_id != 0 )
  {
    echo ' <font color="Blue">(', prepare_user_name( $t_bug->handler_id ), ')</font>';
  }

  echo '<br />';
}
Output example:
#040 [Interface][feature-high] Allow user to re-enter registrtion key if old one has not been expired yet. (MiSHuTka)
#041 [Interface][tweak-normal] Something with lower priority. (MiSHuTka)
q_back
Posts: 1
Joined: 03 Oct 2006, 00:03
Location: Antalya
Contact:

Post by q_back »

how can i change me nick on this forum you guys?:)
[size=0]
Bedroom Boy Hot Wheels[/size]
biitli
Posts: 2
Joined: 13 Jun 2007, 10:12
Location: Switzerland

Severity as background-color

Post by biitli »

Hi,
we enhanced mantis-changelog to show the severity of a bug as background-color:
* FEATURE: green
* TRIVIAL, TEXT, TWEAK: floralwhite
* MINOR: yellow
* MAJOR: orange
* CRASH: red
* BLOCK: darker red

see post 3221: http://www.mantisbt.org/forums/viewtopic.php?t=3221
Post Reply