Making WordPress.org


Ignore:
Timestamp:
01/24/2019 02:31:10 PM (6 years ago)
Author:
coreymckrill
Message:

WordCamp Payments: Prevent submission of requests that have no documentation

For both Payment Requests and Reimbursement Requests:

  • Add a method to check and see if the request post can be submitted. Currently this just checks to see if the post has one or more files attached to it.
  • When the post fails the check, show a note in the Status metabox that documentation must be attached first, and don't render the Submit for Review button.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/payment-request/metabox-status.php

    r4967 r8136  
     1<?php
     2/**
     3 * @var WP_Post             $post
     4 * @var WCP_Payment_Request $this
     5 * @var bool                $current_user_can_edit_request
     6 * @var string              $submit_text
     7 * @var string              $submit_note
     8 * @var string              $submit_note_class
     9 * @var bool                $date_vendor_paid_readonly
     10 * @var string              $incomplete_notes
     11 * @var bool                $incomplete_readonly
     12 */
     13?>
    114<div id="submitpost" class="wcb submitbox">
    215    <div id="minor-publishing">
     
    4053
    4154                            <select id="wcb_status" name="post_status">
    42                                 <?php foreach ( self::get_post_statuses() as $status ) : ?>
     55                                <?php foreach ( WCP_Payment_Request::get_post_statuses() as $status ) : ?>
    4356                                    <?php $status = get_post_status_object( $status ); ?>
    4457                                    <option value="<?php echo esc_attr( $status->name ); ?>" <?php selected( $post->post_status, $status->name ); ?> >
     
    8396    </div> <!-- #minor-publishing -->
    8497
    85 
    86     <div id="major-publishing-actions">
    87         <?php if ( $current_user_can_edit_request ) : ?>
    88 
    89             <?php if ( !empty( $submit_note ) ) : ?>
    90                 <div><?php echo $submit_note; ?></div>
    91             <?php endif; ?>
    92 
    93 
    94             <div id="delete-action">
    95                 <?php if ( current_user_can( 'delete_post', $post->ID ) ) : ?>
    96                     <a class="submitdelete deletion" href="<?php echo get_delete_post_link( $post->ID ); ?>">
    97                         <?php _e( 'Delete', 'wordcamporg' ); ?>
    98                     </a>
    99                 <?php endif; ?>
    100             </div>
    101 
    102             <div id="publishing-action">
    103                 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr( $submit_text ) ?>" />
    104                 <?php submit_button( $submit_text, 'primary button-large', 'wcb-update', false, array( 'accesskey' => 'p' ) ); ?>
    105             </div>
    106 
    107             <div class="clear"></div>
    108 
    109         <?php else : ?>
    110 
    111             <?php _e( 'This request can not be edited.', 'wordcamporg' ); ?>
    112 
    113         <?php endif; ?>
    114     </div> <!-- #major-publishing-actions -->
     98    <?php require dirname( __DIR__ ) . '/wordcamp-budgets/major-publishing-actions.php'; ?>
    11599
    116100</div> <!-- .submitbox -->
Note: See TracChangeset for help on using the changeset viewer.