From 25fa28d0a01c3709aadee5954570cef208b1039a Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 12 Jan 2017 13:39:58 -0500 Subject: [PATCH] Fixed the county search hidden on contact list The county search was not being properly hidden when there were no counties. --- models/front/contacts/list.php | 7 ++++++- views/front/contacts/list.html | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/models/front/contacts/list.php b/models/front/contacts/list.php index 65c4ce2..17f1544 100644 --- a/models/front/contacts/list.php +++ b/models/front/contacts/list.php @@ -130,6 +130,7 @@ class GlmMembersFront_contacts_list extends GlmDataContacts $filterText = false; $countySearch = false; $countyList = array(); + $haveCounties = false; $haveFilter = false; $userDeleted = false; $wpUserDeleted = false; @@ -302,6 +303,10 @@ class GlmMembersFront_contacts_list extends GlmDataContacts // Get a list of counties $countyList = $this->wpdb->get_col("SELECT DISTINCT county FROM ".GLM_MEMBERS_CONTACTS_PLUGIN_DB_PREFIX . "contacts WHERE active = true;"); + if ($countyList[0]) { + echo "
" . print_r($countyList, true) . "
"; + $haveCounties = true; + } // // // @@ -324,7 +329,6 @@ class GlmMembersFront_contacts_list extends GlmDataContacts } - //echo "
" . print_r($countyList, true) . "
"; // Compile template data $templateData = array( @@ -353,6 +357,7 @@ class GlmMembersFront_contacts_list extends GlmDataContacts 'filterArchived' => $filterArchived, 'filterText' => $filterText, 'countyList' => $countyList, + 'haveCounties' => $haveCounties, 'countySearch' => $countySearch, 'haveFilter' => $haveFilter, 'userDeleted' => $userDeleted, diff --git a/views/front/contacts/list.html b/views/front/contacts/list.html index 90bfa98..a1b4ed0 100644 --- a/views/front/contacts/list.html +++ b/views/front/contacts/list.html @@ -23,7 +23,7 @@ and open the template in the editor.
Text Search:
- {if $countyList} + {if $haveCounties}
County Search: