I'd like to set the priority field to red if the value = urgent. How can I solve this?
Thanks
Piority field colorised
Moderators: Developer, Contributor
Piority field colorised
- Attachments
-
- mantis.PNG (25.21 KiB) Viewed 10140 times
Re: Piority field colorised
sounds like creating a plugin or a manual adjust of the source code.....
Re: Piority field colorised
Hello!
Do you have any idea how to start?
Thanks!
Do you have any idea how to start?
Thanks!
Re: Piority field colorised
which version of mantis are you using?
Thn I can give you some advice about adjusting the code.
On the matis documentation centre there is informartion on creating a plugin.
Thn I can give you some advice about adjusting the code.
On the matis documentation centre there is informartion on creating a plugin.
Re: Piority field colorised
I'm using version 2.8.0.
Thank you for your advice!
Thank you for your advice!
Re: Piority field colorised
as a very quick & dirty solution, open up bug_view_inc.php and find the line
Replace that line with
In case 'priority' is urgent, you should get a red background.
Now to my knowledge "bgcolor" will be phased out so keep that in mind.
On top of that, this change needs to be made after each upgrade.
Code: Select all
echo '<td class="bug-priority">', $t_priority, '</td>';
Code: Select all
if( $t_bug->category_id == 50 ){
echo '<td bgcolor="red" class="bug-priority">', $t_priority, '</td>';
} else {
echo '<td class="bug-priority">', $t_priority, '</td>';
}
Now to my knowledge "bgcolor" will be phased out so keep that in mind.
On top of that, this change needs to be made after each upgrade.
Re: Piority field colorised
This request got me thinking about a more global solution to this kind of customization.
Please see this proposal for a plugin and a new event type.
Please see this proposal for a plugin and a new event type.
If you want Mantis to work differently, use or create a plugin. Visit the Plugins forums.
Ask developers to create a plugin that you need - and motivate them to help you!
Ask developers to create a plugin that you need - and motivate them to help you!
Re: Piority field colorised
Now I managed to deal with it again.cas wrote: ↑22 May 2019, 13:34 as a very quick & dirty solution, open up bug_view_inc.php and find the lineReplace that line withCode: Select all
echo '<td class="bug-priority">', $t_priority, '</td>';
In case 'priority' is urgent, you should get a red background.Code: Select all
if( $t_bug->category_id == 50 ){ echo '<td bgcolor="red" class="bug-priority">', $t_priority, '</td>'; } else { echo '<td class="bug-priority">', $t_priority, '</td>'; }
Now to my knowledge "bgcolor" will be phased out so keep that in mind.
On top of that, this change needs to be made after each upgrade.
Thanks for your help, but unfortunately it doesn't work for some reason ...
Re: Piority field colorised
I tried the category_id == 50 to rewrite $priority_enum_string == 50
but unfortunately it doesn't work
but unfortunately it doesn't work