From feacd428896bd700cdc723ca8801e6429597dd68 Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Mon, 14 May 2018 16:18:30 -0400 Subject: [PATCH] Addional features and fixes. Added attendee_max_per_reg to reg event edit page Page top text and general terms no longer required Added inactivity time driven dialog box to warn that submission is not complete. Added option in Management to enable dialog box warning. Updated database with reg_not_submitted_dialog option. Updated Management data class with reg_not_submitted_dialog. --- classes/data/dataManagement.php | 8 +++ classes/data/dataMisc.php | 5 -- index.php | 2 +- ...0.0.29.sql => create_database_V0.0.30.sql} | 2 + setup/databaseScripts/dbVersions.php | 3 +- ..._V0.0.29.sql => drop_database_V0.0.30.sql} | 0 .../update_database_V0.0.30.sql | 15 +++++ views/admin/management/registrations.html | 6 ++ views/admin/registrations/eventEdit.html | 8 +++ views/front/registrations/cart.html | 61 +++++++++++++++++++ views/front/registrations/checkout.html | 60 ++++++++++++++++++ views/front/registrations/registration.html | 60 +++++++++++++++++- 12 files changed, 222 insertions(+), 8 deletions(-) rename setup/databaseScripts/{create_database_V0.0.29.sql => create_database_V0.0.30.sql} (99%) rename setup/databaseScripts/{drop_database_V0.0.29.sql => drop_database_V0.0.30.sql} (100%) create mode 100644 setup/databaseScripts/update_database_V0.0.30.sql diff --git a/classes/data/dataManagement.php b/classes/data/dataManagement.php index 33cb40d..1aa84ae 100644 --- a/classes/data/dataManagement.php +++ b/classes/data/dataManagement.php @@ -399,6 +399,14 @@ class GlmDataRegistrationsManagement extends GlmDataAbstract 'default' => 0 ), + // Not Submitted Dialog Flag + 'reg_not_submitted_dialog' => array ( + 'field' => 'reg_not_submitted_dialog', + 'type' => 'checkbox', + 'use' => 'a', + 'default' => 0, + ), + // Show additional navigation aids 'reg_show_navigation_aids' => array ( 'field' => 'reg_show_navigation_aids', diff --git a/classes/data/dataMisc.php b/classes/data/dataMisc.php index 00cee5a..85e7039 100644 --- a/classes/data/dataMisc.php +++ b/classes/data/dataMisc.php @@ -112,7 +112,6 @@ class GlmDataRegistrationsMisc extends GlmDataAbstract 'reg_bulletin' => array ( 'field' => 'reg_bulletin', 'type' => 'text', - 'required' => true, 'use' => 'a' ), @@ -120,7 +119,6 @@ class GlmDataRegistrationsMisc extends GlmDataAbstract 'cart_page_text' => array ( 'field' => 'cart_page_text', 'type' => 'text', - 'required' => true, 'use' => 'a' ), @@ -128,7 +126,6 @@ class GlmDataRegistrationsMisc extends GlmDataAbstract 'checkout_page_text' => array ( 'field' => 'checkout_page_text', 'type' => 'text', - 'required' => true, 'use' => 'a' ), @@ -136,7 +133,6 @@ class GlmDataRegistrationsMisc extends GlmDataAbstract 'summary_page_text' => array ( 'field' => 'summary_page_text', 'type' => 'text', - 'required' => true, 'use' => 'a' ), @@ -144,7 +140,6 @@ class GlmDataRegistrationsMisc extends GlmDataAbstract 'reg_terms' => array ( 'field' => 'reg_terms', 'type' => 'text', - 'required' => true, 'use' => 'a' ), diff --git a/index.php b/index.php index e1d4db5..4a93e0b 100644 --- a/index.php +++ b/index.php @@ -44,7 +44,7 @@ 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.29'); +define('GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_VERSION', '0.0.30'); // 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.27'); diff --git a/setup/databaseScripts/create_database_V0.0.29.sql b/setup/databaseScripts/create_database_V0.0.30.sql similarity index 99% rename from setup/databaseScripts/create_database_V0.0.29.sql rename to setup/databaseScripts/create_database_V0.0.30.sql index 9b6a9fa..37eff7e 100644 --- a/setup/databaseScripts/create_database_V0.0.29.sql +++ b/setup/databaseScripts/create_database_V0.0.30.sql @@ -102,6 +102,7 @@ CREATE TABLE {prefix}management ( -- Misc Options reg_request_hold_days SMALLINT NULL, -- Number of days past last update that a request will be retained in "CART" status. req_account_hold_days SMALLINT NULL, -- Number of days past last update that an account will be retained when there are no requests or registrants referring to it. + reg_not_submitted_dialog BOOLEAN NULL, -- Flag to show page not submitted dialog boxes 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) @@ -203,6 +204,7 @@ CREATE TABLE {prefix}payment_code ( code TINYTEXT NULL, -- Text code user must enter to use amount FLOAT, -- Amount of discount if not type "Free" - Either $ amount or percent expire_date DATE NULL, -- Expiration Date + descr TEXT NULL, PRIMARY KEY (id), INDEX (ref_dest), diff --git a/setup/databaseScripts/dbVersions.php b/setup/databaseScripts/dbVersions.php index 88444c0..9e43b5e 100644 --- a/setup/databaseScripts/dbVersions.php +++ b/setup/databaseScripts/dbVersions.php @@ -42,7 +42,8 @@ $glmMembersRegistrationsDbVersions = array( '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.28' => array('version' => '0.0.28', 'tables' => 18, 'date' => '04/12/2018'), - '0.0.29' => array('version' => '0.0.29', 'tables' => 18, 'date' => '05/04/2018') + '0.0.29' => array('version' => '0.0.29', 'tables' => 18, 'date' => '05/04/2018'), + '0.0.30' => array('version' => '0.0.30', 'tables' => 18, 'date' => '05/14/2018') ); diff --git a/setup/databaseScripts/drop_database_V0.0.29.sql b/setup/databaseScripts/drop_database_V0.0.30.sql similarity index 100% rename from setup/databaseScripts/drop_database_V0.0.29.sql rename to setup/databaseScripts/drop_database_V0.0.30.sql diff --git a/setup/databaseScripts/update_database_V0.0.30.sql b/setup/databaseScripts/update_database_V0.0.30.sql new file mode 100644 index 0000000..c6e82da --- /dev/null +++ b/setup/databaseScripts/update_database_V0.0.30.sql @@ -0,0 +1,15 @@ +-- Gaslight Media Members Database - Registratiuons Add-On +-- File Updated: 2018-04-12 +-- Database Version: 0.0.30 +-- 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_not_submitted_dialog BOOLEAN; + +---- + +UPDATE {prefix}management SET reg_not_submitted_dialog = false; + + diff --git a/views/admin/management/registrations.html b/views/admin/management/registrations.html index 58d2c54..30371b1 100644 --- a/views/admin/management/registrations.html +++ b/views/admin/management/registrations.html @@ -272,6 +272,12 @@ + + Display not yet submitted pop-ups + + + +

