Page 1 of 1
Piority field colorised
Posted: 17 May 2019, 07:22
by fabihu
I'd like to set the priority field to red if the value = urgent. How can I solve this?
Thanks
Re: Piority field colorised
Posted: 17 May 2019, 13:07
by cas
sounds like creating a plugin or a manual adjust of the source code.....
Re: Piority field colorised
Posted: 21 May 2019, 09:41
by fabihu
Hello!
Do you have any idea how to start?
Thanks!
Re: Piority field colorised
Posted: 22 May 2019, 08:29
by cas
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.
Re: Piority field colorised
Posted: 22 May 2019, 09:10
by fabihu
I'm using version 2.8.0.
Thank you for your advice!
Re: Piority field colorised
Posted: 22 May 2019, 13:34
by cas
as a very quick & dirty solution, open up bug_view_inc.php and find the line
Code: Select all
echo '<td class="bug-priority">', $t_priority, '</td>';
Replace that line with
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>';
}
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.
Re: Piority field colorised
Posted: 23 May 2019, 16:01
by Starbuck
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.
Re: Piority field colorised
Posted: 13 Jun 2019, 07:31
by fabihu
cas wrote: ↑22 May 2019, 13:34
as a very quick & dirty solution, open up bug_view_inc.php and find the line
Code: Select all
echo '<td class="bug-priority">', $t_priority, '</td>';
Replace that line with
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>';
}
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.
Now I managed to deal with it again.
Thanks for your help, but unfortunately it doesn't work for some reason ...
Re: Piority field colorised
Posted: 18 Jun 2019, 08:32
by fabihu
I tried the category_id == 50 to rewrite $priority_enum_string == 50
but unfortunately it doesn't work