Making WordPress.org


Ignore:
Timestamp:
02/26/2016 12:56:15 AM (10 years ago)
Author:
kovshenin
Message:

WordCamp.org: Reintegrate branch into trunk (wordcamp-payments-network)

Location:
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network

  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/payment-requests-list-table.php

    r2538 r2632  
    7777
    7878        if ( 'overdue' == $view ) {
    79             $where .= $wpdb->prepare( " AND `status` = 'unpaid' AND `due` > 0 AND `due` <= %d ", time() );
    80         } elseif ( 'pending' == $view ) {
    81             $where .= " AND `status` = 'unpaid' ";
     79            $where .= $wpdb->prepare( " AND `status` = 'wcb-pending-approval' AND `due` > 0 AND `due` <= %d ", time() );
     80        } elseif ( 'pending-approval' == $view ) {
     81            $where .= " AND `status` = 'wcb-pending-approval' ";
     82        } elseif ( 'approved' == $view ) {
     83            $where .= " AND `status` = 'wcb-approved' ";
     84        } elseif ( 'pending-payment' == $view ) {
     85            $where .= " AND `status` = 'wcb-pending-payment' ";
    8286        } elseif ( 'paid' == $view ) {
    83             $where .= " AND `status` = 'paid' ";
    84             $orderby = 'created';
     87            $where .= " AND `status` = 'wcb-paid' ";
     88            $orderby = 'updated';
    8589            $order = 'desc';
    86         } elseif( 'incomplete' == $view ) {
    87             $where .= " AND `status` = 'incomplete' ";
     90        } elseif ( 'incomplete' == $view ) {
     91            $where .= " AND `status` = 'wcb-incomplete' ";
     92        } elseif ( 'cancelled-failed' == $view ) {
     93            $where .= " AND `status` IN ( 'wcb-failed', 'wcb-cancelled' ) ";
    8894        }
    8995
     
    136142     */
    137143    public function column_payment( $request ) {
    138         $title          = empty( $request->post_title ) ? '(no title)' : $request->post_title;
     144        $blog_id = get_current_blog_id();
     145        $title = empty( $request->post_title ) ? '(no title)' : $request->post_title;
    139146        $edit_post_link = add_query_arg( array( 'post' => $request->ID, 'action' => 'edit' ), admin_url( 'post.php' ) );
    140147        $actions = array(
    141148            'view-all' => sprintf( '<a href="%s" target="_blank">View All</a>', esc_url( admin_url( 'edit.php?post_type=wcp_payment_request' ) ) ),
    142149        );
     150
     151        if ( $request->post_status == 'wcb-pending-approval' ) {
     152            $approve_url = wp_nonce_url( add_query_arg( array(
     153                'wcb-approve' => sprintf( '%d-%d', $blog_id, $request->ID ),
     154            ) ), sprintf( 'wcb-approve-%d-%d', $blog_id, $request->ID ) );
     155
     156            $actions['wcb-approve'] = sprintf( '<a style="color: green;" onclick="return confirm(\'Approve this payment request?\');" href="%s">Approve</a>', esc_url( $approve_url ) );
     157        }
    143158
    144159        return sprintf( '<a href="%s" class="row-title" target="_blank">%s</a>%s',
     
    153168     */
    154169    public function column_status( $request ) {
    155         return esc_html( ucwords( $request->post_status ) );
     170        $status = get_post_status_object( $request->post_status );
     171        return esc_html( $status->label );
    156172    }
    157173
Note: See TracChangeset for help on using the changeset viewer.