From: Chuck Scott Date: Fri, 10 Nov 2017 21:56:42 +0000 (-0500) Subject: Wider list and reg pages and added Misc texts and global terms at checkout. X-Git-Tag: v1.0.0^2~289 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=7c77b1a4187c4cf25d642f8b2aca84d901756566;p=WP-Plugins%2Fglm-member-db-registrations.git Wider list and reg pages and added Misc texts and global terms at checkout. Added the appropriate misc text to the top of each registrations page. Added global terms and conditions to checkout and added test for that. Changed contained class for list and registrations page to make content wider. --- diff --git a/models/front/registrations/cart.php b/models/front/registrations/cart.php index f086c89..0c3db44 100644 --- a/models/front/registrations/cart.php +++ b/models/front/registrations/cart.php @@ -83,6 +83,11 @@ class GlmMembersFront_registrations_cart extends GlmRegCartSupport $haveCart = false; $option = false; + // Get misc texts + require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataMisc.php'; + $Misc = new GlmDataRegistrationsMisc($this->wpdb, $this->config); + $misc = $Misc->getEntry(1); + // Get any provided option if (isset($_REQUEST['option'])) { $option = $_REQUEST['option']; @@ -144,7 +149,8 @@ class GlmMembersFront_registrations_cart extends GlmRegCartSupport 'cart' => $this->cart, 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/', 'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false, - 'assetUrl' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_ASSETS_URL + 'assetUrl' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_ASSETS_URL, + 'cartPageText' => $misc['cart_page_text'] ); // echo "
".print_r($templateData,1)."
"; diff --git a/models/front/registrations/checkout.php b/models/front/registrations/checkout.php index b9f08b5..aa395b7 100644 --- a/models/front/registrations/checkout.php +++ b/models/front/registrations/checkout.php @@ -58,6 +58,12 @@ class GlmMembersFront_registrations_checkout extends GlmRegCartSupport $payMethod = false; $compCode = false; + // Get misc texts + require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataMisc.php'; + $Misc = new GlmDataRegistrationsMisc($this->wpdb, $this->config); + $misc = $Misc->getEntry(1); + + // Register the masked input script that we need for input controls wp_register_script( 'glm-members-admin-maskedinput', GLM_MEMBERS_PLUGIN_JS_URL . '/jquery.maskedinput-1.2.2.js', @@ -259,7 +265,9 @@ class GlmMembersFront_registrations_checkout extends GlmRegCartSupport 'payMethod' => $payMethod, 'payMethods' => $management['reg_payment_methods']['bitmap'], 'payMethodsNumb' => $this->config['payment_method_numb'], - 'misc' => $misc + 'misc' => $misc, + 'checkoutPageText' => $misc['checkout_page_text'], + 'globalTerms' => $misc['reg_terms'] ); // echo "
".print_r($templateData,1)."
"; diff --git a/models/front/registrations/checkoutProcess.php b/models/front/registrations/checkoutProcess.php index c028f35..8cd7e47 100644 --- a/models/front/registrations/checkoutProcess.php +++ b/models/front/registrations/checkoutProcess.php @@ -106,6 +106,11 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport $Account = new GlmDataRegistrationsAccount($this->wpdb, $this->config); $Request = new GlmDataRegistrationsRegRequest($this->wpdb, $this->config); + // Get misc texts + require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataMisc.php'; + $Misc = new GlmDataRegistrationsMisc($this->wpdb, $this->config); + $misc = $Misc->getEntry(1); + /* * Valid cart? */ @@ -183,15 +188,27 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport if (count($messages) == 0) { + $policiesAccepted = true; + + // Global Policies + if ($misc['reg_terms'] != '') { + if (!isset($_REQUEST['terms']) || $_REQUEST['terms'] != 'accept') { + $policiesAccepted = false; + } + } + // All policies accepted reset($this->cart['events']); foreach ($this->cart['events'] as $event) { - if (trim($event['event_terms']) != '' && (!isset($_REQUEST['terms_'.$event['id']]) || $_REQUEST['terms_'.$event['id']] != 'accept')) { - $messages[] = 'You did not accept the Terms and Conditions for the '.$event['event_name'].' event.'; + $policiesAccepted = false; } } + if (!$policiesAccepted) { + $messages[] = 'You did not accept all terms and conditions.'; + } + } /* @@ -526,11 +543,6 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport $request = $Request->getEntry($this->cart['request']['id']); $account = $Account->getEntry($request['account']); - // Get misc texts - require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataMisc.php'; - $Misc = new GlmDataRegistrationsMisc($this->wpdb, $this->config); - $misc = $Misc->getEntry(1); - // Produce HTML for storage and checkout page and add to request $summaryData = array( 'cart' => $this->cart, diff --git a/models/front/registrations/list.php b/models/front/registrations/list.php index 6ac8da1..a1ea012 100644 --- a/models/front/registrations/list.php +++ b/models/front/registrations/list.php @@ -74,6 +74,11 @@ $haveRegEvents = false; $regEventsCount = false; + // Get misc texts + require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataMisc.php'; + $Misc = new GlmDataRegistrationsMisc($this->wpdb, $this->config); + $misc = $Misc->getEntry(1); + // Get any provided option if (isset($_REQUEST['option'])) { $option = $_REQUEST['option']; @@ -157,6 +162,7 @@ 'limit' => $limit, 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/', 'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false, + 'reg_bulletin' => $misc['reg_bulletin'] ); // Return status, any suggested view, and any data to controller diff --git a/models/front/registrations/registration.php b/models/front/registrations/registration.php index 3ff63b7..eb7497d 100644 --- a/models/front/registrations/registration.php +++ b/models/front/registrations/registration.php @@ -47,6 +47,11 @@ $isNewCart = false; $regEventFirstTime = false; + // Get misc texts + require_once GLM_MEMBERS_REGISTRATIONS_PLUGIN_CLASS_PATH.'/data/dataMisc.php'; + $Misc = new GlmDataRegistrationsMisc($this->wpdb, $this->config); + $misc = $Misc->getEntry(1); + // Setup scripts array for needed js files. $scripts = array( 'regApp' => 'js/frontRegApp.js', @@ -342,7 +347,8 @@ 'regJSON' => json_encode( $registrants, JSON_NUMERIC_CHECK ), 'regUrl' => GLM_MEMBERS_REGISTRATIONS_SITE_BASE_URL.$this->config['settings']['canonical_reg_page'].'/', 'loggedIn' => ( isset( $_SESSION['LoginAccount'] ) ) ? $_SESSION['LoginAccount']: false, - 'assetUrl' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_ASSETS_URL + 'assetUrl' => GLM_MEMBERS_REGISTRATIONS_PLUGIN_ASSETS_URL, + 'reg_bulletin' => $misc['reg_bulletin'] ); // Return status, any suggested view, and any data to controller diff --git a/setup/databaseScripts/create_database_V0.0.18.sql b/setup/databaseScripts/create_database_V0.0.18.sql index 3e804d1..d5aca0a 100644 --- a/setup/databaseScripts/create_database_V0.0.18.sql +++ b/setup/databaseScripts/create_database_V0.0.18.sql @@ -159,7 +159,7 @@ CREATE TABLE {prefix}settings_terms ( -- Only one entry in this table! CREATE TABLE {prefix}misc ( id INT NOT NULL AUTO_INCREMENT, - reg_bulletin TEXT NULL, -- Text to display at top of first registration page + reg_bulletin TEXT NULL, -- Text to display at top of first registration page cart_page_text TEXT NULL, -- Text to display at top of cart page checkout_page_text TEXT NULL, -- Text to display at top of checkout page summary_page_text TEXT NULL, -- Text to display at top of summary page (after checkout) diff --git a/views/front/registrations/cart.html b/views/front/registrations/cart.html index 1f6e08a..b3ae08a 100644 --- a/views/front/registrations/cart.html +++ b/views/front/registrations/cart.html @@ -1,5 +1,11 @@ {include file='front/registrations/header.html'} +{if $cartPageText} +
+ {$cartPageText} +
+{/if} + {if !$cart.validated}
Please Note: diff --git a/views/front/registrations/checkout.html b/views/front/registrations/checkout.html index df969ad..08209ec 100644 --- a/views/front/registrations/checkout.html +++ b/views/front/registrations/checkout.html @@ -1,5 +1,11 @@ {include file='front/registrations/header.html'} +{if $checkoutPageText} +
+ {$checkoutPageText} +
+{/if} + {if $haveMessages}
Please Note: @@ -284,6 +290,13 @@

Terms and Conditions (*** Added fields for events ***)

You must check the boxes below to confirm that you agree to the Terms and Conditions for each event.
+
+
 
+
+
General Registrations Terms and Conditions:
+
+
+
{foreach $cart.events as $event} {if $event.event_terms != ''}
diff --git a/views/front/registrations/list.html b/views/front/registrations/list.html index 25c5728..6abbb49 100644 --- a/views/front/registrations/list.html +++ b/views/front/registrations/list.html @@ -1,5 +1,12 @@ -{include file='front/registrations/header.html'} {$ajaxUrl} -
+{include file='front/registrations/header.html'} + +{if $reg_bulletin} +
+ {$reg_bulletin} +
+{/if} + +
{if $haveRegEvents} {foreach $regEvents as $event}
diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index 353d7e3..8399c67 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -218,7 +218,14 @@

{$terms.reg_term_registrations_name}

{include file='front/registrations/header.html'} -
+ +{if $reg_bulletin} +
+ {$reg_bulletin} +
+{/if} + +