Changeset 1660
- Timestamp:
- 06/15/2015 06:25:44 PM (11 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network
- Files:
-
- 2 edited
-
includes/class-list-table.php (modified) (3 diffs)
-
wordcamp-payments-network.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/class-list-table.php
r1222 r1660 41 41 42 42 /** 43 * This list table can display multiple views which are44 * essentially just filters. Use this method to set the appropriate view.45 */46 public function set_view( $view ) {47 $this->view = 'overdue';48 if ( in_array( $view, array( 'pending', 'overdue', 'paid' ) ) )49 $this->view = $view;50 }51 52 /**53 43 * Outputs inline CSS to be used with the list table. 54 44 */ … … 74 64 75 65 $sql = sprintf( "SELECT SQL_CALC_FOUND_ROWS blog_id, post_id FROM `%s` WHERE 1=1 ", WordCamp_Payments_Network_Tools::get_table_name() ); 66 $view = WordCamp_Payments_Network_Tools::get_current_tab(); 76 67 $where = ''; 77 68 $orderby = ''; … … 81 72 $order = 'desc'; 82 73 83 if ( 'overdue' == $ this->view ) {74 if ( 'overdue' == $view ) { 84 75 $where .= $wpdb->prepare( " AND `status` = 'unpaid' AND `due` > 0 AND `due` <= %d ", time() ); 85 76 $orderby = 'due'; 86 77 $order = 'asc'; 87 } elseif ( 'pending' == $ this->view ) {78 } elseif ( 'pending' == $view ) { 88 79 $where .= " AND `status` = 'unpaid' "; 89 } elseif ( 'paid' == $ this->view ) {80 } elseif ( 'paid' == $view ) { 90 81 $where .= " AND `status` = 'paid' "; 91 82 } -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/wordcamp-payments-network.php
r1223 r1660 209 209 210 210 self::$list_table = new WordCamp_Payments_Network_List_Table; 211 self::$list_table->set_view( self::get_current_tab() );212 211 } 213 212 … … 216 215 */ 217 216 public static function get_current_tab() { 218 if ( isset( $_REQUEST['wcp-section'] ) ) 219 return strtolower( $_REQUEST['wcp-section'] ); 220 221 return 'overdue'; 217 $tab = 'overdue'; 218 219 if ( isset( $_REQUEST['wcp-section'] ) && in_array( $_REQUEST['wcp-section'], array( 'pending', 'overdue', 'paid' ) ) ) { 220 $tab = $_REQUEST['wcp-section']; 221 } 222 223 return $tab; 222 224 } 223 225
Note: See TracChangeset
for help on using the changeset viewer.