Skip to content

Commit

Permalink
Add function to handle Excel formatting of sponsorship
Browse files Browse the repository at this point in the history
When exporting issues in Excel format a fatal error is thrown if the
export includes sponsorship totals. This is due to a missing
excel_format_sponsorship_total() function.

Fixes #13959
  • Loading branch information
dregad committed Feb 28, 2012
1 parent 1d2a035 commit 4ba2187
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion core/excel_api.php
Expand Up @@ -506,7 +506,7 @@ function excel_format_custom_field( $p_bug ) {
*/
function excel_format_plugin_column_value( $p_column, $p_bug ) {
$t_plugin_columns = columns_get_plugin_columns();

if ( !isset( $t_plugin_columns[$p_column] ) ) {
return excel_prepare_string( '' );
} else {
Expand All @@ -527,6 +527,16 @@ function excel_format_due_date( $p_bug ) {
return excel_prepare_string( date( config_get( 'short_date_format' ), $p_bug->due_date ) );
}

/**
* Gets the sponsorship total for an issue
* @param object $p_bug the bug
* @return string
* @access public
*/
function excel_format_sponsorship_total( $p_bug ) {
return excel_prepare_string( $p_bug->sponsorship_total );
}

/**
* The <tt>ExcelStyle</tt> class is able to render style information
*
Expand Down

0 comments on commit 4ba2187

Please sign in to comment.