From 58c16aa51fc69a11c207ce364b2658b74855419b Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Tue, 4 Apr 2017 15:00:31 -0400 Subject: [PATCH] Added county enable/dissable to dataSettingsGenera and management misc settings. Added county to terms and set various places where that term is referenced to use those. Updated database with enable_counties in settings_general and various county terms in settings_terms. Started adding test for counties to Members dashboard. --- classes/data/settings/dataSettingsGeneral.php | 6 +++ classes/data/settings/dataSettingsTerms.php | 35 ++++++++++++++++ css/admin.css | 10 +++++ index.php | 2 +- ...1.1.27.sql => create_database_V1.1.28.sql} | 20 ++++++++- setup/databaseScripts/dbVersions.php | 1 + ..._V1.1.27.sql => drop_database_V1.1.28.sql} | 0 .../update_database_V1.1.28.sql | 38 +++++++++++++++++ views/admin/management/index.html | 6 +++ views/admin/management/terms.html | 42 +++++++++++++++++++ views/admin/members/index.html | 6 +++ views/admin/settings/counties.html | 24 +++++------ views/admin/settings/header.html | 2 +- 13 files changed, 176 insertions(+), 16 deletions(-) rename setup/databaseScripts/{create_database_V1.1.27.sql => create_database_V1.1.28.sql} (97%) rename setup/databaseScripts/{drop_database_V1.1.27.sql => drop_database_V1.1.28.sql} (100%) create mode 100644 setup/databaseScripts/update_database_V1.1.28.sql diff --git a/classes/data/settings/dataSettingsGeneral.php b/classes/data/settings/dataSettingsGeneral.php index 4735f8ac..a1766091 100644 --- a/classes/data/settings/dataSettingsGeneral.php +++ b/classes/data/settings/dataSettingsGeneral.php @@ -226,6 +226,12 @@ class GlmDataSettingsGeneral extends GlmDataAbstract 'use' => 'a' ), + // Enable Counties + 'enable_counties' => array( + 'field' => 'enable_counties', + 'type' => 'checkbox', + 'use' => 'a' + ), /* * Front-end Member Search Options diff --git a/classes/data/settings/dataSettingsTerms.php b/classes/data/settings/dataSettingsTerms.php index 61f2a2b6..a2fcf2fc 100644 --- a/classes/data/settings/dataSettingsTerms.php +++ b/classes/data/settings/dataSettingsTerms.php @@ -263,6 +263,13 @@ class GlmDataSettingsTerms extends GlmDataAbstract 'use' => 'a' ), + // Tab Configure/Counties + 'term_admin_menu_configure_counties' => array( + 'field' => 'term_admin_menu_configure_counties', + 'type' => 'text', + 'use' => 'a' + ), + // Tab Configure/Regions 'term_admin_menu_configure_regions' => array( 'field' => 'term_admin_menu_configure_regions', @@ -351,6 +358,34 @@ class GlmDataSettingsTerms extends GlmDataAbstract 'use' => 'a' ), + // County + 'term_county' => array( + 'field' => 'term_county', + 'type' => 'text', + 'use' => 'a' + ), + + // County Cap + 'term_county_cap' => array( + 'field' => 'term_county_cap', + 'type' => 'text', + 'use' => 'a' + ), + + // County Plur + 'term_county_plur' => array( + 'field' => 'term_county_plur', + 'type' => 'text', + 'use' => 'a' + ), + + // County Plur Cap + 'term_county_plur_cap' => array( + 'field' => 'term_county_plur_cap', + 'type' => 'text', + 'use' => 'a' + ), + // Facility 'term_facility' => array( 'field' => 'term_facility', diff --git a/css/admin.css b/css/admin.css index e5c75a7d..94a3eca2 100644 --- a/css/admin.css +++ b/css/admin.css @@ -129,6 +129,12 @@ width: 10%; margin-bottom: 5px; } +.glm-admin-table-border { + border: 2px #ddd solid; +} +.glm-admin-table-close-spaced { + line-height: .6em; +} .glm-admin-table th, .glm-admin-table-narrow th { text-align: left; @@ -142,6 +148,10 @@ vertical-align: top; padding-bottom: .2em; } +.glm-admin-table-bordered tr td { + border: 2px #ddd solid; + border-collapse: collapse; +} .glm-admin-table thead th{ font-size: 15px; font-weight: bold; diff --git a/index.php b/index.php index 2c85e7ba..e8adc62c 100644 --- a/index.php +++ b/index.php @@ -39,7 +39,7 @@ */ define('GLM_MEMBERS_PLUGIN_VERSION', '2.9.12'); -define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.27'); +define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.28'); // Check if plugin version is not current in WordPress option and if needed updated it if (GLM_MEMBERS_PLUGIN_VERSION != get_option('glmMembersDatabasePluginVersion')) { diff --git a/setup/databaseScripts/create_database_V1.1.27.sql b/setup/databaseScripts/create_database_V1.1.28.sql similarity index 97% rename from setup/databaseScripts/create_database_V1.1.27.sql rename to setup/databaseScripts/create_database_V1.1.28.sql index 8ecbb4c9..5765efc6 100644 --- a/setup/databaseScripts/create_database_V1.1.27.sql +++ b/setup/databaseScripts/create_database_V1.1.28.sql @@ -291,6 +291,7 @@ CREATE TABLE {prefix}settings_general ( phone_infix TINYTEXT DEFAULT NULL, phone_format TINYTEXT DEFAULT NULL, default_state TINYTEXT DEFAULT NULL, + enable_counties BOOLEAN DEFAULT '1', list_show_map BOOLEAN DEFAULT '1', list_show_list BOOLEAN DEFAULT '1', list_order_list SMALLINT DEFAULT '10', @@ -400,9 +401,9 @@ CREATE TABLE {prefix}settings_general ( -- Set default entry INSERT INTO {prefix}settings_general - ( id, time_zone, canonical_member_page, list_logo_size, list_map_logo_size, detail_logo_size, detail_map_logo_size, list_pagination, list_pagination_count) + ( id, time_zone, canonical_member_page, list_logo_size, list_map_logo_size, detail_logo_size, detail_map_logo_size, list_pagination, list_pagination_count, enable_counties) VALUES - ( 1, 'America/Detroit', 'member-detail', 'large', 'thumb', 'large', 'thumb', '1', 20 ) + ( 1, 'America/Detroit', 'member-detail', 'large', 'thumb', 'large', 'thumb', '1', 20, 1 ) ; ---- @@ -431,6 +432,7 @@ CREATE TABLE {prefix}settings_terms ( term_admin_menu_configure_accom_types TINYTEXT NULL, term_admin_menu_configure_amenities TINYTEXT NULL, term_admin_menu_configure_cities TINYTEXT NULL, + term_admin_menu_configure_counties TINYTEXT NULL, term_admin_menu_configure_regions TINYTEXT NULL, term_admin_menu_settings_general TINYTEXT NULL, term_admin_menu_settings_terms TINYTEXT NULL, @@ -443,6 +445,10 @@ CREATE TABLE {prefix}settings_terms ( term_location_cap TINYTEXT NULL, term_location_plur TINYTEXT NULL, term_location_plur_cap TINYTEXT NULL, + term_county TINYTEXT NULL, + term_county_cap TINYTEXT NULL, + term_county_plur TINYTEXT NULL, + term_county_plur_cap TINYTEXT NULL, term_facility TINYTEXT NULL, term_facility_cap TINYTEXT NULL, term_facility_plur TINYTEXT NULL, @@ -485,6 +491,7 @@ INSERT INTO {prefix}settings_terms term_admin_menu_configure_accom_types, term_admin_menu_configure_amenities, term_admin_menu_configure_cities, + term_admin_menu_configure_counties, term_admin_menu_configure_regions, term_admin_menu_settings_general, term_admin_menu_settings_terms, @@ -497,6 +504,10 @@ INSERT INTO {prefix}settings_terms term_location_cap, term_location_plur, term_location_plur_cap, + term_county, + term_county_cap, + term_county_plur, + term_county_plur_cap, term_facility, term_facility_cap, term_facility_plur, @@ -534,6 +545,7 @@ INSERT INTO {prefix}settings_terms 'Accommodation Types', 'Amenities', 'Cities', + 'Counties', 'Regions', 'General Settings', 'Terms & Phrases', @@ -546,6 +558,10 @@ INSERT INTO {prefix}settings_terms 'Location', 'locations', 'Locations', + 'county', + 'County', + 'counties', + 'Counties', 'facility', 'Facility', 'facilities', diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index b5e81436..040fc30c 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -59,6 +59,7 @@ $glmMembersDbVersions = array( '1.1.25' => array('version' => '1.1.25', 'tables' => 18, 'date' => '02/02/17'), '1.1.26' => array('version' => '1.1.26', 'tables' => 18, 'date' => '03/08/17'), '1.1.27' => array('version' => '1.1.27', 'tables' => 19, 'date' => '03/29/17'), + '1.1.28' => array('version' => '1.1.28', 'tables' => 19, 'date' => '04/04/17') ); diff --git a/setup/databaseScripts/drop_database_V1.1.27.sql b/setup/databaseScripts/drop_database_V1.1.28.sql similarity index 100% rename from setup/databaseScripts/drop_database_V1.1.27.sql rename to setup/databaseScripts/drop_database_V1.1.28.sql diff --git a/setup/databaseScripts/update_database_V1.1.28.sql b/setup/databaseScripts/update_database_V1.1.28.sql new file mode 100644 index 00000000..4173fa79 --- /dev/null +++ b/setup/databaseScripts/update_database_V1.1.28.sql @@ -0,0 +1,38 @@ +-- Gaslight Media Members Database +-- File Created: 03/29/17 +-- Database Version: 1.1.27 +-- 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 +-- Sets which character to use to separate phone numbers + +ALTER TABLE {prefix}settings_general ADD COLUMN enable_counties BOOLEAN DEFAULT 1; + +---- + +ALTER TABLE {prefix}settings_terms ADD COLUMN term_admin_menu_configure_counties TINYTEXT; + +---- + +ALTER TABLE {prefix}settings_terms ADD COLUMN term_county TINYTEXT; + +---- + +ALTER TABLE {prefix}settings_terms ADD COLUMN term_county_cap TINYTEXT; + +---- + +ALTER TABLE {prefix}settings_terms ADD COLUMN term_county_plur TINYTEXT; + +---- + +ALTER TABLE {prefix}settings_terms ADD COLUMN term_county_plur_cap TINYTEXT; + +---- + +UPDATE {prefix}settings_general SET enable_counties = 1 WHERE id = 1; + +---- + +UPDATE {prefix}settings_terms SET term_admin_menu_configure_counties = 'Counties', term_county = 'county', term_county_cap = 'County', term_county_plur = 'counties', term_county_plur_cap = 'Counties' WHERE id = 1; diff --git a/views/admin/management/index.html b/views/admin/management/index.html index e6a3dff4..bc3881a3 100644 --- a/views/admin/management/index.html +++ b/views/admin/management/index.html @@ -97,6 +97,12 @@ (Only needed until Members are removed from GLM Associate.) + + Enable Member Counties: + + + + Google Maps API Key: diff --git a/views/admin/management/terms.html b/views/admin/management/terms.html index 9e6b67b9..fc7c1aaf 100644 --- a/views/admin/management/terms.html +++ b/views/admin/management/terms.html @@ -148,6 +148,13 @@ {if $termSettings.fieldFail.term_admin_menu_configure_cities}

