Changeset 2615
- Timestamp:
- 02/25/2016 07:02:13 PM (11 years ago)
- Location:
- sites/branches/wcb-payment-request-statuses/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
css/wordcamp-budgets.css (modified) (1 diff)
-
includes/payment-request.php (modified) (5 diffs)
-
views/payment-request/metabox-status.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/branches/wcb-payment-request-statuses/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments
- Property svn:mergeinfo changed (with no actual effect on merging)
-
sites/branches/wcb-payment-request-statuses/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/css/wordcamp-budgets.css
r2610 r2615 12 12 #submitpost.wcb .misc-pub-section input { 13 13 width: 100%; 14 } 15 16 #submitpost.wcb .misc-pub-section select { 17 font-weight: normal; 18 } 19 20 #wcb-save-draft { 21 float: left; 14 22 } 15 23 -
sites/branches/wcb-payment-request-statuses/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/payment-request.php
r2609 r2615 23 23 24 24 // Saving posts 25 add_filter( 'wp_insert_post_data', array( $this, ' ensure_post_date_gmt_set' ), 10, 2 );25 add_filter( 'wp_insert_post_data', array( $this, 'wp_insert_post_data' ), 10, 2 ); 26 26 add_action( 'save_post', array( $this, 'save_payment' ), 10, 2 ); 27 27 add_filter( 'map_meta_cap', array( $this, 'modify_capabilities' ), 10, 4 ); … … 288 288 } 289 289 290 $submit_text = 'auto-draft' == $post->post_status ? __( 'Submit', 'wordcamporg' ) : __( 'Update', 'wordcamporg' );291 290 $editable_statuses = array( 'auto-draft', 'draft', 'wcb-incomplete' ); 292 $current_user_can_edit_request = in_array( $post->post_status, $editable_statuses ) || current_user_can( 'manage_network' ); 291 $current_user_can_edit_request = false; 292 $submit_text = _x( 'Update', 'payment request', 'wordcamporg' ); 293 294 if ( current_user_can( 'manage_network' ) ) { 295 $current_user_can_edit_request = true; 296 } elseif ( in_array( $post->post_status, $editable_statuses ) ) { 297 $submit_text = __( 'Submit for Review', 'wordcamporg' ); 298 $current_user_can_edit_request = true; 299 } 293 300 294 301 $date_vendor_paid = get_post_meta( $post->ID, '_camppayments_date_vendor_paid', true ); … … 300 307 301 308 $incomplete_notes = get_post_meta( $post->ID, '_wcp_incomplete_notes', true ); 309 $incomplete_readonly = ! current_user_can( 'manage_network' ) ? 'readonly' : ''; 310 302 311 require_once( dirname( __DIR__ ) . '/views/payment-request/metabox-status.php' ); 303 312 } … … 585 594 586 595 /** 587 * Ensure that new posts have the `post_date_gmt` field populated.588 *589 * Core only handles this for post types that use the `draft` status (see r8636).590 596 * 591 597 * @param array $post_data … … 594 600 * @return array 595 601 */ 596 public function ensure_post_date_gmt_set( $post_data, $post_data_raw ) { 602 public function wp_insert_post_data( $post_data, $post_data_raw ) { 603 if ( $post_data['post_type'] != self::POST_TYPE ) 604 return $post_data; 605 606 // Ensure that new posts have the `post_date_gmt` field populated. 597 607 if ( 'auto-draft' !== $post_data['post_status'] ) { 598 608 if ( '0000-00-00 00:00:00' === $post_data['post_date_gmt'] ) { 599 609 $post_data['post_date_gmt'] = get_gmt_from_date( $post_data['post_date'] ); 610 } 611 } 612 613 // Save Draft button was clicked. 614 if ( ! empty( $post_data_raw['wcb-save-draft'] ) ) { 615 $post_data['post_status'] = 'draft'; 616 } 617 618 // Submit for Review button was clicked. 619 if ( ! current_user_can( 'manage_network' ) ) { 620 $editable_statuses = array( 'auto-draft', 'draft', 'wcb-incomplete' ); 621 if ( ! empty( $post_data_raw['wcb-update'] ) && in_array( $post_data['post_status'], $editable_statuses ) ) { 622 $post_data['post_status'] = 'wcb-pending-approval'; 600 623 } 601 624 } -
sites/branches/wcb-payment-request-statuses/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/views/payment-request/metabox-status.php
r2604 r2615 1 1 <div id="submitpost" class="wcb submitbox"> 2 2 <div id="minor-publishing"> 3 4 <?php if ( $current_user_can_edit_request && ! current_user_can( 'manage_network' ) ) : ?> 5 <div id="minor-publishing-actions"> 6 <div id="save-action"> 7 <?php submit_button( __( 'Save Draft', 'wordcamporg' ), 'button', 'wcb-save-draft', false ); ?> 8 <span class="spinner"></span> 9 </div> 10 <div class="clear"></div> 11 </div> 12 <?php endif; ?> 13 3 14 <div id="misc-publishing-actions"> 4 5 15 <div class="misc-pub-section"> 6 16 <?php _e( 'ID:', 'wordcamporg' ); ?> … … 17 27 </div> 18 28 29 <?php if ( $post->post_status != 'auto-draft' ) : ?> 19 30 <div class="misc-pub-section"> 20 31 <?php $this->render_text_input( $post, 'Date Vendor was Paid', 'date_vendor_paid', '', 'date', array(), $date_vendor_paid_readonly ); ?> … … 41 52 <?php $status = get_post_status_object( $post->post_status ); ?> 42 53 <?php echo esc_html( $status->label ); ?> 54 <input type="hidden" name="post_status" value="<?php echo esc_attr( $post->post_status ); ?>" /> 43 55 44 56 <?php endif; ?> … … 46 58 </label> 47 59 </div> 60 <?php endif; ?> 48 61 49 62 <div class="misc-pub-section hide-if-js wcb-mark-incomplete-notes"> 50 63 <label for="wcp_mark_incomplete_notes">What information is needed?</label> 51 64 <textarea id="wcp_mark_incomplete_notes" name="wcp_mark_incomplete_notes" class="large-text" rows="5" 52 placeholder="Need to attach receipt, etc" ><?php echo esc_textarea( $incomplete_notes ); ?></textarea>65 placeholder="Need to attach receipt, etc" <?php echo $incomplete_readonly; ?>><?php echo esc_textarea( $incomplete_notes ); ?></textarea> 53 66 </div> 54 67 … … 73 86 <div id="publishing-action"> 74 87 <input name="original_publish" type="hidden" id="original_publish" value="<?php esc_attr( $submit_text ) ?>" /> 75 <?php submit_button( $submit_text, 'primary button-large', ' save', false, array( 'accesskey' => 'p' ) ); ?>88 <?php submit_button( $submit_text, 'primary button-large', 'wcb-update', false, array( 'accesskey' => 'p' ) ); ?> 76 89 </div> 77 90 … … 80 93 <?php else : ?> 81 94 82 < p><?php _e( 'Paid requests are closed and cannot be edited.', 'wordcamporg' ); ?></p>95 <?php _e( 'This request can not be edited.', 'wordcamporg' ); ?> 83 96 84 97 <?php endif; ?>
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)