From c18a9bc02c195a87735d5e1bcd44c2f186325b40 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Mon, 16 Apr 2018 16:59:57 -0400 Subject: [PATCH] More requested fixes and start on custom fields for specific levels. Fixed incorrect capitalization in displayed text in registrations.html Moved Submit button on registration and checkout pages. Added management option to enable/dissable navigation aids. Added note to new attendee custom form fields showing the Form ID for level --- classes/data/dataManagement.php | 9 +++++ index.php | 4 +- models/front/registrations/checkout.php | 2 +- models/front/registrations/registration.php | 3 +- ...0.0.27.sql => create_database_V0.0.28.sql} | 1 + setup/databaseScripts/dbVersions.php | 3 +- ..._V0.0.26.sql => drop_database_V0.0.28.sql} | 0 .../update_database_V0.0.28.sql | 9 +++++ views/admin/management/registrations.html | 10 +++++ views/front/registrations/cart.html | 5 ++- views/front/registrations/checkout.html | 14 ++++--- views/front/registrations/registration.html | 37 +++++++++++++------ 12 files changed, 74 insertions(+), 23 deletions(-) rename setup/databaseScripts/{create_database_V0.0.27.sql => create_database_V0.0.28.sql} (99%) rename setup/databaseScripts/{drop_database_V0.0.26.sql => drop_database_V0.0.28.sql} (100%) create mode 100644 setup/databaseScripts/update_database_V0.0.28.sql diff --git a/classes/data/dataManagement.php b/classes/data/dataManagement.php index 5a8d9fe..78b87c3 100644 --- a/classes/data/dataManagement.php +++ b/classes/data/dataManagement.php @@ -381,8 +381,17 @@ class GlmDataRegistrationsManagement extends GlmDataAbstract 'type' => 'checkbox', 'use' => 'a', 'default' => 0 + ), + + // Show additional navigation aids + 'reg_show_navigation_aids' => array ( + 'field' => 'reg_show_navigation_aids', + 'type' => 'checkbox', + 'use' => 'a', + 'default' => 0 ) + ); } diff --git a/index.php b/index.php index 1bf3c97..0917906 100644 --- a/index.php +++ b/index.php @@ -44,10 +44,10 @@ if (!defined('ABSPATH')) { * version from this plugin. */ define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION', '0.0.1'); -define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.27'); +define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.28'); // This is the minimum version of the GLM Members DB plugin require for this plugin. -define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.10.17'); +define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_MIN_MEMBERS_REQUIRED_VERSION', '2.10.27'); // Check if plugin version is not current in WordPress option and if needed updated it if (GLM_MEMBERS_REGISTRATIONS_PLUGIN_VERSION != get_option('glmMembersRegistrationsPluginVersion')) { diff --git a/models/front/registrations/checkout.php b/models/front/registrations/checkout.php index 168742a..f73a339 100644 --- a/models/front/registrations/checkout.php +++ b/models/front/registrations/checkout.php @@ -377,7 +377,7 @@ class GlmMembersFront_registrations_checkout extends GlmRegCartSupport 'eventCustomFieldsFidPrefix' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_SLUG.'-customfields-reg-event-' ); - // echo "
".print_r($regAccount,1)."
"; + // echo "
".print_r($templateData,1)."
"; // Return status, any suggested view, and any data to controller return array( diff --git a/models/front/registrations/registration.php b/models/front/registrations/registration.php index 0766c89..573981e 100644 --- a/models/front/registrations/registration.php +++ b/models/front/registrations/registration.php @@ -196,7 +196,7 @@ foreach ( $regEvent['reg_class'] as $key => $rClass ) { $classStartingTime = ''; - // echo '
$rClass: ' . print_r( $rClass, true ) . '
'; + // echo '
$rClass '."($key): " . print_r( $rClass, true ) . '
'; // Pull the rate data if ( isset( $rClass['times'] ) && is_array( $rClass['times'] ) && count( $rClass['times'] ) > 0 ) { @@ -223,6 +223,7 @@ // } } $rClass['startingTime'] = $classStartingTime['start_datetime']['datetime']; + $rClass['id'] = $key; $jsonClasses[] = json_encode( $rClass, JSON_NUMERIC_CHECK ); } else if ( !isset( $rClass['times'] ) || empty( $rClass['times'] ) ) { unset( $regEvent['reg_class'][$key] ); diff --git a/setup/databaseScripts/create_database_V0.0.27.sql b/setup/databaseScripts/create_database_V0.0.28.sql similarity index 99% rename from setup/databaseScripts/create_database_V0.0.27.sql rename to setup/databaseScripts/create_database_V0.0.28.sql index 7d06953..49f498e 100644 --- a/setup/databaseScripts/create_database_V0.0.27.sql +++ b/setup/databaseScripts/create_database_V0.0.28.sql @@ -101,6 +101,7 @@ CREATE TABLE {prefix}management ( reg_bill_info_req_merchant_call SMALLINT NULL, -- Misc Options reg_medical_info BOOLEAN NULL, -- This site can ask for "Medical Info" - set in main category of an event + reg_show_navigation_aids BOOLEAN NULL, -- No, not marine navigational aids, this enables additional text, arrows, etc to direct a user to do something specific that would not normally be required. PRIMARY KEY (id) ); diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index a2369af..7dae6f2 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -40,7 +40,8 @@ $glmMembersRegistrationsDbVersions = array( '0.0.24' => array('version' => '0.0.24', 'tables' => 18, 'date' => '01/19/2018'), '0.0.25' => array('version' => '0.0.25', 'tables' => 18, 'date' => '02/02/2018'), '0.0.26' => array('version' => '0.0.26', 'tables' => 18, 'date' => '03/27/2018'), - '0.0.27' => array('version' => '0.0.27', 'tables' => 18, 'date' => '04/05/2018') + '0.0.27' => array('version' => '0.0.27', 'tables' => 18, 'date' => '04/05/2018'), + '0.0.28' => array('version' => '0.0.28', 'tables' => 18, 'date' => '04/12/2018') ); diff --git a/setup/databaseScripts/drop_database_V0.0.26.sql b/setup/databaseScripts/drop_database_V0.0.28.sql similarity index 100% rename from setup/databaseScripts/drop_database_V0.0.26.sql rename to setup/databaseScripts/drop_database_V0.0.28.sql diff --git a/setup/databaseScripts/update_database_V0.0.28.sql b/setup/databaseScripts/update_database_V0.0.28.sql new file mode 100644 index 0000000..7fd33bd --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.28.sql @@ -0,0 +1,9 @@ +-- Gaslight Media Members Database - Registratiuons Add-On +-- File Updated: 2018-04-12 +-- Database Version: 0.0.28 +-- 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 + +ALTER TABLE {prefix}management ADD COLUMN reg_show_navigation_aids BOOLEAN; diff --git a/views/admin/management/registrations.html b/views/admin/management/registrations.html index ba71fed..5319d48 100644 --- a/views/admin/management/registrations.html +++ b/views/admin/management/registrations.html @@ -250,6 +250,16 @@ {if $regSettings.fieldFail.reg_merchant_solutions_merchant_email}

