Piority field colorised

Post about your customizations to share with others.

Moderators: Developer, Contributor

Post Reply
fabihu
Posts: 5
Joined: 17 May 2019, 07:08

Piority field colorised

Post by fabihu »

I'd like to set the priority field to red if the value = urgent. How can I solve this?
Thanks
Attachments
mantis.PNG
mantis.PNG (25.21 KiB) Viewed 10039 times
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Piority field colorised

Post by cas »

sounds like creating a plugin or a manual adjust of the source code.....
fabihu
Posts: 5
Joined: 17 May 2019, 07:08

Re: Piority field colorised

Post by fabihu »

Hello!
Do you have any idea how to start?

Thanks!
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Piority field colorised

Post 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.
fabihu
Posts: 5
Joined: 17 May 2019, 07:08

Re: Piority field colorised

Post by fabihu »

I'm using version 2.8.0.
Thank you for your advice!
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: Piority field colorised

Post 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.
Starbuck
Posts: 219
Joined: 14 Feb 2006, 02:53
Location: USA
Contact:

Re: Piority field colorised

Post 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.
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!
fabihu
Posts: 5
Joined: 17 May 2019, 07:08

Re: Piority field colorised

Post 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 ...
fabihu
Posts: 5
Joined: 17 May 2019, 07:08

Re: Piority field colorised

Post by fabihu »

I tried the category_id == 50 to rewrite $priority_enum_string == 50
but unfortunately it doesn't work
Post Reply