Mantisbt 2.0 priority as images

General discussion of Mantis.

Moderators: Developer, Contributor

Post Reply
NetVicious
Posts: 2
Joined: 13 Jul 2016, 08:50

Mantisbt 2.0 priority as images

Post by NetVicious »

Hi!

I upgraded from 1.3.5 to 2.0.0 and the priority customization on the config_inc.php seems to not being applied.

This it's what I was using from a long time ago.

Code: Select all

$g_priority_enum_string = '10:priority10,20:priority20,30:priority30,40:priority40,50:priotiry50,60:priority60,70:priority70';
$g_default_bug_priority = 10;

$g_show_priority_text = OFF;
$g_status_icon_arr = array (
  10 => 'priority_low_3.gif',
  20 => 'priority_low_2.gif',
  30 => 'priority_low_1.gif',
  40 => 'priority_normal.gif',
  50 => 'priority_1.gif',
  60 => 'priority_2.gif',
  70 => 'priority_3.gif');
}
HTML Code on older mantisbt-1.3.5 generated by view_all_bug_page.php

Code: Select all

<td class="column-priority">
<img src="http://xxxxx/images/priority_normal.gif" alt="" title="normal">
</td>
HTML code on newer mantisbt-2.0.0 generated by view_all_bug_page.php

Code: Select all

<td class="column-priority">
<i class="fa priority_normal.gif" alt="" title="4 normal"></i>
</td>
Obviously if we don't modify some CSS adding our new classes we won't see nothing on the webpage.

I did a temporal fix adding this on the config/config_inc.php

Code: Select all

$g_css_include_file = 'config/custom.css';
And this it's my custom.css

Code: Select all

i.priority_1\.gif {
        background-image: url('../images/priority_1.gif');
        background-position: center;
        background-repeat: no-repeat;
        width: 14px;
        height: 16px;
}
i.priority_2\.gif {
        background-image: url('../images/priority_2.gif');
        background-position: center;
        background-repeat: no-repeat;
        width: 14px;
        height: 16px;
}
i.priority_3\.gif {
        background-image: url('../images/priority_3.gif');
        background-position: top center;
        background-repeat: no-repeat;
        width: 14px;
        height: 16px;
}
i.priority_normal\.gif {
        background-image: url('../images/priority_normal.gif');
        background-position: center;
        background-repeat: no-repeat;
        width: 14px;
        height: 16px;
}
i.priority_low_1\.gif {
        background-image: url('../images/priority_low_1.gif');
        background-position: center;
        background-repeat: no-repeat;
        width: 14px;
        height: 16px;
}
i.priority_low_2\.gif {
        background-image: url('../images/priority_low_2.gif');
        background-position: center;
        background-repeat: no-repeat;
        width: 14px;
        height: 16px;
}
i.priority_low_3\.gif {
        background-image: url('../images/priority_low_3.gif');
        background-position: top center;
        background-repeat: no-repeat;
        width: 14px;
        height: 16px;
}
This it's how I fixed it temporary, but IMHO the $g_status_icon_arr should work as it did on 1.X versions of mantisBT

Thx for reading and for working hard on MantisBT
atrol
Site Admin
Posts: 8374
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantisbt 2.0 priority as images

Post by atrol »

Status icons are no longer images, but characters from a font which is delivered with MantisBT.
Have a look at config_defaults_inc.php to understand how it works.

Code: Select all

$g_status_icon_arr = array (
	NONE      => '',
	LOW       => 'fa-chevron-down fa-lg green',
	NORMAL    => 'fa-minus fa-lg orange2',
	HIGH      => 'fa-chevron-up fa-lg red',
	URGENT    => 'fa-arrow-up fa-lg red',
	IMMEDIATE => 'fa-exclamation-triangle fa-lg red'
);
You can choose from those icons
http://fontawesome.io/icons/
Please use Search before posting and read the Manual
sansiets
Posts: 1
Joined: 01 Mar 2024, 14:35

Re: Mantisbt 2.0 priority as images

Post by sansiets »

How do I add a own image that should be shown at a certain priority?
atrol
Site Admin
Posts: 8374
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Mantisbt 2.0 priority as images

Post by atrol »

See my note above how to configure.
If this is not what you need, you have to change source code of function icon_get_status_icon in file icon_api.php.
Please use Search before posting and read the Manual
Post Reply