diff options
| author | Mark Wells <mark@freeside.biz> | 2012-07-13 16:55:24 -0700 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2012-07-13 16:55:24 -0700 |
| commit | 1baa2c61623bab583557554996d43551f784307e (patch) | |
| tree | 49c9e104452f306b8451c8176a07cbc77e6a80f1 /FS | |
| parent | 8ce2c1f11378b22966ec536f11898b4708a40237 (diff) | |
support XLSX in other places, #17971
Diffstat (limited to 'FS')
| -rw-r--r-- | FS/FS/access_user.pm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/FS/FS/access_user.pm b/FS/FS/access_user.pm index 4d72c2ee7..509cc0950 100644 --- a/FS/FS/access_user.pm +++ b/FS/FS/access_user.pm @@ -511,14 +511,16 @@ sub default_customer_view { } -=item spreadsheet_format +=item spreadsheet_format [ OVERRIDE ] Returns a hashref of this user's Excel spreadsheet download settings: 'extension' (xls or xlsx), 'class' (Spreadsheet::WriteExcel or -Excel::Writer::XLSX), and 'mime_type'. +Excel::Writer::XLSX), and 'mime_type'. If OVERRIDE is 'XLS' or 'XLSX', +use that instead of the user's setting. =cut +# is there a better place to put this? my %formats = ( XLS => { extension => '.xls', @@ -535,10 +537,12 @@ my %formats = ( sub spreadsheet_format { my $self = shift; + my $override = shift; - my $f = $self->option('spreadsheet_format') - || $conf->config('spreadsheet_format') - || 'XLS'; + my $f = $override + || $self->option('spreadsheet_format') + || $conf->config('spreadsheet_format') + || 'XLS'; $formats{$f}; } |
