We have a need to add a couple of fields to the project definition page. We feel it would be best not to hack the core code. Better to add a new feature similar to the custom fields for issues.
Is there support for this in MantisBT?
Has anyone discussed adding "custom fields" to the project definition page?
Adding custom fields to project page
Moderators: Developer, Contributor
Re: Adding custom fields to project page
That is currently not available, you would need a plugin for that ( not sure if one already exists). There is an event available within the project script.
Re: Adding custom fields to project page
It has been a while since I poked around in the code. I leave that to Andy mostly. However, I want to outline this idea before handing off.
I checked out the files at github that contain the word "proj" and "project" but came up no smarter than when I started.
I would be grateful for a hint of where to look.
I checked out the files at github that contain the word "proj" and "project" but came up no smarter than when I started.
I would be grateful for a hint of where to look.
Re: Adding custom fields to project page
Not sure what fields you would like to add but have a look here:
https://github.com/vincentsels/ProjectManagement
Now this plugin is pretty old and not suitable for version 2x but at least gives you an idea
https://github.com/vincentsels/ProjectManagement
Now this plugin is pretty old and not suitable for version 2x but at least gives you an idea
Re: Adding custom fields to project page
Thanks. At first glance, that plugin is bit more than what I have in mind. I will download the code and have a look at it.
I was trying find the "event" that might trigger the building of the project page under management. Is there a document that offers insight into the MantisBT architecture?
I was trying find the "event" that might trigger the building of the project page under management. Is there a document that offers insight into the MantisBT architecture?
Re: Adding custom fields to project page
Events are simply places in the code where custom plugin code will be called. There is a wiki on the plug-in functionality
Re: Adding custom fields to project page
Found it in developer documentation. Thank you!
Re: Adding custom fields to project page
We use the default custom_fields for this.
However, there is indeed no built-in way to have MantisBT add these custom_fields by default when you create a new project. Which I don't understand, at least project should inherit custom_fields from their parents, but hey.
You can add below code in 'manage_create_proj.php', after the if( 0 != $f_parent_id ) clause, before the first event_signal, for every custom_field you want to use by default when creating new projects:
/* id = 1: custom field named f.e. 'environment' */
custom_field_link( 1, $t_project_id );
custom_field_set_sequence( 1, $t_project_id, 0 );
However, there is indeed no built-in way to have MantisBT add these custom_fields by default when you create a new project. Which I don't understand, at least project should inherit custom_fields from their parents, but hey.
You can add below code in 'manage_create_proj.php', after the if( 0 != $f_parent_id ) clause, before the first event_signal, for every custom_field you want to use by default when creating new projects:
/* id = 1: custom field named f.e. 'environment' */
custom_field_link( 1, $t_project_id );
custom_field_set_sequence( 1, $t_project_id, 0 );