From: Steve Sutton Date: Wed, 25 Jul 2018 18:23:52 +0000 (-0400) Subject: Updating the contact list to include custom fields X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=3bfb98a031bbf23aa0a0835c87ca3bfb8863bc6a;p=WP-Plugins%2Fglm-member-db-contacts.git Updating the contact list to include custom fields Custom fields from the contacts will now show in the contact admin list. --- diff --git a/models/admin/contacts/index.php b/models/admin/contacts/index.php index 71129b6..0b15688 100644 --- a/models/admin/contacts/index.php +++ b/models/admin/contacts/index.php @@ -139,6 +139,7 @@ class GlmMembersAdmin_contacts_index extends GlmDataContacts $namesList = false; $customFieldResults = false; $member_types = false; + $contactUpdateError = false; $where = ''; @@ -664,6 +665,12 @@ class GlmMembersAdmin_contacts_index extends GlmDataContacts $haveFilter = true; } + $whereParts = apply_filters('glm-member-db-admin-search-query', $where, 'glm-member-db-contacts'); + if ( is_array( $whereParts ) && count( $whereParts ) > 0 ) { + $where .= ' AND '.implode(" AND ", $whereParts); + $whereSep = ' AND '; + } + // Get the total number of contacts listed // echo '
$where: ' . print_r( $where, true ) . '
'; @@ -777,7 +784,8 @@ class GlmMembersAdmin_contacts_index extends GlmDataContacts 'slug' => GLM_MEMBERS_CONTACTS_PLUGIN_SLUG, 'customFieldResults' => $customFieldResults, 'member_types' => $member_types, - + 'contactUpdateError' => $contactUpdateError, + 'errorMessage' => false, ); // Return status, any suggested view, and any data to controller diff --git a/views/admin/contacts/index.html b/views/admin/contacts/index.html index 271ab08..22fb5c8 100644 --- a/views/admin/contacts/index.html +++ b/views/admin/contacts/index.html @@ -31,10 +31,13 @@ + {apply_filters('glm-member-db-custom-filter-search', '', 'glm-member-db-contacts' )} +

Total found: {$numbContacts}  

+ {if $paging} @@ -105,7 +108,7 @@