Changeset 2036
- Timestamp:
- 11/03/2015 07:18:51 PM (10 years ago)
- Location:
- sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network
- Files:
-
- 2 edited
-
includes/class-list-table.php (modified) (4 diffs)
-
wordcamp-payments-network.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/includes/class-list-table.php
r2035 r2036 44 44 ?> 45 45 <style> 46 #wcp-list-table .search-box { 47 margin-top: 12px; 48 } 49 46 50 #wcp-list-table .manage-column.column-payment { 47 51 width: 30%; … … 67 71 $limit = ''; 68 72 73 $per_page = 10; 69 74 $orderby = 'due'; 70 75 $order = 'asc'; … … 82 87 } 83 88 89 if ( ! empty( $_REQUEST['s'] ) ) { 90 $where .= $wpdb->prepare( " AND `keywords` LIKE %s ", '%' . $wpdb->esc_like( wp_unslash( $_REQUEST['s'] ) ) . '%' ); 91 } 92 84 93 if ( ! empty( $_REQUEST['orderby'] ) && in_array( $_REQUEST['orderby'], array_values( $this->get_sortable_columns() ) ) ) 85 94 $orderby = $_REQUEST['orderby']; … … 91 100 92 101 $paged = isset( $_REQUEST['paged'] ) ? absint( $_REQUEST['paged'] ) : 1; 93 $per_page = 10;94 102 95 103 $limit .= sprintf( " LIMIT %d OFFSET %d ", $per_page, $per_page * ( $paged - 1 ) ); -
sites/trunk/wordcamp.org/public_html/wp-content/plugins/wordcamp-payments-network/wordcamp-payments-network.php
r2021 r2036 12 12 class WordCamp_Payments_Network_Tools { 13 13 public static $list_table; 14 public static $db_version = 4;14 public static $db_version = 6; 15 15 16 16 /** … … 43 43 public static function get_table_name() { 44 44 global $wpdb; 45 return $wpdb->get_blog_prefix(0) . 'wordcamp_payments_index';45 return $wpdb->get_blog_prefix(0) . 'wordcamp_payments_index'; 46 46 } 47 47 … … 68 68 post_id int(11) unsigned NOT NULL default '0', 69 69 created int(11) unsigned NOT NULL default '0', 70 paid int(11) unsigned NOT NULL default '0', 70 71 category varchar(255) NOT NULL default '', 71 72 method varchar(255) NOT NULL default '', 72 73 due int(11) unsigned NOT NULL default '0', 73 74 status varchar(255) NOT NULL default '', 75 keywords text NOT NULL default '', 74 76 PRIMARY KEY (id), 75 77 KEY blog_post_id (blog_id, post_id), … … 124 126 public static function prepare_for_index( $request ) { 125 127 $request = get_post( $request ); 128 $categories = WCP_Payment_Request::get_payment_categories(); 129 130 // All things search. 131 $keywords = array( $request->post_title ); 132 133 $category_slug = get_post_meta( $request->ID, '_camppayments_payment_category', true ); 134 if ( ! empty( $categories[ $category_slug ] ) ) 135 $keywords[] = $categories[ $category_slug ]; 136 137 $payment_method = get_post_meta( $request->ID, '_camppayments_payment_method', true ); 138 if ( ! empty( $payment_method ) ) 139 $keywords[] = $payment_method; 126 140 127 141 return array( … … 133 147 'due' => absint( get_post_meta( $request->ID, '_camppayments_due_by', true ) ), 134 148 'status' => $request->post_status, 135 'method' => get_post_meta( $request->ID, '_camppayments_payment_method', true ), 136 'category' => get_post_meta( $request->ID, '_camppayments_payment_category', true ), 149 'method' => $payment_method, 150 'category' => $category_slug, 151 'keywords' => json_encode( $keywords ), 137 152 ); 138 153 } … … 233 248 <form id="posts-filter" action="" method="get"> 234 249 <input type="hidden" name="page" value="wcp-dashboard" /> 235 <input type="hidden" name="wcp-section" value="overdue" /> 250 <input type="hidden" name="wcp-section" value="<?php echo esc_attr( self::get_current_tab() ); ?>" /> 251 <?php self::$list_table->search_box( __( 'Search Payments', 'wordcamporg' ), 'wcp' ); ?> 236 252 <?php self::$list_table->display(); ?> 237 253 </form>
Note: See TracChangeset
for help on using the changeset viewer.