Contact list ordered, county search hidden if empty
authorLaury GvR <laury@gaslightmedia.com>
Thu, 12 Jan 2017 18:21:35 +0000 (13:21 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 12 Jan 2017 18:21:35 +0000 (13:21 -0500)
The county search is now hidden if there are no counties. The
contact list is also ordered by lname, fname.

models/front/contacts/list.php
views/front/contacts/list.html

index af0b950..65c4ce2 100644 (file)
@@ -134,6 +134,7 @@ class GlmMembersFront_contacts_list extends GlmDataContacts
         $userDeleted = false;
         $wpUserDeleted = false;
         $contactMembers = array();
+        $order = false;
 
         $numbContacts = false;
         $numbDisplayed = false;
@@ -272,14 +273,12 @@ class GlmMembersFront_contacts_list extends GlmDataContacts
                 $start = $newStart;
             }
         }
-
+        $order = "lname, fname";
         // Get list of contacts
-        $contactsList = $this->getList($where);
+        $contactsList = $this->getList($where, $order);
 
         if ($contactsList != false) {
-            
             if ($paging) {
-                
                 //Get paging results
                $numbDisplayed = $contactsList['returned'];
                $lastDisplayed = $contactsList['last'];
index b3bcf50..90bfa98 100644 (file)
@@ -23,6 +23,7 @@ and open the template in the editor.
                 <div id="glmContactsSearchContainer" class="small-12 large-5">
                     <b>Text Search: </b><input  id="glmContactsSearch" name="filterText" type="text" id="autoTest" value="{$filterText}">
                 </div>
+                {if $countyList}
                 <div id="glmContactsCountySearchContainer" class="small-12 large-5">
                     <b>County Search: </b>
                     <select  id="glmContactsCountySearch" name="countySearch" type="text" value="{$countySearch}">
@@ -31,6 +32,7 @@ and open the template in the editor.
                         {/foreach}
                     </select>
                 </div>
+                {/if}
                 <div class="small-12 large-2" id="glmContactsSearchSubmit">
                     <input type="submit" value="Submit" class="glm-button button">
                 </div>