From 340ba9e17887ef8242f191d8c296880276ee2478 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Thu, 12 Jan 2017 10:59:21 -0500 Subject: [PATCH] Fixed database update script, disabled pagination 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 | 6 +++++- setup/databaseScripts/update_database_V0.0.2.sql | 7 ++++++- setup/databaseScripts/update_database_V0.0.3.sql | 12 +----------- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/models/front/contacts/list.php b/models/front/contacts/list.php index 75f4fcf..af0b950 100644 --- a/models/front/contacts/list.php +++ b/models/front/contacts/list.php @@ -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']; diff --git a/setup/databaseScripts/update_database_V0.0.2.sql b/setup/databaseScripts/update_database_V0.0.2.sql index f0fc44d..3f15f4b 100644 --- a/setup/databaseScripts/update_database_V0.0.2.sql +++ b/setup/databaseScripts/update_database_V0.0.2.sql @@ -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 diff --git a/setup/databaseScripts/update_database_V0.0.3.sql b/setup/databaseScripts/update_database_V0.0.3.sql index e17e1d6..fb23285 100644 --- a/setup/databaseScripts/update_database_V0.0.3.sql +++ b/setup/databaseScripts/update_database_V0.0.3.sql @@ -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 -- 2.17.1