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/reimbursement-request/metabox-status.php

    r4967 r8136  
    44defined( 'WPINC' ) or die();
    55
     6/**
     7 * @var \WP_Post $post
     8 * @var bool     $current_user_can_edit_request
     9 * @var string   $request_id
     10 * @var string   $requested_by
     11 * @var string   $incomplete_notes
     12 * @var bool     $incomplete_readonly
     13 * @var string   $submit_text
     14 * @var string   $submit_note
     15 * @var string   $submit_note_class
     16 */
    617?>
    718
     
    8596    </div> <!-- #minor-publishing -->
    8697
    87 
    88     <div id="major-publishing-actions">
    89         <?php if ( $current_user_can_edit_request ) : ?>
    90             <?php if ( !empty( $submit_note ) ) : ?>
    91                 <div><?php echo $submit_note; ?></div>
    92             <?php endif; ?>
    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.