Making WordPress.org

Changeset 2705


Ignore:
Timestamp:
03/08/2016 01:46:55 PM (9 years ago)
Author:
kovshenin
Message:

WordCamp Budgets: Add a paid_date field to reimbursement requests.

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

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/reimbursement-request.php

    r2683 r2705  
    322322    $selected_reason   = get_post_meta( $post->ID, '_wcbrr_reason',         true );
    323323    $other_reason      = get_post_meta( $post->ID, '_wcbrr_reason_other',   true );
     324    $date_paid         = get_post_meta( $post->ID, '_wcbrr_date_paid',      true );
    324325
    325326    if ( empty ( $name_of_payer ) ) {
     
    453454        validate_and_save_text_fields( $post_id, $text_fields, $_POST );
    454455
     456        // Save payment date
     457        if ( isset( $_POST['_wcbrr_date_paid'] ) && current_user_can( 'manage_network' ) ) {
     458            $date_paid = sanitize_text_field( $_POST['_wcbrr_date_paid'] );
     459            $date_paid = absint( strtotime( $date_paid ) );
     460            update_post_meta( $post->ID, '_wcbrr_date_paid', $date_paid );
     461        }
     462
    455463        \WordCamp_Budgets::validate_save_payment_method_fields( $post_id, 'wcbrr' );
    456464
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/reimbursement-request/metabox-general-information.php

    r2683 r2705  
    8585
    8686        <li>
     87            <label for="_wcbrr_date_paid">
     88                <?php _e( 'Payment Release Date:', 'wordcamporg' ); ?>
     89            </label>
     90
     91            <?php if ( $date_paid ) $date_paid = date( 'Y-m-d', $date_paid ); ?>
     92            <input type="date" class="regular-text" id="_wcbrr_date_paid" name="_wcbrr_date_paid"
     93                <?php if ( ! current_user_can( 'manage_network' ) ) : ?>readonly<?php endif; ?>
     94                value="<?php echo esc_attr( $date_paid ); ?>" />
     95
     96        <li>
    8797            <label for="_wcbrr_files">
    8898                <?php _e( 'Files:', 'wordcamporg' ); ?>
Note: See TracChangeset for help on using the changeset viewer.