{$termSettings.fieldFail.term_admin_menu_configure_cities}

{/if} + + Counties: + + + {if $termSettings.fieldFail.term_admin_menu_configure_counties}

{$termSettings.fieldFail.term_admin_menu_configure_counties}

{/if} + + Regions: @@ -272,6 +279,41 @@ + + County: + + + + + + + + + + + + + + + + + + +
Normal: + + {if $termSettings.fieldFail.term_county}

{$termSettings.fieldFail.term_county}

{/if} +
Capitalized: + + {if $termSettings.fieldFail.term_county_cap}

{$termSettings.fieldFail.term_county_cap}

{/if} +
Plural: + + {if $termSettings.fieldFail.term_county_plur}

{$termSettings.fieldFail.term_county_plur}

{/if} +
Plural Capitalized: + + {if $termSettings.fieldFail.term_county_plur_cap}

{$termSettings.fieldFail.term_county_plur_cap}

{/if} +
+ + Facility: diff --git a/views/admin/members/index.html b/views/admin/members/index.html index 83d22c04..7183f0a9 100644 --- a/views/admin/members/index.html +++ b/views/admin/members/index.html @@ -37,6 +37,12 @@ Click here to add Cities. {/if} + {if !$haveCounties} + + You do not have any {$terms.term_county_plur} setup. + Click here to add {$terms.term_county_plur_cap}. + + {/if} {if !$haveRegions} You do not have any Regions setup. diff --git a/views/admin/settings/counties.html b/views/admin/settings/counties.html index 5222b273..24996abd 100644 --- a/views/admin/settings/counties.html +++ b/views/admin/settings/counties.html @@ -1,14 +1,14 @@ {include file='admin/settings/header.html'} -
Add a County
-
+
Add a {$terms.term_county_cap}
+
- + @@ -28,28 +28,28 @@
County Name:{$terms.term_county_cap} Name:

* Required

Cancel - +
-
+
-

Are you sure you want to delete this county?

-

Yes, delete this county

+

Are you sure you want to delete this {$terms.term_county}?

+

Yes, delete this {$terms.term_county}

Cancel

-
+
- + @@ -69,17 +69,17 @@
County Name:{$terms.term_county_cap} Name:

* Required

Cancel - +
-

Counties

+

{$terms.term_county_plur_cap}

- + diff --git a/views/admin/settings/header.html b/views/admin/settings/header.html index 95ab38b7..83a0d87d 100644 --- a/views/admin/settings/header.html +++ b/views/admin/settings/header.html @@ -11,7 +11,7 @@ Cities {if $enable_members} Regions - Counties + {$terms.term_admin_menu_configure_counties} {/if} {foreach $addOnTabs as $a} {$a.text} -- 2.17.1
IDCounty{$terms.term_county_cap} Description Short Description