From 39ea0a89a6c17a915355f6a13a96c9232bb04e20 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Thu, 26 Jul 2018 11:10:53 -0400 Subject: [PATCH] More business fields for contacts Adding first and last name for Company. --- classes/data/dataContacts.php | 26 ++++++++++++++----- index.php | 2 +- ..._V0.0.4.sql => create_database_V0.0.5.sql} | 2 ++ setup/databaseScripts/dbVersions.php | 1 + .../update_database_V0.0.5.sql | 13 ++++++++++ 5 files changed, 37 insertions(+), 7 deletions(-) rename setup/databaseScripts/{create_database_V0.0.4.sql => create_database_V0.0.5.sql} (97%) create mode 100644 setup/databaseScripts/update_database_V0.0.5.sql diff --git a/classes/data/dataContacts.php b/classes/data/dataContacts.php index 51de016..b69975e 100644 --- a/classes/data/dataContacts.php +++ b/classes/data/dataContacts.php @@ -450,21 +450,35 @@ class GlmDataContacts extends GlmDataAbstract 'use' => 'lged' ), - // Address line 1 + // Org First Name + 'business_fname' => array ( + 'field' => 'business_fname', + 'type' => 'text', + 'use' => 'a' + ), + + // Org Last Name + 'business_lname' => array ( + 'field' => 'business_lname', + 'type' => 'text', + 'use' => 'a' + ), + + // Org Address line 1 'business_addr1' => array ( 'field' => 'business_addr1', 'type' => 'text', 'use' => 'a' ), - // Address line 2 + // Org Address line 2 'business_addr2' => array ( 'field' => 'business_addr2', 'type' => 'text', 'use' => 'a' ), - // City + // Org City 'business_city' => array ( 'field' => 'business_city', 'type' => 'pointer', @@ -475,7 +489,7 @@ class GlmDataContacts extends GlmDataAbstract 'use' => 'a' ), - // State + // Org State 'business_state' => array ( 'field' => 'business_state', 'type' => 'list', @@ -484,7 +498,7 @@ class GlmDataContacts extends GlmDataAbstract 'use' => 'a' ), - // ZIP / Postal Code + // Org ZIP / Postal Code 'business_zip' => array ( 'field' => 'business_zip', 'type' => 'text', @@ -500,7 +514,7 @@ class GlmDataContacts extends GlmDataAbstract 'use' => 'a' ), - // E-Mail Address + // Org E-Mail Address 'business_email' => array( 'field' => 'business_email', 'type' => 'email', diff --git a/index.php b/index.php index df2da4c..acdad9e 100644 --- a/index.php +++ b/index.php @@ -40,7 +40,7 @@ if (!defined('ABSPATH')) { * version nunmber of that release for the DB version. */ define('GLM_MEMBERS_CONTACTS_PLUGIN_VERSION', '1.1.10'); -define('GLM_MEMBERS_CONTACTS_PLUGIN_DB_VERSION', '0.0.4'); +define('GLM_MEMBERS_CONTACTS_PLUGIN_DB_VERSION', '0.0.5'); // This is the minimum version of the GLM Members DB plugin require for this plugin. define('GLM_MEMBERS_CONTACTS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '1.0.58'); diff --git a/setup/databaseScripts/create_database_V0.0.4.sql b/setup/databaseScripts/create_database_V0.0.5.sql similarity index 97% rename from setup/databaseScripts/create_database_V0.0.4.sql rename to setup/databaseScripts/create_database_V0.0.5.sql index bebb7c2..1a6175b 100644 --- a/setup/databaseScripts/create_database_V0.0.4.sql +++ b/setup/databaseScripts/create_database_V0.0.5.sql @@ -45,6 +45,8 @@ CREATE TABLE {prefix}contacts ( modify_time TIMESTAMP NULL, -- Last modified date/time ref_type INT NULL, -- Type of entity this contact is associated with ref_dest INT NULL, -- Pointer to the specific entity of ref_type this contact is associated with + business_fname TINYTEXT NULL, -- Org First Name + business_lname TINYTEXT NULL, -- Org Last Name business_addr1 TINYTEXT NULL, -- Org Address 1 business_addr2 TINYTEXT NULL, -- Org Address 2 business_city INT NULL, -- Org City diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index c584960..83046be 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -31,6 +31,7 @@ $glmMembersContactsDbVersions = array( '0.0.2' => array('version' => '0.0.2', 'tables' => 1, 'date' => '7/25/2016'), '0.0.3' => array('version' => '0.0.3', 'tables' => 1, 'date' => '1/11/2017'), '0.0.4' => array('version' => '0.0.4', 'tables' => 1, 'date' => '07/26/2018'), + '0.0.5' => array('version' => '0.0.5', 'tables' => 1, 'date' => '07/26/2018'), ); diff --git a/setup/databaseScripts/update_database_V0.0.5.sql b/setup/databaseScripts/update_database_V0.0.5.sql new file mode 100644 index 0000000..8ab4cfa --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.5.sql @@ -0,0 +1,13 @@ +-- Gaslight Media Members Database - Contacts Add-On +-- File Created: 2018-07-26 +-- Database Version: 0.0.4 +-- Database Update From Previous Version Script +-- +-- To permit each query below to be executed separately, +-- all queries must be separated by a line with four dashses + +ALTER TABLE {prefix}contacts ADD COLUMN business_fname TINYTEXT NULL; -- Org First Name + +---- + +ALTER TABLE {prefix}contacts ADD COLUMN business_lname TINYTEXT NULL; -- Org Last Name -- 2.17.1