mantisbt:dynamic_enum_custom_fields
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
mantisbt:dynamic_enum_custom_fields [2008/10/29 04:25] – (old revision restored) 127.0.0.1 | mantisbt:dynamic_enum_custom_fields [2009/04/21 03:36] (current) – ckchan | ||
---|---|---|---|
Line 6: | Line 6: | ||
Usually when an enumeration custom field is defined, the possible values are defined as " | Usually when an enumeration custom field is defined, the possible values are defined as " | ||
+ | |||
+ | |||
+ | |||
===== How to do it? ===== | ===== How to do it? ===== | ||
Line 15: | Line 18: | ||
<code php> | <code php> | ||
# -------------------- | # -------------------- | ||
+ | # custom_function_api.php | ||
# Construct an enumeration for all categories for the current project. | # Construct an enumeration for all categories for the current project. | ||
# The enumeration will be empty if current project is ALL PROJECTS. | # The enumeration will be empty if current project is ALL PROJECTS. | ||
# Enumerations format is: " | # Enumerations format is: " | ||
- | # To use this in a custom field type " | + | # To use this in a custom field name " |
function custom_function_override_enum_categories() { | function custom_function_override_enum_categories() { | ||
$t_categories = category_get_all_rows( helper_get_current_project() ); | $t_categories = category_get_all_rows( helper_get_current_project() ); | ||
Line 40: | Line 44: | ||
* The custom function builds on top of the already existing APIs. | * The custom function builds on top of the already existing APIs. | ||
- | To define your own function | + | To define your own function |
<code php> | <code php> | ||
# -------------------- | # -------------------- | ||
- | # To use this in a custom field type "=mine" in the possible values field. | + | # To use this in a custom field name = "mine" in the possible values field. |
function custom_function_override_enum_mine() { | function custom_function_override_enum_mine() { | ||
$t_enum = array(); | $t_enum = array(); |
mantisbt/dynamic_enum_custom_fields.1225268719.txt.gz · Last modified: 2009/04/21 03:30 (external edit)