コード例 #1
0
ファイル: excel_api.php プロジェクト: fur81/zofaxiopeu
/**
 * Gets the formatted value for the specified issue id, project and custom field.
 * @param $p_issue_id The issue id.
 * @param $p_project_id The project id.
 * @param $p_custom_field The custom field name (without 'custom_' prefix).
 * @returns The custom field value.
 */
function excel_format_custom_field($p_issue_id, $p_project_id, $p_custom_field)
{
    $t_field_id = custom_field_get_id_from_name($p_custom_field);
    if ($t_field_id === false) {
        return excel_prepare_string('@' . $p_custom_field . '@');
    }
    if (custom_field_is_linked($t_field_id, $p_project_id)) {
        $t_def = custom_field_get_definition($t_field_id);
        return excel_prepare_string(string_custom_field_value($t_def, $t_field_id, $p_issue_id));
    }
    // field is not linked to project
    return excel_prepare_string('');
}
コード例 #2
0
ファイル: custom_field_api.php プロジェクト: hamx0r/mantisbt
/**
 * Print a custom field value for display
 * NOTE: This probably belongs in the print_api.php
 * @param array   $p_def      Contains the definition of the custom field.
 * @param integer $p_field_id Contains the id of the field.
 * @param integer $p_bug_id   Contains the bug id to display the custom field value for.
 * @return void
 * @access public
 */
function print_custom_field_value(array $p_def, $p_field_id, $p_bug_id)
{
    echo string_custom_field_value($p_def, $p_field_id, $p_bug_id);
}
コード例 #3
0
ファイル: excel_api.php プロジェクト: spring/spring-website
/**
 * Gets the formatted value for the specified issue id, project and custom field.
 * @param integer $p_issue_id     The issue id.
 * @param integer $p_project_id   The project id.
 * @param string  $p_custom_field The custom field name (without 'custom_' prefix).
 * @return string The custom field value.
 */
function excel_format_custom_field($p_issue_id, $p_project_id, $p_custom_field)
{
    $t_field_id = custom_field_get_id_from_name($p_custom_field);
    if ($t_field_id === false) {
        return excel_prepare_string('@' . $p_custom_field . '@');
    }
    if (custom_field_is_linked($t_field_id, $p_project_id)) {
        $t_def = custom_field_get_definition($t_field_id);
        if ($t_def['type'] == CUSTOM_FIELD_TYPE_NUMERIC) {
            return excel_prepare_number(string_custom_field_value($t_def, $t_field_id, $p_issue_id));
        }
        return excel_prepare_string(string_custom_field_value($t_def, $t_field_id, $p_issue_id));
    }
    # field is not linked to project
    return excel_prepare_string('');
}