From: Steve Sutton Date: Wed, 27 Sep 2017 20:58:57 +0000 (-0400) Subject: Adding stuff for new registrant X-Git-Tag: v1.0.0^2~383 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=0c29c0ee87dfa65e8971217d441fb4e5d785c59a;p=WP-Plugins%2Fglm-member-db-registrations.git Adding stuff for new registrant This will be for a new account to be registered. --- diff --git a/js/frontRegApp.js b/js/frontRegApp.js index 92e61f9..bfb4979 100644 --- a/js/frontRegApp.js +++ b/js/frontRegApp.js @@ -186,7 +186,9 @@ app.Models.Front.RegEvent = Backbone.Model.extend({ setClassRegistrants: function( registrants ){ for ( var i = 0; i < registrants.length; i++ ) { var foundClass = this.classes.findWhere({ id: registrants[i].class_id }); - foundClass.registrants.create( registrants[i] ); + if ( foundClass != undefined ) { + foundClass.registrants.create( registrants[i] ); + } } }, @@ -460,6 +462,11 @@ app.Views.Front.App = Backbone.View.extend({ 'click #glm-reg-cart-continue': 'continue', 'click #accountLogin': 'loginToAccount', 'click #accountLogout': 'logout', + 'click #register': 'register', + }, + + register: function(){ + // Have to create new view and model for the register }, continue: function(){ diff --git a/js/models/front/regEvent.js b/js/models/front/regEvent.js index eb73ebd..5b0a393 100644 --- a/js/models/front/regEvent.js +++ b/js/models/front/regEvent.js @@ -29,7 +29,9 @@ app.Models.Front.RegEvent = Backbone.Model.extend({ setClassRegistrants: function( registrants ){ for ( var i = 0; i < registrants.length; i++ ) { var foundClass = this.classes.findWhere({ id: registrants[i].class_id }); - foundClass.registrants.create( registrants[i] ); + if ( foundClass != undefined ) { + foundClass.registrants.create( registrants[i] ); + } } }, diff --git a/js/views/front/app.js b/js/views/front/app.js index 82a573f..14cdf6e 100644 --- a/js/views/front/app.js +++ b/js/views/front/app.js @@ -29,6 +29,11 @@ app.Views.Front.App = Backbone.View.extend({ 'click #glm-reg-cart-continue': 'continue', 'click #accountLogin': 'loginToAccount', 'click #accountLogout': 'logout', + 'click #register': 'register', + }, + + register: function(){ + // Have to create new view and model for the register }, continue: function(){ diff --git a/models/admin/ajax/regFront/registrant.php b/models/admin/ajax/regFront/registrant.php index e781b53..dfd6dcd 100644 --- a/models/admin/ajax/regFront/registrant.php +++ b/models/admin/ajax/regFront/registrant.php @@ -275,9 +275,10 @@ class GlmMembersAdmin_registrations_ajax_registrant extends GlmDataRegistrations $this->wpdb->insert( GLM_MEMBERS_REGISTRATIONS_PLUGIN_DB_PREFIX . 'account', array( - 'fname' => $modelData['fname'], - 'lname' => $modelData['lname'], - 'email' => $modelData['email'] + 'fname' => $modelData['fname'], + 'lname' => $modelData['lname'], + 'email' => $modelData['email'], + 'date_created' => date('Y-m-d'), ), '%s' ); diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index aac27de..cd886c4 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -2,21 +2,27 @@ {* Underscore Templates for the Event Registration App *} {* Template for Account Login *}{literal} {/literal} {* Template for Logged in Account *}{literal} +{/literal} +{* Template for Register New Account *}{literal} + {/literal} {* Template for the regEvent *}{literal}