$t_columns = excel_get_columns(); do { $t_more = true; $t_row_count = count( $result ); for( $i = 0; $i < $t_row_count; $i++ ) { $t_row = $result[$i]; $t_bug = null; if ( is_blank( $f_export ) || in_array( $t_row->id, $f_bug_arr ) ) { echo excel_get_start_row(); foreach ( $t_columns as $t_column ) { if ( column_is_extended( $t_column ) ) { if ( $t_bug === null ) { $t_bug = bug_get( $t_row->id, /* extended = */ true ); } $t_function = 'excel_format_' . $t_column; echo $t_function( $t_bug->$t_column ); } else { $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 { $t_function = 'excel_format_' . $t_column; echo $t_function( $t_row->$t_column ); } }
function get_attachment($bug) { $attachment = array('fallback' => ''); $t_columns = (array) plugin_config_get('columns'); foreach ($t_columns as $t_column) { $title = column_get_title($t_column); $value = $this->format_value($bug, $t_column); if ($title && $value) { $attachment['fallback'] .= $title . ': ' . $value . "\n"; $attachment['fields'][] = array('title' => $title, 'value' => $value, 'short' => !column_is_extended($t_column)); } } return $attachment; }