User Tools

  • Logged in as: anonymous (anonymous)
  • Log Out

Site Tools


mantisbt:dynamic_enum_custom_fields

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
mantisbt:dynamic_enum_custom_fields [2008/10/29 04:25] – (old revision restored) 127.0.0.1mantisbt: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 "A|B|C" (without the quotes). For dynamic possible values, an identifier is specified that specifies to Mantis which custom function to use. The ones that are already defined are "=categories", "=versions", "=future_versions", "=released_versions" (again without the quotes). Usually when an enumeration custom field is defined, the possible values are defined as "A|B|C" (without the quotes). For dynamic possible values, an identifier is specified that specifies to Mantis which custom function to use. The ones that are already defined are "=categories", "=versions", "=future_versions", "=released_versions" (again without the quotes).
 +
 +
 +
  
 ===== 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: "abc|lmn|xyz" # Enumerations format is: "abc|lmn|xyz"
-# To use this in a custom field type "=categories" in the possible values field.+# To use this in a custom field name "=categories" in the possible values field.
 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 "=mine", you will have to define it with the following signature:+To define your own function for custom field (name "mine"), you will have to define it with the following signature:
  
 <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.txt · Last modified: 2009/04/21 03:36 by ckchan

Driven by DokuWiki