Changeset 2647 for sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/reimbursement-requests-dashboard.php
- Timestamp:
- 02/26/2016 11:34:08 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/reimbursement-requests-dashboard.php
r2537 r2647 42 42 43 43 $list_table->prepare_items(); 44 $section_explanation = ''; 44 45 45 46 switch ( get_current_section() ) { 46 case ' submitted':47 case 'wcb-pending-approval': 47 48 $section_explanation = 'These requests have been completed by the organizer, and need to be reviewed by a deputy.'; 48 49 break; 49 50 50 case ' info_requested':51 case 'wcb-incomplete': 51 52 $section_explanation = 'These requests have been reviewed by a deputy, and sent back to the organizer because they lacked some required information.'; 52 53 break; 53 54 54 case 'rejected': 55 $section_explanation = 'These requests have been reviewed by a deputy and rejected.'; 56 break; 57 58 case 'in_process': 59 $section_explanation = "These requests have been reviewed by a deputy and payment is pending."; 60 break; 61 62 case 'paid': 55 case 'wcb-cancelled': 56 $section_explanation = 'These requests have been reviewed by a deputy and cancelled/rejected.'; 57 break; 58 59 case 'wcb-approved': 60 $section_explanation = "These requests have been reviewed and approved by a deputy and payment is pending."; 61 break; 62 63 case 'wcb-pending-payment': 64 $section_explanation = 'These requests have been exported to our banking software, pending release.'; 65 break; 66 67 case 'wcb-paid': 63 68 $section_explanation = 'These requests have been paid and closed.'; 64 69 break; … … 90 95 */ 91 96 function get_section_slugs() { 92 $slugs = array_keys( \WordCamp\Budgets\Reimbursement_Requests\get_custom_statuses() ); 93 94 foreach( $slugs as & $slug ) { 95 $slug = str_replace( 'wcbrr_', '', $slug ); 96 } 97 98 return $slugs; 97 return \WordCamp\Budgets\Reimbursement_Requests\get_post_statuses(); 99 98 } 100 99 … … 105 104 */ 106 105 function get_submenu_page_sections() { 107 $statuses = \WordCamp\Budgets\Reimbursement_Requests\get_ custom_statuses();106 $statuses = \WordCamp\Budgets\Reimbursement_Requests\get_post_statuses(); 108 107 $sections = array(); 109 108 $current_section = get_current_section(); 110 109 111 foreach ( $statuses as $status _slug => $status_name) {112 $status _slug = str_replace( 'wcbrr_', '', $status_slug ); // make the URL easier to read110 foreach ( $statuses as $status ) { 111 $status = get_post_status_object( $status ); 113 112 114 113 $classes = 'nav-tab'; 115 if ( $status _slug=== $current_section ) {114 if ( $status->name === $current_section ) { 116 115 $classes .= ' nav-tab-active'; 117 116 } … … 120 119 array( 121 120 'page' => 'reimbursement-requests-dashboard', 122 'section' => $status _slug,121 'section' => $status->name, 123 122 ), 124 123 network_admin_url( 'admin.php' ) 125 124 ); 126 125 127 $sections[ $status _slug] = array(126 $sections[ $status->name ] = array( 128 127 'classes' => $classes, 129 128 'href' => $href, 130 'text' => $status _name,129 'text' => $status->label, 131 130 ); 132 131 } … … 198 197 } 199 198 199 // Back-compat. 200 $back_compat_statuses = array( 201 'wcbrr_submitted' => 'pending-approval', 202 'wcbrr_info_requested' => 'wcb-incomplete', 203 'wcbrr_rejected' => 'wcb-failed', 204 'wcbrr_in_process' => 'pending-payment', 205 'wcbrr_paid' => 'wcb-paid', 206 ); 207 208 // Map old statuses to new statuses. 209 if ( array_key_exists( $request->post_status, $back_compat_statuses ) ) { 210 $request->post_status = $back_compat_statuses[ $request->post_status ]; 211 } 212 200 213 // Drafts, etc aren't displayed in the list table, so there's no reason to index them 201 $ignored_statuses = array( 'auto-draft', ' draft', 'trash' );214 $ignored_statuses = array( 'auto-draft', 'trash' ); 202 215 // todo also `inherit`. should switch to whitelist instead of blacklist 203 216
Note: See TracChangeset
for help on using the changeset viewer.