Exemple #1
0
/**
 * Gets the bug note count for an issue
 * @param BugData $p_bug A bug object.
 * @return string
 * @access public
 */
function excel_format_bugnotes_count(BugData $p_bug)
{
    # grab the bugnote count
    $t_bugnote_stats = bug_get_bugnote_stats($p_bug->id);
    if (null !== $t_bugnote_stats) {
        $t_bugnote_count = $t_bugnote_stats['count'];
    } else {
        $t_bugnote_count = 0;
    }
    return excel_prepare_number($t_bugnote_count);
}
    echo excel_format_column_title(lang_get('username'));
}
echo excel_format_column_title(lang_get('timestamp'));
echo excel_format_column_title(lang_get('minutes'));
echo excel_format_column_title(lang_get('time_tracking_time_spent'));
if ($t_show_cost) {
    echo excel_format_column_title('cost');
}
echo excel_format_column_title('note');
echo '</Row>';
foreach ($t_billing_rows as $t_billing) {
    echo "\n<Row>\n";
    echo excel_prepare_number($t_billing['bug_id']);
    echo excel_prepare_string($t_billing['project_name']);
    echo excel_prepare_string($t_billing['bug_category']);
    echo excel_prepare_string($t_billing['bug_summary']);
    if ($t_show_realname) {
        echo excel_prepare_string($t_billing['reporter_realname']);
    } else {
        echo excel_prepare_string($t_billing['reporter_username']);
    }
    echo excel_prepare_string(date($t_date_format, $t_billing['date_submitted']));
    echo excel_prepare_number($t_billing['minutes']);
    echo excel_prepare_string($t_billing['duration']);
    if ($t_show_cost) {
        echo excel_prepare_string($t_billing['cost']);
    }
    echo excel_prepare_string($t_billing['note']);
    echo "</Row>\n";
}
echo excel_get_footer();
Exemple #3
0
/**
 * 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('');
}