{$regSettings.fieldFail.reg_merchant_solutions_merchant_email}

{/if} + + +

Other General Options

+ + + Display additional navigation aids + + + +

Billing Information Fields

diff --git a/views/front/registrations/cart.html b/views/front/registrations/cart.html index f24caaf..baaa3f6 100644 --- a/views/front/registrations/cart.html +++ b/views/front/registrations/cart.html @@ -68,7 +68,10 @@ {else}
-
You have not yet submitted your {$terms.reg_term_registration}! Proceed to Checkout
+ {if $settings.reg_show_navigation_aids} +
You have not yet submitted your {$terms.reg_term_registration}! + {/if} + Proceed to Checkout
{/if} diff --git a/views/front/registrations/checkout.html b/views/front/registrations/checkout.html index 29de7aa..36ca25f 100644 --- a/views/front/registrations/checkout.html +++ b/views/front/registrations/checkout.html @@ -39,13 +39,14 @@ - + {if $settings.reg_show_navigation_aids} +
+ NOTE: Your {$terms.reg_term_registration} is not complete until you click the "Submit {$terms.reg_term_registration_cap} Request" button at the bottom of this page. +
+ {/if}
@@ -311,12 +312,13 @@ {else}
(There is no charge for your request.)
{/if} -
+ {if $settings.reg_show_navigation_aids} +
Your {$terms.reg_term_registration} is not complete until you click here! + {/if}
-
Please wait while we process your {$terms.reg_term_registration} request. If you don't see a new page, your {$terms.reg_term_registration} request may not have been processed.
diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index 549b404..3629622 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -98,6 +98,20 @@
+
+
+
+ {/literal} + {if $settings.reg_show_navigation_aids} + {literal} + You have not yet submitted your {/literal}{$terms.reg_term_registration}{literal}! + {/literal} + {/if} + {literal} + +
+
+
{/literal}
@@ -139,13 +153,6 @@ {/if}
{literal} -
-
-
You have not yet submitted your {/literal}{$terms.reg_term_registration}{literal}! - -
-
-
{/literal} @@ -220,7 +227,7 @@
-
Email is required for notifications
+
Email is required to receive notifications
Email Address
@@ -297,14 +304,22 @@
{/literal}{if apply_filters('glm-members-customfields-plugin-active', false)}{literal} - {/literal}{$fid = "glm_reg_customfields_reg_event_attendee_$regEventId"}{literal} + {/literal} + {$fid_event = "glm_reg_customfields_reg_event_attendee_$regEventId"} + {literal} {/literal}{if apply_filters('glm-members-customfields-have-fields', false, $fid)}{literal}

Additional Info Needed

{/literal}{/if}{literal}
{/literal} - {apply_filters( 'glm-members-customfields-form-display', '', $fid )} + +

+Here's the Form ID we need to use to get the custom fields for registrants of this level only.
+glm_reg_customfields_reg_event_{$regEventId}_level_{literal}<%- reg_class.id %>{/literal} +

+ + {apply_filters( 'glm-members-customfields-form-display', '', $fid_event )} {literal}
-- 2.17.1