Billing Information Fields

diff --git a/views/admin/registrations/eventEdit.html b/views/admin/registrations/eventEdit.html index 489d7a4..85c3b28 100644 --- a/views/admin/registrations/eventEdit.html +++ b/views/admin/registrations/eventEdit.html @@ -69,6 +69,14 @@ {if $regEvent.fieldFail.attendee_max}

{$regEvent.fieldFail.attendee_max}

{/if}
+ + Maximum {$terms.reg_term_attendee_plur_cap} per request: + + This is the maximum number of {$terms.reg_term_attendee_plur} per submission for this {$terms.reg_term_event}. 0 = unlimited.
+ + {if $regEvent.fieldFail.attendee_max_per_reg}

{$regEvent.fieldFail.attendee_max_per_reg}

{/if}
+ + {$terms.reg_term_attendee_plur_cap} Hold Time (minutes): diff --git a/views/front/registrations/cart.html b/views/front/registrations/cart.html index 34acb81..3c16338 100644 --- a/views/front/registrations/cart.html +++ b/views/front/registrations/cart.html @@ -20,6 +20,17 @@ {/if} +{if $haveCart && $settings.reg_not_submitted_dialog} +
+

+ Your registrations have not yet been submitted! +

+

+ To complete your registrations, please click on the "Proceed to Checkout" button. +

