Piority field colorised

Post about your customizations to share with others.

Moderators: Developer, Contributor

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

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 2640 times

cas
Posts: 740
Joined: Mar 11, 2006 11:08 am
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: May 17, 2019 2:08 am

Re: Piority field colorised

Post by fabihu »

Hello!
Do you have any idea how to start?

Thanks!

cas
Posts: 740
Joined: Mar 11, 2006 11:08 am
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: May 17, 2019 2:08 am

Re: Piority field colorised

Post by fabihu »

I'm using version 2.8.0.
Thank you for your advice!

cas
Posts: 740
Joined: Mar 11, 2006 11:08 am
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: 180
Joined: Feb 13, 2006 9:53 pm
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: May 17, 2019 2:08 am

Re: Piority field colorised

Post by fabihu »

cas wrote:
May 22, 2019 8:34 am
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: May 17, 2019 2:08 am

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