More db updates for contact table.
authorSteve Sutton <steve@gaslightmedia.com>
Thu, 26 Jul 2018 18:53:29 +0000 (14:53 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Thu, 26 Jul 2018 18:53:29 +0000 (14:53 -0400)
Adding mailing address type and mailto label.

classes/data/dataContacts.php
index.php
setup/databaseScripts/create_database_V0.0.5.sql [deleted file]
setup/databaseScripts/create_database_V0.0.6.sql [new file with mode: 0644]
setup/databaseScripts/dbVersions.php
setup/databaseScripts/update_database_V0.0.5.sql
setup/databaseScripts/update_database_V0.0.6.sql [new file with mode: 0644]

index b69975e..77ed806 100644 (file)
@@ -560,6 +560,20 @@ class GlmDataContacts extends GlmDataAbstract
                 'use' => 'a'
             ),
 
+            // Mailing Address Type
+            'mailing_address_type' => array(
+                'field'    => 'mailing_address_type',
+                'type'     => 'phone',
+                'use'      => 'a'
+            ),
+
+            // Mail To Label
+            'mailto_label' => array(
+                'field'    => 'mailto_label',
+                'type'     => 'phone',
+                'use'      => 'a'
+            ),
+
         );
 
     }
index acdad9e..8d0a000 100644 (file)
--- 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.5');
+define('GLM_MEMBERS_CONTACTS_PLUGIN_DB_VERSION', '0.0.6');
 
 // 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.5.sql b/setup/databaseScripts/create_database_V0.0.5.sql
