From f327c0145dd10ae21f64443f5787c294d657dc5e Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Mon, 14 Oct 2019 13:31:50 -0400 Subject: [PATCH] Adding Salutation to the company info section. Adding new field. --- classes/data/dataContacts.php | 7 +++++++ index.php | 5 ++++- ..._database_V0.0.8.sql => create_database_V0.0.9.sql} | 3 ++- setup/databaseScripts/dbVersions.php | 1 + setup/databaseScripts/update_database_V0.0.9.sql | 10 ++++++++++ views/admin/ajax/contactsListExport.html | 2 ++ views/admin/ajax/contactsListExportCsv.html | 2 ++ views/admin/contacts/edit.html | 9 ++++++++- views/admin/contacts/index.html | 1 + 9 files changed, 37 insertions(+), 3 deletions(-) rename setup/databaseScripts/{create_database_V0.0.8.sql => create_database_V0.0.9.sql} (98%) create mode 100644 setup/databaseScripts/update_database_V0.0.9.sql diff --git a/classes/data/dataContacts.php b/classes/data/dataContacts.php index 4276d14..34c7179 100644 --- a/classes/data/dataContacts.php +++ b/classes/data/dataContacts.php @@ -451,6 +451,13 @@ class GlmDataContacts extends GlmDataAbstract 'use' => 'lged' ), + // Org Salutation + 'business_salutation' => array ( + 'field' => 'business_salutation', + 'type' => 'text', + 'use' => 'a' + ), + // Org First Name 'business_fname' => array ( 'field' => 'business_fname', diff --git a/index.php b/index.php index bd68e22..a7edf9d 100644 --- a/index.php +++ b/index.php @@ -40,7 +40,10 @@ if (!defined('ABSPATH')) { * version nunmber of that release for the DB version. */ define('GLM_MEMBERS_CONTACTS_PLUGIN_VERSION', '1.1.11'); -define('GLM_MEMBERS_CONTACTS_PLUGIN_DB_VERSION', '0.0.8'); +/** + * Database Version + */ +define('GLM_MEMBERS_CONTACTS_PLUGIN_DB_VERSION', '0.0.9'); // 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.8.sql b/setup/databaseScripts/create_database_V0.0.9.sql similarity index 98% rename from setup/databaseScripts/create_database_V0.0.8.sql rename to setup/databaseScripts/create_database_V0.0.9.sql index af7da90..f1bac4d 100644 --- a/setup/databaseScripts/create_database_V0.0.8.sql +++ b/setup/databaseScripts/create_database_V0.0.9.sql @@ -1,6 +1,6 @@ -- Gaslight Media Members Database -- File Created: 12/09/14 15:27:15 --- Database Version: 0.0.8 +-- Database Version: 0.0.9 -- Database Creation Script - Contacts Add-On -- -- To permit each query below to be executed separately, @@ -45,6 +45,7 @@ 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_salutation TINYTEXT NULL, -- Org Salutation business_fname TINYTEXT NULL, -- Org First Name business_lname TINYTEXT NULL, -- Org Last Name business_addr1 TINYTEXT NULL, -- Org Address 1 diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 1d78618..a422343 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -35,6 +35,7 @@ $glmMembersContactsDbVersions = array( '0.0.6' => array('version' => '0.0.6', 'tables' => 1, 'date' => '07/26/2018'), '0.0.7' => array('version' => '0.0.7', 'tables' => 1, 'date' => '08/09/2018'), '0.0.8' => array('version' => '0.0.8', 'tables' => 2, 'date' => '04/24/2019'), + '0.0.9' => array('version' => '0.0.9', 'tables' => 2, 'date' => '10/10/2019'), ); diff --git a/setup/databaseScripts/update_database_V0.0.9.sql b/setup/databaseScripts/update_database_V0.0.9.sql new file mode 100644 index 0000000..a51d679 --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.9.sql @@ -0,0 +1,10 @@ +-- Gaslight Media Members Database - Contacts Add-On +-- File Created: 10/10/19 +-- Database Version: 0.0.9 +-- 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 dashes + +-- Add Salutation +ALTER TABLE {prefix}contacts ADD COLUMN business_salutation TINYTEXT NULL; diff --git a/views/admin/ajax/contactsListExport.html b/views/admin/ajax/contactsListExport.html index 4009f6f..eafdedd 100644 --- a/views/admin/ajax/contactsListExport.html +++ b/views/admin/ajax/contactsListExport.html @@ -31,6 +31,7 @@ {if $select.exportMemberType}Member Type{/if} {if $select.exportOrg}Org{/if} + {if $select.exportBusSalutation}Business Salutation{/if} {if $select.exportBusFname}Business First Name{/if} {if $select.exportBusLname}Business Last Name{/if} {if $select.exportTitle}Title{/if} @@ -74,6 +75,7 @@ {if $select.exportMemberType}{$m.member_type}{/if} {if $select.exportOrg}{$m.org}{/if} + {if $select.exportBusSalutation}{$m.business_salutation}{/if} {if $select.exportBusFname}{$m.business_fname}{/if} {if $select.exportBusLname}{$m.business_lname}{/if} {if $select.exportTitle}{$m.title}{/if} diff --git a/views/admin/ajax/contactsListExportCsv.html b/views/admin/ajax/contactsListExportCsv.html index a54c63c..ea0f219 100644 --- a/views/admin/ajax/contactsListExportCsv.html +++ b/views/admin/ajax/contactsListExportCsv.html @@ -18,6 +18,7 @@ {if $select.exportAltEmail}"Alt E-Mail",{/if} {if $select.exportMemberType}"Member Type",{/if} {if $select.exportOrg}"Organization",{/if} +{if $select.exportBusSalutation}"Business Salutation",{/if} {if $select.exportBusFname}"Business First Name",{/if} {if $select.exportBusLname}"Business Last Name",{/if} {if $select.exportTitle}"Title",{/if} @@ -55,6 +56,7 @@ {if $select.exportAltEmail}"{$m.alt_email}",{/if} {if $select.exportMemberType}"{$m.member_type}",{/if} {if $select.exportOrg}"{$m.org}",{/if} +{if $select.exportBusSalutation}"{$m.business_salutation}",{/if} {if $select.exportBusFname}"{$m.business_fname}",{/if} {if $select.exportBusLname}"{$m.business_lname}",{/if} {if $select.exportTitle}"{$m.title}",{/if} diff --git a/views/admin/contacts/edit.html b/views/admin/contacts/edit.html index 426319b..0b67efb 100644 --- a/views/admin/contacts/edit.html +++ b/views/admin/contacts/edit.html @@ -379,7 +379,7 @@ {/if} - + Profile Image {if $contactInfo.fieldData.image} @@ -510,6 +510,13 @@ + + Salutation + + + {if $contactInfo.fieldFail.business_salutation}

{$contactInfo.fieldFail.business_salutation}

{/if} + + First Name diff --git a/views/admin/contacts/index.html b/views/admin/contacts/index.html index 902e660..2642c83 100644 --- a/views/admin/contacts/index.html +++ b/views/admin/contacts/index.html @@ -163,6 +163,7 @@ + -- 2.17.1