Fixed database update script, disabled pagination
authorLaury GvR <laury@gaslightmedia.com>
Thu, 12 Jan 2017 15:59:21 +0000 (10:59 -0500)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 12 Jan 2017 15:59:21 +0000 (10:59 -0500)
We're disabling pagination for now until we get it working for
this plugin, and I fixed a database update script which was
applying the wrong update.

models/front/contacts/list.php
setup/databaseScripts/update_database_V0.0.2.sql
setup/databaseScripts/update_database_V0.0.3.sql

index 75f4fcf..af0b950 100644 (file)
@@ -245,11 +245,13 @@ class GlmMembersFront_contacts_list extends GlmDataContacts
         
         // Get the total number of contacts listed
         $numbContacts = $this->getStats($where);
-
         // If the number of events is less than a page, don't do paging
         if ($numbContacts <= $limit) {
             $paging = false;
         }
+        
+        // Setting $paging to false until we figure it out for contacts
+        $paging = false;
 
         // Get full list of names matching this where clause for search box
         $namesList = $this->getIdName($where);
@@ -275,7 +277,9 @@ class GlmMembersFront_contacts_list extends GlmDataContacts
         $contactsList = $this->getList($where);
 
         if ($contactsList != false) {
+            
             if ($paging) {
+                
                 //Get paging results
                $numbDisplayed = $contactsList['returned'];
                $lastDisplayed = $contactsList['last'];
index f0fc44d..3f15f4b 100644 (file)
@@ -7,4 +7,9 @@
 -- all queries must be separated by a line with four dashses
 
 -- Add primary_contact field
-ALTER TABLE {prefix}contacts ADD COLUMN county TINYTEXT;
+ALTER TABLE {prefix}contacts ADD COLUMN primary_contact BOOLEAN;
+
+----
+
+-- Update primary_contacts to default all current entries to false
+UPDATE {prefix}contacts SET primary_contact = false;
\ No newline at end of file
index e17e1d6..fb23285 100644 (file)
@@ -7,14 +7,4 @@
 -- all queries must be separated by a line with four dashses
 
 -- Add primary_contact field
-ALTER TABLE {prefix}contacts ADD COLUMN primary_contact BOOLEAN;
-
-----
-
--- Update primary_contacts to default all current entries to false
-UPDATE {prefix}contacts SET primary_contact = false;
-
-
-
-
-
+ALTER TABLE {prefix}contacts ADD COLUMN county TINYTEXT;
\ No newline at end of file