I added a custom column in Mantis 1.0.3 by adding a $t_columns[] = 'custom_[CUSTOM FIELD NAME]'; to the custom_function_default_get_columns_to_view function in the core/custom_function_api.php file. This works great, but I only want this column to show up in one project.
Does anyone know how to do this?
Thanks in Advance!
Abram
View Bugs: How to add column for current project only
Moderators: Developer, Contributor
You should not change the core/custom_functions_api.php you can override such function by creating custom_functions_inc.php and defining custom_function_override_default_get_columns_to_view(). In the implementation of this method you can check for the current project and based on that decide what columns to add.
See custom functions in the manual for more details:
http://manual.mantisbt.org/manual.custo ... ctions.php
In Mantis 1.1, the columns to view will be controlled via the configuration and the configuration will be editable via the web interface. This will allow you to define the columns in general, per user, per project, or per user+project.
Regards,
Victor
http://www.futureware.biz/mantisconnect/
See custom functions in the manual for more details:
http://manual.mantisbt.org/manual.custo ... ctions.php
In Mantis 1.1, the columns to view will be controlled via the configuration and the configuration will be editable via the web interface. This will allow you to define the columns in general, per user, per project, or per user+project.
Regards,
Victor
http://www.futureware.biz/mantisconnect/
vboctor, Thanks for the clarification on how to create custom functions. What sent me down the wrong path was that the comments on the view bugs manual page said that you add columns by changing the core/custom_functions_api.php file. Anyhow, I’m now using the custom_functions_inc.php now.
Back to my original question. What is the syntax to get the currently selected project? Here is what I’m trying and it is not working.
if ($c_project_id = '2')
{
$t_columns[] = 'custom_field_name';
}
Back to my original question. What is the syntax to get the currently selected project? Here is what I’m trying and it is not working.
if ($c_project_id = '2')
{
$t_columns[] = 'custom_field_name';
}
Following is an example:
Regards,
Victor
http://www.futureware.biz/mantisconnect/
Code: Select all
if ( helper_get_current_project() == 2 )
{
// put your extra columns here for the project with code = 2.
}
Victor
http://www.futureware.biz/mantisconnect/