Changeset 2609 for sites/branches/wcb-payment-request-statuses/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments
- Timestamp:
- 02/25/2016 01:55:55 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/branches/wcb-payment-request-statuses/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/payment-request.php
r2608 r2609 585 585 586 586 /** 587 * Set the request's status based on whether the vendor has been paid.588 *589 * @param array $post_data590 * @param array $post_data_raw591 * @return array592 */593 public function update_request_status( $post_data, $post_data_raw ) {594 if ( ! WordCamp_Budgets::post_edit_is_actionable( $post_data, self::POST_TYPE ) )595 return $post_data;596 597 // if ( $this->should_mark_request_incomplete() ) {598 // $post_data['post_status'] = 'incomplete';599 // $this->notify_requester_request_incomplete( $post_data_raw['ID'], $post_data, $post_data_raw );600 //601 // update_post_meta( $post_data_raw['ID'], '_wcp_incomplete_notes', sanitize_text_field( $post_data_raw['wcp_mark_incomplete_notes'] ) );602 // } else {603 $previous_status = $post_data['post_status'];604 $valid_paid_date = false !== strtotime( sanitize_text_field( $_POST['date_vendor_paid'] ) );605 // todo realign606 607 608 // if ( 'paid' != $previous_status && 'paid' == $post_data['post_status'] ) {609 // $this->notify_requester_payment_made( $post_data_raw['ID'], $post_data );610 // }611 // }612 613 return $post_data;614 }615 616 /**617 587 * Ensure that new posts have the `post_date_gmt` field populated. 618 588 * … … 637 607 * Notify the payment requester that it has been marked as paid. 638 608 * 639 * @param int $request_id 640 * @param array $post_data 641 */ 642 protected function notify_requester_payment_made( $request_id, $post_data ) { 643 if ( ! $to = WordCamp_Budgets::get_requester_formatted_email( $post_data['post_author'] ) ) { 609 * @param int|WP_Post $post 610 */ 611 protected function notify_requester_payment_made( $post ) { 612 $post = get_post( $post ); 613 614 if ( ! $to = WordCamp_Budgets::get_requester_formatted_email( $post->post_author ) ) { 644 615 return; 645 616 } 646 617 647 $subject = sprintf( ' `%s` has been paid', $post_data['post_title']);618 $subject = sprintf( '"%s" has been paid', $post->post_title ); 648 619 $headers = array( 'Reply-To: support@wordcamp.org' ); 649 620 650 621 $message = sprintf( 651 "The request for `%s`has been marked as paid by WordCamp Central.622 "The request for \"%s\" has been marked as paid by WordCamp Central. 652 623 653 624 You can view the request at: … … 656 627 657 628 If you have any questions, please reply to let us know.", 658 $post _data['post_title'],659 admin_url( sprintf( 'post.php?post=%s&action=edit', $ request_id) )629 $post->post_title, 630 admin_url( sprintf( 'post.php?post=%s&action=edit', $post->ID ) ) 660 631 ); 661 632 $message = str_replace( "\t", '', $message ); … … 743 714 744 715 $this->notify_requester_request_incomplete( $post->ID ); 716 WordCamp_Budgets::log( $post->ID, $user->ID, 'Incomplete notification e-mail sent.', array( 717 'action' => 'incomplete-notification-sent', 718 ) ); 745 719 746 720 } elseif ( $new == 'paid' || $new == 'wcb-paid' ) { … … 748 722 'action' => 'marked-paid', 749 723 ) ); 724 725 $this->notify_requester_payment_made( $post->ID ); 726 WordCamp_Budgets::log( $post->ID, $user->ID, 'Paid notification e-mail sent.', array( 727 'action' => 'paid-notification-sent', 728 ) ); 729 750 730 } elseif ( $old == 'auto-draft' ) { 751 731 WordCamp_Budgets::log( $post->ID, $user->ID, 'Request created', array(
Note:
See TracChangeset
for help on using the changeset viewer.