Beispiel #1
0
 /**
  * Delivers order export files to the browser
  *
  * @author Jonathan Davis
  * @since 1.1
  *
  * @return void
  **/
 public function export_reports()
 {
     if (!current_user_can('shopp_financials') || !current_user_can('shopp_export_orders')) {
         exit;
     }
     add_filter('shopp_reports', array('ShoppAdminReport', 'xreports'));
     $reports = ShoppAdminReport::reports();
     $Report = ShoppAdminReport::load();
     if (!isset($_POST['settings']["{$report}_report_export"])) {
         $_POST['settings']["{$report}_report_export"]['columns'] = array_keys($Report->columns);
         $_POST['settings']["{$report}_report_export"]['headers'] = 'on';
     }
     shopp_set_formsettings();
     // Save workflow setting
     $format = shopp_setting('report_export_format');
     switch ($format) {
         case 'csv':
             new ShoppReportCSVExport($Report);
             break;
         default:
             new ShoppReportTabExport($Report);
     }
     exit;
 }