Procedural File: custom_field_api.php
Source Location: /core/custom_field_api.php
Page Details:
Tags:
Includes:
custom_field_allow_manage_display [line 61]
void custom_field_allow_manage_display(
$p_type, $p_display)
|
|
Parameters
custom_field_cache_array_rows [line 128]
null custom_field_cache_array_rows(
array $p_cf_id_array)
|
|
Cache custom fields contained within an array of field id's
Tags:
Parameters
array |
$p_cf_id_array |
array of custom field id's |
custom_field_cache_row [line 89]
array custom_field_cache_row(
int $p_field_id, [bool $p_trigger_errors = true])
|
|
Cache a custom field row if necessary and return the cached copy If the second parameter is true (default), trigger an error if the field can't be found. If the second parameter is false, return false if the field can't be found.
Tags:
Parameters
int |
$p_field_id |
integer representing custom field id |
bool |
$p_trigger_errors |
indicates whether to trigger an error if the field is not found |
custom_field_clear_cache [line 161]
bool custom_field_clear_cache(
[int $p_field_id = null])
|
|
Clear the custom field cache (or just the given id if specified)
Tags:
Parameters
int |
$p_field_id |
custom field id |
custom_field_create [line 390]
int custom_field_create(
string $p_name)
|
|
create a new custom field with the name $p_name the definition are the default values and can be changes later return the ID of the new definition
Tags:
Parameters
string |
$p_name |
custom field name |
custom_field_database_to_value [line 1288]
mixed custom_field_database_to_value(
mixed $p_value, int $p_type)
|
|
Convert the database-value to value, depending of the type return value for further operation
Tags:
Parameters
mixed |
$p_value |
|
int |
$p_type |
|
custom_field_default_to_value [line 1304]
mixed custom_field_default_to_value(
mixed $p_value, int $p_type)
|
|
Convert the default-value to value depending on the type. For example, in case of date, this would translate 'tomorrow' to tomorrow's date.
Tags:
Parameters
mixed |
$p_value |
|
int |
$p_type |
|
custom_field_delete_all_values [line 747]
bool custom_field_delete_all_values(
int $p_bug_id)
|
|
Delete all custom values associated with the specified bug. return true on success, false on failure To be called from bug_delete().
Tags:
Parameters
custom_field_destroy [line 688]
bool custom_field_destroy(
int $p_field_id)
|
|
Delete the field definition and all associated values and project associations return true on success, false on failure
Tags:
Parameters
int |
$p_field_id |
custom field id |
custom_field_distinct_values [line 1226]
bool|array custom_field_distinct_values(
array $p_field_def, [int $p_project_id = ALL_PROJECTS])
|
|
Get All Possible Values for a Field.
Tags:
Parameters
array |
$p_field_def |
custom field definition |
int |
$p_project_id |
project id |
custom_field_ensure_exists [line 250]
bool custom_field_ensure_exists(
int $p_field_id)
|
|
Check to see whether the field id is defined return true if the field is defined, error otherwise
Tags:
Parameters
int |
$p_field_id |
custom field id |
custom_field_ensure_name_unique [line 295]
bool custom_field_ensure_name_unique(
string $p_name)
|
|
Check to see whether the name is unique return true if the name has not been used, error otherwise
Tags:
Parameters
string |
$p_name |
Custom field name |
custom_field_exists [line 220]
bool custom_field_exists(
int $p_field_id)
|
|
Check to see whether the field id is defined return true if the field is defined, false otherwise
Tags:
Parameters
int |
$p_field_id |
custom field id |
custom_field_get_all_linked_fields [line 1038]
array custom_field_get_all_linked_fields(
int $p_bug_id)
|
|
Gets the custom fields array for the given bug. Array keys are custom field names. Array is sorted by custom field sequence number; Array items are arrays with the next keys: 'type', 'value', 'access_level_r'
Tags:
Parameters
custom_field_get_definition [line 948]
array custom_field_get_definition(
int $p_field_id)
|
|
Return a field definition row for the field or error if the field does not exist
Tags:
Parameters
int |
$p_field_id |
custom field id |
custom_field_get_field [line 960]
string custom_field_get_field(
int $p_field_id, int $p_field_name)
|
|
Return a single database field from a custom field definition row for the field if the database field does not exist, display a warning and return ''
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_field_name |
custom field name |
custom_field_get_ids [line 888]
array custom_field_get_ids(
)
|
|
Return an array all custom field ids sorted by name
Tags:
custom_field_get_id_from_name [line 767]
bool|int custom_field_get_id_from_name(
string $p_field_name, [int $p_truncated_length = null])
|
|
Get the id of the custom field with the specified name. false is returned if no custom field found with the specified name.
Tags:
Parameters
string |
$p_field_name |
custom field name |
int |
$p_truncated_length |
|
custom_field_get_linked_fields [line 1018]
array custom_field_get_linked_fields(
int $p_bug_id, int $p_user_access_level)
|
|
Gets the custom fields array for the given bug readable by specified level. Array keys are custom field names. Array is sorted by custom field sequence number; Array items are arrays with the next keys: 'type', 'value', 'access_level_r'
Tags:
Parameters
int |
$p_bug_id |
bug id |
int |
$p_user_access_level |
Access level |
custom_field_get_linked_ids [line 812]
array custom_field_get_linked_ids(
[int $p_project_id = ALL_PROJECTS])
|
|
Return an array of ids of custom fields bound to the specified project The ids will be sorted based on the sequence number associated with the binding
Tags:
Parameters
int |
$p_project_id |
project id |
custom_field_get_project_ids [line 921]
array custom_field_get_project_ids(
int $p_field_id)
|
|
Return an array of ids of projects related to the specified custom field (the array may be empty)
Tags:
Parameters
int |
$p_field_id |
custom field id |
custom_field_get_sequence [line 1098]
int|bool custom_field_get_sequence(
int $p_field_id, int $p_project_id)
|
|
Gets the sequence number for the specified custom field for the specified project. Returns false in case of error.
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_project_id |
project id |
custom_field_get_value [line 981]
mixed: custom_field_get_value(
int $p_field_id, int $p_bug_id)
|
|
Get the value of a custom field for the given bug
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_bug_id |
bug id |
custom_field_has_read_access [line 312]
bool custom_field_has_read_access(
int $p_field_id, int $p_bug_id, [int $p_user_id = null])
|
|
Return true if the user can read the value of the field for the given bug, false otherwise.
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_bug_id |
bug id |
int |
$p_user_id |
user id |
custom_field_has_read_access_by_project_id [line 335]
bool custom_field_has_read_access_by_project_id(
int $p_field_id, int $p_project_id, [int $p_user_id = null])
|
|
Return true if the user can read the value of the field for the given project, false otherwise.
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_project_id |
bug id |
int |
$p_user_id |
user id |
custom_field_has_write_access [line 377]
bool custom_field_has_write_access(
int $p_field_id, int $p_bug_id, [int $p_user_id = null])
|
|
Return true if the user can modify the value of the field for the given bug, false otherwise.
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_bug_id |
bug id |
int |
$p_user_id |
user id |
custom_field_has_write_access_to_project [line 356]
bool custom_field_has_write_access_to_project(
int $p_field_id, int $p_project_id, [int $p_user_id = null])
|
|
Return true if the user can modify the value of the field for the given project, false otherwise.
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_project_id |
bug id |
int |
$p_user_id |
user id |
custom_field_is_linked [line 184]
bool custom_field_is_linked(
int $p_field_id, int $p_project_id)
|
|
Check to see whether the field is included in the given project return true if the field is included, false otherwise
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_project_id |
project id |
custom_field_is_name_unique [line 269]
bool custom_field_is_name_unique(
string $p_name, [int $p_custom_field_id = null])
|
|
Check to see whether the name is unique return false if a field with the name already exists, true otherwise if an id is specified, then the corresponding record is excluded from the uniqueness test.
Tags:
Parameters
string |
$p_name |
custom field name |
int |
$p_custom_field_id |
custom field id |
custom_field_link [line 633]
bool custom_field_link(
int $p_field_id, int $p_project_id)
|
|
Add a custom field to a project return true on success, false on failure or if already added
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_project_id |
project id |
custom_field_prepare_possible_values [line 1209]
string|array custom_field_prepare_possible_values(
string $p_possible_values)
|
|
$p_possible_values: possible values to be pre-processed. If it has enum values, it will be left as is. If it has a method, it will be replaced by the list.
Tags:
Parameters
string |
$p_possible_values |
|
custom_field_set_sequence [line 1380]
bool custom_field_set_sequence(
int $p_field_id, int $p_project_id, int $p_sequence)
|
|
Sets the sequence number for the specified custom field for the specified project.
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_project_id |
project id |
int |
$p_sequence |
|
custom_field_set_value [line 1324]
bool custom_field_set_value(
int $p_field_id, int $p_bug_id, mixed $p_value, [ $p_log_insert = true], boolean $p_log)
|
|
Set the value of a custom field for a given bug return true on success, false on failure
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_bug_id |
bug id |
mixed |
$p_value |
|
boolean |
$p_log |
create history logs for new values |
|
$p_log_insert |
|
custom_field_type [line 234]
int custom_field_type(
int $p_field_id)
|
|
Return the type of a custom field if it exists.
Tags:
Parameters
int |
$p_field_id |
custom field id |
custom_field_unlink [line 667]
bool custom_field_unlink(
int $p_field_id, int $p_project_id)
|
|
Remove a custom field from a project return true on success, false on failure The values for the custom fields are not deleted. This is to allow for the case where a bug is moved to another project that has the field, or the field is linked again to the project.
Tags:
Parameters
int |
$p_field_id |
custom field id |
int |
$p_project_id |
project id |
custom_field_unlink_all [line 725]
bool custom_field_unlink_all(
int $p_project_id)
|
|
Delete all associations of custom fields to the specified project return true on success, false on failure To be called from within project_delete().
Tags:
Parameters
int |
$p_project_id |
project id |
custom_field_update [line 423]
bool custom_field_update(
int $p_field_id, array $p_def_array)
|
|
Update the field definition return true on success, false on failure
Tags:
Parameters
int |
$p_field_id |
custom field id |
array |
$p_def_array |
custom field definition |
custom_field_validate [line 1126]
bool custom_field_validate(
int $p_field_id, string $p_value)
|
|
Allows the validation of a custom field value without setting it or needing a bug to exist.
Tags:
Parameters
int |
$p_field_id |
custom field id |
string |
$p_value |
custom field value |
custom_field_value_to_database [line 1272]
mixed custom_field_value_to_database(
mixed $p_value, int $p_type)
|
|
Convert the value to save it into the database, depending of the type return value for database
Tags:
Parameters
mixed |
$p_value |
|
int |
$p_type |
|
print_custom_field_input [line 1408]
void print_custom_field_input(
array $p_field_def, [int $p_bug_id = null])
|
|
Print an input field $p_field_def contains the definition of the custom field (including it's field id $p_bug_id contains the bug where this field belongs to. If it's left away, it'll default to 0 and thus belongs to a new (i.e. non-existant) bug NOTE: This probably belongs in the print_api.php
Tags:
Parameters
array |
$p_field_def |
custom field definition |
int |
$p_bug_id |
bug id |
print_custom_field_value [line 1463]
null print_custom_field_value(
array $p_def, int $p_field_id, int $p_bug_id)
|
|
Print a custom field value for display NOTE: This probably belongs in the print_api.php
Tags:
Parameters
array |
$p_def |
contains the definition of the custom field |
int |
$p_field_id |
contains the id of the field |
int |
$p_bug_id |
contains the bug id to display the custom field value for |
string_custom_field_value [line 1442]
string string_custom_field_value(
array $p_def, int $p_field_id, int $p_bug_id)
|
|
Prepare a string containing a custom field value for display
Tags:
Parameters
array |
$p_def |
contains the definition of the custom field |
int |
$p_field_id |
contains the id of the field |
int |
$p_bug_id |
contains the bug id to display the custom field value for |
string_custom_field_value_for_email [line 1475]
string string_custom_field_value_for_email(
string $p_value, int $p_type)
|
|
Prepare a string containing a custom field value for email NOTE: This probably belongs in the string_api.php
Tags:
Parameters
string |
$p_value |
value of custom field |
int |
$p_type |
type of custom field |
|