+
+{/if} + {if $cartPageText}
{$cartPageText} @@ -76,5 +87,55 @@ {/if} + diff --git a/views/front/registrations/checkout.html b/views/front/registrations/checkout.html index 6afbd98..f024f4f 100644 --- a/views/front/registrations/checkout.html +++ b/views/front/registrations/checkout.html @@ -32,6 +32,18 @@ {/if} {if $haveCart} + + {if $settings.reg_not_submitted_dialog} +
+

+ Your registrations have not yet been submitted! +

+

+ To complete your registrations, please click on the "Submit {$terms.reg_term_registration_cap} Request" button at the bottom of this page. +

+
+ {/if} +
@@ -285,6 +297,7 @@

Terms and Conditions

You must check the boxes below to confirm that you agree to the Terms and Conditions for each {$terms.reg_term_event}.
+ {if $globalTerms != ''}
 
@@ -292,6 +305,7 @@
+ {/if} {foreach $cart.events as $event} {if $event.event_terms != ''}
@@ -449,5 +463,51 @@ $(".expire-input").mask("00/00"); $(".cvv-input").mask("000#"); + + // Registration not submitted Dialog actions + {if $settings.reg_not_submitted_dialog} + + var notSubmittedTimer; + notSubmittedDialog = $( "#regNotSubmittedDialog" ).dialog({ + autoOpen: false, + width: 600, + open: function(event,ui) { + clearInterval(notSubmittedTimer); + }, + close: function(event,ui) { + resetNotSubmittedTimer(); + }, + buttons: [ + { + text: "Close", + click: function() { + resetNotSubmittedTimer(); + $(this).dialog("close"); + } + } + ] + }); + function startNotSubmittedTimer() { + notSubmittedTimer = setInterval( function() { + $( "#regNotSubmittedDialog" ).dialog( "open" ); + clearInterval(notSubmittedTimer); + }, 30000); + } + function resetNotSubmittedTimer() { + if (notSubmittedTimer) { + clearInterval(notSubmittedTimer); + } + startNotSubmittedTimer(); + } + $(document).keydown( function(){ + resetNotSubmittedTimer() + }); + $(document).click( function() { + resetNotSubmittedTimer() + }); + startNotSubmittedTimer(); + + {/if} + }); diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index 60736d0..9f490b0 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -449,7 +449,18 @@ {$reg_bulletin}
{/if} - + + {if $settings.reg_not_submitted_dialog} +
+

+ Your registrations have not yet been submitted! +

+

+ To complete your registrations, please click on the "Continue" button + to proceed to the "Selected {$terms.reg_term_registration_plur_cap}" page. +

+
+ {/if}
@@ -647,5 +658,52 @@ jQuery(function($){ } }); + + + // Registration not submitted Dialog actions + {if $settings.reg_not_submitted_dialog} + + var notSubmittedTimer; + notSubmittedDialog = $( "#regNotSubmittedDialog" ).dialog({ + autoOpen: false, + width: 600, + open: function(event,ui) { + clearInterval(notSubmittedTimer); + }, + close: function(event,ui) { + resetNotSubmittedTimer(); + }, + buttons: [ + { + text: "Close", + click: function() { + resetNotSubmittedTimer(); + $(this).dialog("close"); + } + } + ] + }); + function startNotSubmittedTimer() { + notSubmittedTimer = setInterval( function() { + $( "#regNotSubmittedDialog" ).dialog( "open" ); + clearInterval(notSubmittedTimer); + }, 30000); + } + function resetNotSubmittedTimer() { + if (notSubmittedTimer) { + clearInterval(notSubmittedTimer); + } + startNotSubmittedTimer(); + } + $(document).keydown( function(){ + resetNotSubmittedTimer() + }); + $(document).click( function() { + resetNotSubmittedTimer() + }); + startNotSubmittedTimer(); + + {/if} + }); -- 2.17.1