/** * Gets an Xml Row that contains all column titles * @param string $p_style_id The optional style id. * @returns The xml row. */ function excel_get_titles_row($p_style_id = '') { $t_columns = excel_get_columns(); $t_ret = excel_get_start_row($p_style_id); foreach ($t_columns as $t_column) { $t_ret .= excel_format_column_title(column_get_title($t_column)); } $t_ret .= '</Row>'; return $t_ret; }
if ($t_result === false) { print_header_redirect('view_all_set.php?type=0&print=1'); } header('Content-Type: application/vnd.ms-excel; charset=UTF-8'); header('Pragma: public'); header('Content-Disposition: attachment; filename="' . urlencode(file_clean_name($t_export_title)) . '.xml"'); echo excel_get_header($t_export_title); echo excel_get_titles_row(); $f_bug_arr = explode(',', $f_export); $t_columns = excel_get_columns(); do { # pre-cache custom column data columns_plugin_cache_issue_data($t_result); foreach ($t_result as $t_row) { if (is_blank($f_export) || in_array($t_row->id, $f_bug_arr)) { echo excel_get_start_row(); foreach ($t_columns as $t_column) { $t_custom_field = column_get_custom_field_name($t_column); if ($t_custom_field !== null) { echo excel_format_custom_field($t_row->id, $t_row->project_id, $t_custom_field); } else { if (column_is_plugin_column($t_column)) { echo excel_format_plugin_column_value($t_column, $t_row); } else { $t_function = 'excel_format_' . $t_column; echo $t_function($t_row); } } } echo excel_get_end_row(); }
/** * Gets an Xml Row that contains all column titles * @param string $p_style_id The optional style id. * @returns The xml row. */ function excel_get_titles_row( $p_style_id = '') { $t_columns = excel_get_columns(); $t_ret = excel_get_start_row( $p_style_id ); foreach( $t_columns as $t_column ) { $t_custom_field = column_get_custom_field_name( $t_column ); if( $t_custom_field !== null ) { $t_ret .= excel_format_column_title( lang_get_defaulted( $t_custom_field ) ); } else { $t_column_title = column_get_title( $t_column ); $t_ret .= excel_format_column_title( $t_column_title ); } } $t_ret .= '</Row>'; return $t_ret; }