From: Steve Sutton Date: Thu, 2 Nov 2017 00:31:45 +0000 (-0400) Subject: Working on the adding of attendee without time_specific. X-Git-Tag: v1.0.0^2~306 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=c81fa188ff799b9e20708e1bf98ff1e93a341b9f;p=WP-Plugins%2Fglm-member-db-registrations.git Working on the adding of attendee without time_specific. Getting the timeSelction set when setting up the classes from the php model. --- diff --git a/js/frontRegApp.js b/js/frontRegApp.js index 35120d0..03017b4 100644 --- a/js/frontRegApp.js +++ b/js/frontRegApp.js @@ -556,11 +556,7 @@ app.Views.Front.RegClass = Backbone.View.extend({ var state = this.$('.add_reg_state').val().trim(); var zip = this.$('.add_reg_zip').val().trim(); var country = this.$('.add_reg_country').val().trim(); - if ( app.timeSpecific ) { - var sTime = this.model.get( 'selectedTime' ); - } else { - var sTime = null; - } + var sTime = this.model.get( 'selectedTime' ); if ( this.$('#add_reg-select-time').length ) { var times = this.model.get( 'times' ); var rateId = null; @@ -861,6 +857,7 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({ render: function(){ this.$el.html( this.template( this.model.toJSON() ) ); this.$emailInput = this.$('.editEmail'); + this.$('.reg-edit-form').hide(); return this; }, diff --git a/js/views/front/regClass.js b/js/views/front/regClass.js index 305954a..d79124e 100644 --- a/js/views/front/regClass.js +++ b/js/views/front/regClass.js @@ -157,11 +157,7 @@ app.Views.Front.RegClass = Backbone.View.extend({ var state = this.$('.add_reg_state').val().trim(); var zip = this.$('.add_reg_zip').val().trim(); var country = this.$('.add_reg_country').val().trim(); - if ( app.timeSpecific ) { - var sTime = this.model.get( 'selectedTime' ); - } else { - var sTime = null; - } + var sTime = this.model.get( 'selectedTime' ); if ( this.$('#add_reg-select-time').length ) { var times = this.model.get( 'times' ); var rateId = null; diff --git a/js/views/front/regRequestRegistrant.js b/js/views/front/regRequestRegistrant.js index bfc5c71..055c3eb 100644 --- a/js/views/front/regRequestRegistrant.js +++ b/js/views/front/regRequestRegistrant.js @@ -114,6 +114,7 @@ app.Views.Front.RegRequestRegistrant = Backbone.View.extend({ render: function(){ this.$el.html( this.template( this.model.toJSON() ) ); this.$emailInput = this.$('.editEmail'); + this.$('.reg-edit-form').hide(); return this; }, diff --git a/models/front/registrations/registration.php b/models/front/registrations/registration.php index 5ac79ed..d127957 100644 --- a/models/front/registrations/registration.php +++ b/models/front/registrations/registration.php @@ -197,6 +197,9 @@ $rClass['reg_rate_name'] = $time['name']; $rClass['reg_rate_base_price'] = $time['base_rate']; $rClass['reg_rate_per_reg'] = $time['per_registrant']; + if ( $regEvent['time_specific'] ) { + $rClass['selectedTime'] = $time['id']; + } } $jsonClasses[] = json_encode( $rClass, JSON_NUMERIC_CHECK ); } else if ( !isset( $rClass['times'] ) || empty( $rClass['times'] ) ) { diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index b556234..009eea2 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -61,16 +61,22 @@
Base Rate: $<%= reg_rate_base_price %>
Per Registrant: $<%= reg_rate_per_reg %>
- Select a time - <% _.each( this.getTimeArray(), function(time){ %> - - <% }); %> + <% if ( app.timeSpecific ) { %> + Select a time + <% _.each( this.getTimeArray(), function(time){ %> + + <% }); %> + <% } else { %> + <% _.each( this.getTimeArray(), function(time){ %> + + <% }); %> + <% } %>