Making WordPress.org


Ignore:
Timestamp:
02/25/2016 07:34:11 PM (10 years ago)
Author:
kovshenin
Message:

WordCamp.org: Add new payment requests statuses/flow to the network dashboard.

Location:
sites/branches/wcb-payment-request-statuses/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/branches/wcb-payment-request-statuses/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network

  • sites/branches/wcb-payment-request-statuses/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/payment-requests-dashboard.php

    r2597 r2617  
    9999            while ( $requests = get_posts( array(
    100100                'paged' => $paged++,
    101                 'post_status' => array( 'paid', 'unpaid', 'incomplete' ),
     101                'post_status' => 'any',
    102102                'post_type' => 'wcp_payment_request',
    103103                'posts_per_page' => 20,
     
    140140        if ( ! empty( $amount) ) {
    141141            $keywords[] = $amount;
     142        }
     143
     144        $back_compat_statuses = array(
     145            'unpaid' => 'draft',
     146            'incomplete' => 'wcb-incomplete',
     147            'paid' => 'wcb-paid',
     148        );
     149
     150        // Map old statuses to new statuses.
     151        if ( array_key_exists( $request->post_status, $back_compat_statuses ) ) {
     152            $request->post_status = $back_compat_statuses[ $request->post_status ];
    142153        }
    143154
     
    12301241        $tab = 'overdue';
    12311242        $tabs = array(
    1232             'pending',
    12331243            'overdue',
     1244
     1245            'pending-approval',
     1246            'approved',
     1247            'pending-payment',
    12341248            'paid',
     1249            'cancelled-failed',
    12351250            'incomplete',
     1251
    12361252            'export',
    12371253            'import',
     
    12511267        $current_section = self::get_current_tab();
    12521268        $sections = array(
    1253             'overdue' => 'Overdue',
    1254             'pending' => 'Pending',
    1255             'paid'    => 'Paid',
    1256             'incomplete' => __( 'Incomplete', 'wordcamporg' ),
    1257             'export'     => __( 'Export', 'wordcamporg' ),
    1258             'import'     => __( 'Import', 'wordcamporg' ),
     1269            'overdue'          => __( 'Overdue', 'wordcamporg' ), // pending-approval + after due date
     1270            'pending-approval' => __( 'Pending Approval', 'wordcamporg' ),
     1271            'approved'         => __( 'Approved', 'wordcamporg' ),
     1272            'pending-payment'  => __( 'Pending Payment', 'wordcamporg' ),
     1273            'paid'             => __( 'Paid', 'wordcamporg' ),
     1274            'cancelled-failed' => __( 'Cancelled/Failed', 'wordcamporg' ),
     1275            'incomplete'       => __( 'Incomplete', 'wordcamporg' ),
     1276            'export'           => __( 'Export', 'wordcamporg' ),
     1277            'import'           => __( 'Import', 'wordcamporg' ),
    12591278        );
    12601279
Note: See TracChangeset for help on using the changeset viewer.