Making WordPress.org

Changeset 2576


Ignore:
Timestamp:
02/24/2016 07:23:47 PM (8 years ago)
Author:
kovshenin
Message:

WordCamp.org: Use different file names for different export types.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/payment-requests-dashboard.php

    r2553 r2576  
    275275                'label' => 'Default',
    276276                'mime_type' => 'text/csv',
    277                 'ext' => 'csv',
    278277                'callback' => array( __CLASS__, '_generate_payment_report_default' ),
     278                'filename' => 'wordcamp-payments-%s-%s-default.csv',
    279279            ),
    280280            'jpm_wires' => array(
    281281                'label' => 'JP Morgan Access - Wire Payments',
    282282                'mime_type' => 'text/csv',
    283                 'ext' => 'csv',
    284283                'callback' => array( __CLASS__, '_generate_payment_report_jpm_wires' ),
     284                'filename' => 'wordcamp-payments-%s-%s-jpm-wires.csv',
    285285            ),
    286286            'jpm_ach' => array(
    287287                'label' => 'JP Morgan - NACHA',
    288288                'mime_type' => 'text/plain',
    289                 'ext' => 'ach',
    290289                'callback' => array( __CLASS__, '_generate_payment_report_jpm_ach' ),
     290                'filename' => 'wordcamp-payments-%s-%s-jpm-ach.ach',
    291291            ),
    292292            'jpm_checks' => array(
    293293                'label' => 'JP Morgan - Quick Checks',
    294294                'mime_type' => 'text/csv',
    295                 'ext' => 'csv',
    296295                'callback' => array( __CLASS__, '_generate_payment_report_jpm_checks' ),
     296                'filename' => 'wordcamp-payments-%s-%s-jpm-checks.csv',
    297297            ),
    298298        );
     
    321321        $start_date = strtotime( $_POST['wcpn_export_start_date'] . ' 00:00:00' );
    322322        $end_date   = strtotime( $_POST['wcpn_export_end_date']   . ' 23:59:59' );
    323         $filename   = sanitize_file_name( sprintf( 'wordcamp-payments-%s-to-%s.%s',
    324             date( 'Y-m-d', $start_date ), date( 'Y-m-d', $end_date ), $export_type['ext'] ) );
     323        $filename = sprintf( $export_type['filename'], date( 'Ymd', $start_date ), date( 'Ymd', $end_date ) );
     324        $filename = sanitize_file_name( $filename );
    325325
    326326        $report = self::generate_payment_report( $_POST['wcpn_date_type'], $start_date, $end_date, $export_type );
Note: See TracChangeset for help on using the changeset viewer.