Page 1 of 1

Manage Dynamic Custom Fields for Projects

Posted: 16 Sep 2011, 13:39
by Ernesto
Hi guru,
I need to create Dynamic Custom Fields values for Projects.
For Example
If have two projects (Project1 and Project2) and I have "Affected Version" as custom field:

Type=Enumeration
Possible Values=-|Alpha1|Alpha2|Beta1|Beta2
Default Value is "-"

If I have to insert a new issue for Project1 one the possible values of "Affected Version" custom field MUST be Alpha1 or Alpha2; if I have to insert a new issue for Projects2 the possible values MUST be Beta1 or Beta2.

I have followed, without success, this suggestion:

http://www.mantisbt.org/forums/viewtopic.php?f=3&t=255

Could you help me?
BR.
Ernesto

Re: Manage Dynamic Custom Fields for Projects

Posted: 16 Sep 2011, 14:29
by Ernesto
I solved my issue.
I have created the custom_functions_inc.php file with success in the following mode:

<?php
function custom_function_override_enum_affected_version() {
$t_project_name = project_get_name( helper_get_current_project() );
switch($t_project_name) {
case "Project1":
$t_possible_values = "Alpha1|Alpha2";
break;
case "Project2":
$t_possible_values = "Beta1|Beta";
break;
default:
$t_possible_values = "Alpha1|Alpha2|Beta1|Beta2";
}
return $t_possible_values;
}
?>:


BR.
Ernesto