From: Anthony Talarico Date: Tue, 13 Nov 2018 18:35:54 +0000 (-0500) Subject: pushing test code to see why the admin ajax search isn't triggering the list model X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=ac73c2867bd88813408ca6380c8e5a714d687efa;p=WP-Plugins%2Fglm-member-db.git pushing test code to see why the admin ajax search isn't triggering the list model --- diff --git a/models/admin/ajax/adminSearch.php b/models/admin/ajax/adminSearch.php index 2033f941..186ac369 100644 --- a/models/admin/ajax/adminSearch.php +++ b/models/admin/ajax/adminSearch.php @@ -83,13 +83,9 @@ class GlmMembersAdmin_ajax_adminSearch global $wpdb; - require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMembers.php'; - require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMemberInfo.php'; - $membersTable = GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_info"; - $membersTextTable = GLM_MEMBERS_PLUGIN_DB_PREFIX . "members"; - $MemberInfo = new GlmDataMemberInfo($this->wpdb, $this->config); - $Members = new GlmDataMembers($this->wpdb, $this->config); - + require_once GLM_MEMBERS_PLUGIN_PATH . '/models/admin/manageDashboard/members.php'; + $memberSearch = new GlmMembersAdmin_manageDashboard_members($this->wpdb, $this->config); + $data = "test"; $where = ' true '; @@ -98,11 +94,11 @@ class GlmMembersAdmin_ajax_adminSearch $limit = 20; $status = $this->config['status_numb']['Active']; - $list = apply_filters('glm-member-db-admin-search'); - $this->write_log($list); + $list = apply_filters('glm-member-db-admin-search',''); + $this->write_log("LIST: ". $list); $return = array( - 'searchData' => $list // Where our events list will go + 'searchData' => $memberSearch // Where our events list will go ); header('Content-type:application/json;charset=utf-8', true); diff --git a/models/admin/manageDashboard/list.php b/models/admin/manageDashboard/list.php new file mode 100644 index 00000000..e69de29b diff --git a/models/admin/manageDashboard/members.php b/models/admin/manageDashboard/members.php index 2a811fa1..baa066f4 100644 --- a/models/admin/manageDashboard/members.php +++ b/models/admin/manageDashboard/members.php @@ -66,7 +66,15 @@ class GlmMembersAdmin_manageDashboard_members extends GlmDataMembers parent::__construct(false, false); } - + function writes_log ( $log ) { + if ( true === WP_DEBUG ) { + if ( is_array( $log ) || is_object( $log ) ) { + error_log( print_r( $log, true ) ); + } else { + error_log( $log ); + } + } + } /* * Perform Model Action * @@ -103,7 +111,8 @@ class GlmMembersAdmin_manageDashboard_members extends GlmDataMembers */ public function modelAction ($actionData = false) { - + $this->writes_log($_REQUEST); + $view = "index"; // Enqueue Materialize wp_register_script( @@ -431,7 +440,7 @@ class GlmMembersAdmin_manageDashboard_members extends GlmDataMembers 'status' => $success, 'menuItemRedirect' => false, 'modelRedirect' => false, - 'view' => 'admin/common/manageDashboard/index.html', + 'view' => "admin/common/manageDashboard/$view.html", 'data' => $templateData ); diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 68ce4257..8d588ec3 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -576,7 +576,7 @@ add_filter( ); add_filter( 'glm-member-db-admin-search', - function ( $input = '' ) { - return $this->controller( 'members', 'list'); + function ( $data ) { + return $this->controller( 'manageDashboard', 'members'); } ); \ No newline at end of file diff --git a/views/admin/common/manageDashboard/list.html b/views/admin/common/manageDashboard/list.html index 6cb8e6ec..f6a19c8d 100644 --- a/views/admin/common/manageDashboard/list.html +++ b/views/admin/common/manageDashboard/list.html @@ -1,384 +1,7 @@ - -
-
- - - - - - -

List of {$terms.term_member_plur_cap}

- -
- {$terms.term_member_cap} Types - -
- -
- Show Archived: - Featured Only: - Pending Only: -
- - {apply_filters('glm-member-db-custom-filter-search', '', 'glm-member-db' )} - -

Total found: {$memberCount}  

- -
- -
{$terms.term_member_cap} Export/Reports
- - {if $paging} - - - {/if} - - - - - - - - - - - - - - - - - {if $haveMembers} - {assign var="i" value="0"} - {foreach $members as $m} - {if $i++ is odd by 1} - - {else} - - {/if} - - - - - - - - - {/foreach} - {else} - - {/if} - -
ID{$terms.term_member_cap} NameFeaturedAccess
- {$m.id} - - {$m.name} - - Edit Active Profile - - View Profile - - {$m.featured.name} - - {$m.access_short.name} -
(no {$terms.term_member_plur} listed)
- - {if $paging} - - - {/if} - -
- -
-
- - - - - - - - - - - - - - - - - - - - {* Custom Field Part *} - {if apply_filters( 'glm-members-customfields-active', false )} - - - - - {/if} - - - - - - - - -
Categories: - -
Member Types: - -
Show Archived:
Featured Only:
Pending Only:
Name Search:
- Enter any portion of a {$terms.term_member_cap} name and press enter or select any specific {$terms.term_member_cap} found. -
Fields to export - - - - - - - - -
Check All / Uncheck All
- {$terms.term_member_cap} ID
- Old {$terms.term_member_cap} ID
- {$terms.term_member_cap} Name
- Profile Reference Name
- Address Line #1
- Address Line #2
- City
- State
- ZIP/Postal Code
- County
- Region
-
- Phone #
- Toll Free
- Main E-Mail
- Primary Contact Name
- Primary Contact E-Mail
- Web Address (URL)
- Categories
- Mailing Address Line #1
- Mailing Address Line #2
- Mailing City
- Mailing State
- Mailing ZIP/Postal Code
-
-
Custom Fields - {$customFields = apply_filters('glm-member-db-fields-get-members-fields', false, 'glm-member-db')} - {if $customFields} - {foreach $customFields as $cf} - {$cf.field_name}
- {/foreach} - {/if} -
Include Clicks & Views - - - - - - - -
- Month: -
- URL Click Counts
- Detail Page View Counts -
-
Export to: - Export for Print
- Export to Spreadsheet (CSV) -
- Cancel - -
-
+
+
+
{$memberCount}
-