Page 1 of 1

Mantisbt 2.0 priority as images

Posted: 09 Jan 2017, 12:01
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

Re: Mantisbt 2.0 priority as images

Posted: 09 Jan 2017, 13:57
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/

Re: Mantisbt 2.0 priority as images

Posted: 01 Mar 2024, 14:37
by sansiets
How do I add a own image that should be shown at a certain priority?

Re: Mantisbt 2.0 priority as images

Posted: 01 Mar 2024, 15:10
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.