Working on the adding of attendee without time_specific.
authorSteve Sutton <ssutton@gmail.com>
Thu, 2 Nov 2017 00:31:45 +0000 (20:31 -0400)
committerSteve Sutton <ssutton@gmail.com>
Thu, 2 Nov 2017 00:31:45 +0000 (20:31 -0400)
Getting the timeSelction set when setting up the classes from the php
model.

js/frontRegApp.js
js/views/front/regClass.js
js/views/front/regRequestRegistrant.js
models/front/registrations/registration.php
views/front/registrations/registration.html

index 35120d0..03017b4 100644 (file)
@@ -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;
     },
 
index 305954a..d79124e 100644 (file)
@@ -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;
index bfc5c71..055c3eb 100644 (file)
@@ -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;
     },
 
index 5ac79ed..d127957 100644 (file)
                         $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'] ) ) {
index b556234..009eea2 100644 (file)
                 <div class="glm-columns glm-small-12 glm-large-12"> Base Rate: $<%= reg_rate_base_price %> </div>
                 <div class="glm-columns glm-small-12 glm-large-12"> Per Registrant: $<%= reg_rate_per_reg %> </div>
                 <div class="glm-columns glm-small-12 glm-large-12">
-                    <b>Select a time</b>
-                    <% _.each( this.getTimeArray(), function(time){ %>
-                    <label>
-                        <input class="timeSelection" type="radio" name="timeOption" value="<%= time.id %>"
-                        <% if ( selectedTime == time.id ) { %>
-                            checked
-                        <% } %>
-                        /> <%= time.date.toLocaleTimeString('en-US', {hour: '2-digit', minute: '2-digit'}) %>
-                    </label>
-                    <% }); %>
+                    <% if ( app.timeSpecific ) { %>
+                        <b>Select a time</b>
+                        <% _.each( this.getTimeArray(), function(time){ %>
+                        <label>
+                            <input class="timeSelection" type="radio" name="timeOption" value="<%= time.id %>"
+                            <% if ( selectedTime == time.id ) { %>
+                                checked
+                            <% } %>
+                            /> <%= time.date.toLocaleTimeString('en-US', {hour: '2-digit', minute: '2-digit'}) %>
+                        </label>
+                        <% }); %>
+                    <% } else { %>
+                        <% _.each( this.getTimeArray(), function(time){ %>
+                            <input class="timeSelection" type="hidden" name="timeOption" value="<%= time.id %>">
+                        <% }); %>
+                    <% } %>
                 </div>
             </div>
         </div>