From: Steve Sutton Date: Mon, 14 Oct 2019 17:31:50 +0000 (-0400) Subject: Adding Salutation to the company info section. X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Ffeature%2Frevamp;p=WP-Plugins%2Fglm-member-db-contacts.git Adding Salutation to the company info section. Adding new field. --- 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.8.sql deleted file mode 100644 index af7da90..0000000 --- a/setup/databaseScripts/create_database_V0.0.8.sql +++ /dev/null @@ -1,93 +0,0 @@ --- Gaslight Media Members Database --- File Created: 12/09/14 15:27:15 --- Database Version: 0.0.8 --- 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 - business_phone TINYTEXT NULL, -- Org Phone in Directory - 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)) - ); - ----- - --- Settings -CREATE TABLE {prefix}settings ( - id INT NOT NULL AUTO_INCREMENT, - enable_custom_contact BOOLEAN DEFAULT false, -- Enable / Disable Custom Contact - enable_contact_info BOOLEAN DEFAULT true, -- Enable / Disable Contact Info - enable_profile_image BOOLEAN DEFAULT true, -- Enable / Disable Profile Image - enable_billing_info BOOLEAN DEFAULT false, -- Enable / Disable Billing Info - enable_organization BOOLEAN DEFAULT false, -- Enable / Disable Organization - PRIMARY KEY (id) -); - ----- - --- Insert into settings -INSERT INTO {prefix}settings ( id,enable_custom_contact, enable_contact_info, enable_profile_image, enable_billing_info, enable_organization ) VALUES ( 1, false, true, true, false, false ); diff --git a/setup/databaseScripts/create_database_V0.0.9.sql b/setup/databaseScripts/create_database_V0.0.9.sql new file mode 100644 index 0000000..f1bac4d --- /dev/null +++ b/setup/databaseScripts/create_database_V0.0.9.sql @@ -0,0 +1,94 @@ +-- Gaslight Media Members Database +-- File Created: 12/09/14 15:27:15 +-- Database Version: 0.0.9 +-- 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_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 + 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 + business_phone TINYTEXT NULL, -- Org Phone in Directory + 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)) + ); + +---- + +-- Settings +CREATE TABLE {prefix}settings ( + id INT NOT NULL AUTO_INCREMENT, + enable_custom_contact BOOLEAN DEFAULT false, -- Enable / Disable Custom Contact + enable_contact_info BOOLEAN DEFAULT true, -- Enable / Disable Contact Info + enable_profile_image BOOLEAN DEFAULT true, -- Enable / Disable Profile Image + enable_billing_info BOOLEAN DEFAULT false, -- Enable / Disable Billing Info + enable_organization BOOLEAN DEFAULT false, -- Enable / Disable Organization + PRIMARY KEY (id) +); + +---- + +-- Insert into settings +INSERT INTO {prefix}settings ( id,enable_custom_contact, enable_contact_info, enable_profile_image, enable_billing_info, enable_organization ) VALUES ( 1, false, true, true, false, false ); 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 @@ +