Returns the default customer view for this user, from the
"default_customer_view" user preference, the "cust_main-default_view" config,
-or the hardcoded default, "jumbo" (may change to "basics" in the near future).
+or the hardcoded default, "basics" (formerly "jumbo" prior to 3.0).
=cut
$self->option('default_customer_view')
|| $conf->config('cust_main-default_view')
- || 'jumbo'; #'basics' in 1.9.1?
+ || 'basics'; #s/jumbo/basics/ starting with 3.0
}
+=item spreadsheet_format
+
+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'.
+
+=cut
+
+my %formats = (
+ XLS => {
+ extension => '.xls',
+ class => 'Spreadsheet::WriteExcel',
+ mime_type => 'application/vnd.ms-excel',
+ },
+ XLSX => {
+ extension => '.xlsx',
+ class => 'Excel::Writer::XLSX',
+ mime_type => # it's on wikipedia, it must be true
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
+ }
+);
+
+sub spreadsheet_format {
+ my $self = shift;
+
+ my $f = $self->option('spreadsheet_format')
+ || $conf->config('spreadsheet_format')
+ || 'XLS';
+
+ $formats{$f};
+}
+
=item is_system_user
Returns true if this user has the name of a known system account. These