deleted file mode 100644 (file)
index 1a6175b..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
--- Gaslight Media Members Database
--- File Created: 12/09/14 15:27:15
--- Database Version: 0.0.4
--- Database Creation Script - Contacts Add-On
---
--- To permit each query below to be executed separately,
--- all queries must be separated by a line with four dashes
---
--- **** BE SURE TO ALSO UPDATE drop_database_Vxxx.sql FILE WHEN CHANGING TABLES ****
---
-
--- Contacts - used by various entities
-CREATE TABLE {prefix}contacts (
-  id INT NOT NULL AUTO_INCREMENT,
-  active BOOLEAN NULL,                      -- Contact is active flag
-  access INT NULL,                          -- Access type - See access table in plugin.ini
-  primary_contact BOOLEAN NULL,             -- Contact is the "Primary Contact" for mailings to entity (ref_type/ref_dest)
-  fname TINYTEXT NULL,                      -- First name of contact
-  lname TINYTEXT NULL,                      -- Last name of contact
-  contact_type INT NULL,                    -- Contact type - see contact_type table (individual, role, ...)
-  contact_role INT NULL,                    -- Contact WordPress user Role
-  org TINYTEXT NULL,                        -- Organization name
-  title TINYTEXT NULL,                      -- Title/Position
-  descr TEXT NULL,                          -- Description of position/responsibilities - Displayed
-  image TINYTEXT NULL,                      -- Image
-  addr1 TINYTEXT NULL,                      -- Address line 1 - Address is for contact, not necessarily for organization
-  addr2 TINYTEXT NULL,                      -- Address line 2
-  county TINYTEXT NULL,                     -- County
-  city INT NULL,                            -- Pointer to city in cities table
-  state TINYTEXT NULL,                      -- Two character state code - matches states.ini entries
-  country TINYTEXT NULL,                    -- Two character country code - matches countries.ini entries
-  zip TINYTEXT NULL,                        -- ZIP/Postal Code
-  lat FLOAT NULL,                           -- Latitude of contact location
-  lon FLOAT NULL,                           -- Longitude of contact location
-  url TINYTEXT NULL,                        -- URL to information regarding this contact
-  home_phone TINYTEXT NULL,                 -- Home phone number - or after-hours phone number
-  mobile_phone TINYTEXT NULL,               -- Mobile phone number
-  alt_phone TINYTEXT NULL,                  -- An alternate phone number
-  email TINYTEXT NULL,                      -- E-Mail address
-  alt_email TINYTEXT NULL,                  -- Alternate E-Mail address - Also used to log-in
-  username TINYTEXT NULL,                   -- Optional username to use for login
-  password TINYTEXT NULL,                   -- Encrypted password
-  notes TEXT NULL,                          -- Notes - Not displayed on front-end
-  create_time TIMESTAMP NULL,               -- Create date/time
-  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
-  business_state TINYTEXT NULL,             -- Org State
-  business_zip TINYTEXT NULL,               -- Org Zip
-  business_country TINYTEXT NULL,           -- Org Country
-  business_email TINYTEXT NULL,             -- Org Email
-  office_phone TINYTEXT NULL,               -- Org Office phone number
-  business_mobile TINYTEXT NULL,            -- Org Mobile
-  fax TINYTEXT NULL,                        -- Org FAX number (do people still use these?)
-  contact_publish BOOLEAN NULL,             -- Flag to publish Contact Info to Directory
-  contact_use_billing BOOLEAN NULL,         -- Flag to use Contact Info as Billing
-  business_publish BOOLEAN NULL,            -- Flag to publish Business to Directory
-  business_use_billing BOOLEAN NULL,        -- Flag to use Business as Billing
-  PRIMARY KEY (id),
-  INDEX(fname(20)),
-  INDEX(lname(20)),
-  INDEX(city),
-  INDEX(zip(10)),
-  INDEX(lat),
-  INDEX(lon),
-  INDEX(email(20))
-);
diff --git a/setup/databaseScripts/create_database_V0.0.6.sql b/setup/databaseScripts/create_database_V0.0.6.sql
new file mode 100644 (file)
index 0000000..779e0d9
--- /dev/null
@@ -0,0 +1,74 @@
+-- Gaslight Media Members Database
+-- File Created: 12/09/14 15:27:15
+-- Database Version: 0.0.6
+-- Database Creation Script - Contacts Add-On
+--
+-- To permit each query below to be executed separately,
+-- all queries must be separated by a line with four dashes
+--
+-- **** BE SURE TO ALSO UPDATE drop_database_Vxxx.sql FILE WHEN CHANGING TABLES ****
+--
+
+-- Contacts - used by various entities
+CREATE TABLE {prefix}contacts (
+  id INT NOT NULL AUTO_INCREMENT,
+  active BOOLEAN NULL,                      -- Contact is active flag
+  access INT NULL,                          -- Access type - See access table in plugin.ini
+  primary_contact BOOLEAN NULL,             -- Contact is the "Primary Contact" for mailings to entity (ref_type/ref_dest)
+  fname TINYTEXT NULL,                      -- First name of contact
+  lname TINYTEXT NULL,                      -- Last name of contact
+  contact_type INT NULL,                    -- Contact type - see contact_type table (individual, role, ...)
+  contact_role INT NULL,                    -- Contact WordPress user Role
+  org TINYTEXT NULL,                        -- Organization name
+  title TINYTEXT NULL,                      -- Title/Position
+  descr TEXT NULL,                          -- Description of position/responsibilities - Displayed
+  image TINYTEXT NULL,                      -- Image
+  addr1 TINYTEXT NULL,                      -- Address line 1 - Address is for contact, not necessarily for organization
+  addr2 TINYTEXT NULL,                      -- Address line 2
+  county TINYTEXT NULL,                     -- County
+  city INT NULL,                            -- Pointer to city in cities table
+  state TINYTEXT NULL,                      -- Two character state code - matches states.ini entries
+  country TINYTEXT NULL,                    -- Two character country code - matches countries.ini entries
+  zip TINYTEXT NULL,                        -- ZIP/Postal Code
+  lat FLOAT NULL,                           -- Latitude of contact location
+  lon FLOAT NULL,                           -- Longitude of contact location
+  url TINYTEXT NULL,                        -- URL to information regarding this contact
+  home_phone TINYTEXT NULL,                 -- Home phone number - or after-hours phone number
+  mobile_phone TINYTEXT NULL,               -- Mobile phone number
+  alt_phone TINYTEXT NULL,                  -- An alternate phone number
+  email TINYTEXT NULL,                      -- E-Mail address
+  alt_email TINYTEXT NULL,                  -- Alternate E-Mail address - Also used to log-in
+  username TINYTEXT NULL,                   -- Optional username to use for login
+  password TINYTEXT NULL,                   -- Encrypted password
+  notes TEXT NULL,                          -- Notes - Not displayed on front-end
+  create_time TIMESTAMP NULL,               -- Create date/time
+  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
+  business_state TINYTEXT NULL,             -- Org State
+  business_zip TINYTEXT NULL,               -- Org Zip
+  business_country TINYTEXT NULL,           -- Org Country
+  business_email TINYTEXT NULL,             -- Org Email
+  office_phone TINYTEXT NULL,               -- Org Office phone number
+  business_mobile TINYTEXT NULL,            -- Org Mobile
+  fax TINYTEXT NULL,                        -- Org FAX number (do people still use these?)
+  contact_publish BOOLEAN NULL,             -- Flag to publish Contact Info to Directory
+  contact_use_billing BOOLEAN NULL,         -- Flag to use Contact Info as Billing
+  business_publish BOOLEAN NULL,            -- Flag to publish Business to Directory
+  business_use_billing BOOLEAN NULL,        -- Flag to use Business as Billing
+  mailing_address_type TINYTEXT NULL,       -- Mailing Address Type
+  mailto_label TINYTEXT NULL,               -- Mail To Label
+  PRIMARY KEY (id),
+  INDEX(fname(20)),
+  INDEX(lname(20)),
+  INDEX(city),
+  INDEX(zip(10)),
+  INDEX(lat),
+  INDEX(lon),
+  INDEX(email(20))
+);
index 83046be..a52309e 100644 (file)
@@ -32,6 +32,7 @@ $glmMembersContactsDbVersions = array(
     '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'),
+    '0.0.6' => array('version' => '0.0.6', 'tables' => 1, 'date' => '07/26/2018'),
 );
 
 
index 8ab4cfa..2ac9024 100644 (file)
@@ -1,6 +1,6 @@
 -- Gaslight Media Members Database  - Contacts Add-On
 -- File Created: 2018-07-26
--- Database Version: 0.0.4
+-- Database Version: 0.0.5
 -- Database Update From Previous Version Script
 --
 -- To permit each query below to be executed separately,
diff --git a/setup/databaseScripts/update_database_V0.0.6.sql b/setup/databaseScripts/update_database_V0.0.6.sql
new file mode 100644 (file)
index 0000000..c911c63
--- /dev/null
@@ -0,0 +1,13 @@
+-- Gaslight Media Members Database  - Contacts Add-On
+-- File Created: 2018-07-26
+-- Database Version: 0.0.6
+-- 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 mailing_address_type TINYTEXT NULL;     -- Mailing Address Type
+
+----
+
+ALTER TABLE {prefix}contacts ADD COLUMN mailto_label TINYTEXT NULL;             -- Mail To Label