Changeset 8136 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/reimbursement-request.php
- Timestamp:
- 01/24/2019 02:31:10 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments/includes/reimbursement-request.php
r6718 r8136 6 6 7 7 namespace WordCamp\Budgets\Reimbursement_Requests; 8 defined( 'WPINC' ) or die(); 9 10 use WP_Post; 8 11 use WCP_Encryption; 9 12 use WordCamp\Utilities; 10 11 defined( 'WPINC' ) or die(); 13 use WordCamp_Budgets; 12 14 13 15 const POST_TYPE = 'wcb_reimbursement'; … … 251 253 * submitted yet, or if we've asked for more information. 252 254 * 253 * @param \WP_Post $post255 * @param WP_Post $post 254 256 * 255 257 * @return bool … … 263 265 * Render the Status metabox 264 266 * 265 * @param \WP_Post $post267 * @param WP_Post $post 266 268 */ 267 269 function render_status_metabox( $post ) { … … 286 288 $submit_text = esc_html_x( 'Update', 'payment request', 'wordcamporg' ); 287 289 $submit_note = ''; 290 $submit_note_class = 'warning'; 288 291 289 292 if ( current_user_can( 'manage_network' ) ) { 290 293 $current_user_can_edit_request = true; 291 294 } elseif ( in_array( $post->post_status, $editable_statuses ) ) { 292 $submit_text = esc_html__( 'Submit for Review', 'wordcamporg' ); 293 $submit_note = esc_html__( 'Once submitted for review, this request can not be edited.', 'wordcamporg' ); 295 if ( WordCamp_Budgets::can_submit_request( $post ) ) { 296 $submit_text = __( 'Submit for Review', 'wordcamporg' ); 297 $submit_note = __( 'Once submitted for review, this request cannot be edited.', 'wordcamporg' ); 298 } else { 299 $submit_note = __( 'Please add an invoice or other supporting documentation in the Files section and save the draft.', 'wordcamporg' ); 300 $submit_note_class = 'error'; 301 } 302 294 303 $current_user_can_edit_request = true; 295 304 } … … 300 309 $request_id = get_current_blog_id() . '-' . $post->ID; 301 310 $requested_by = \WordCamp_Budgets::get_requester_name( $post->post_author ); 302 $update_text = current_user_can( 'manage_network' ) ? esc_html__( 'Update Request', 'wordcamporg' ) : esc_html__( 'Send Request', 'wordcamporg' );303 311 304 312 require_once( dirname( __DIR__ ) . '/views/reimbursement-request/metabox-status.php' ); … … 308 316 * Render the Notes metabox 309 317 * 310 * @param \WP_Post $post318 * @param WP_Post $post 311 319 */ 312 320 function render_notes_metabox( $post ) { … … 321 329 * Render General Information Metabox 322 330 * 323 * @param \WP_Post $post331 * @param WP_Post $post 324 332 * 325 333 */ … … 365 373 * Render Expenses Metabox 366 374 * 367 * @param \WP_Post $post375 * @param WP_Post $post 368 376 * 369 377 */ … … 440 448 * 441 449 * @param int $post_id 442 * @param \WP_Post $post450 * @param WP_Post $post 443 451 */ 444 452 function save_request( $post_id, $post ) { … … 465 473 * user_can_edit_request() instead. 466 474 */ 467 $original_post = new \WP_Post( (object) array( 'post_status' => $_POST['original_post_status'] ) );475 $original_post = new WP_Post( (object) array( 'post_status' => $_POST['original_post_status'] ) ); 468 476 469 477 if ( user_can_edit_request( $original_post ) ) { … … 671 679 * Validate and save expense data 672 680 * 673 * @param \WP_Post $post681 * @param WP_Post $post 674 682 * @param array $expenses 675 683 */ … … 716 724 * Notify WordCamp Central or the request author when new notes are added 717 725 * 718 * @param \WP_Post $request726 * @param WP_Post $request 719 727 * @param array $note 720 728 */ … … 762 770 * @param string $new_status 763 771 * @param string $old_status 764 * @param \WP_Post $request772 * @param WP_Post $request 765 773 */ 766 774 function notify_organizer_request_updated( $new_status, $old_status, $request ) {
Note: See TracChangeset
for help on using the changeset viewer.