Update for terms in view file.
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 27 Dec 2017 20:28:51 +0000 (15:28 -0500)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 27 Dec 2017 20:29:23 +0000 (15:29 -0500)
Use terms in the registration page when possible.

js/frontRegApp.js
js/views/front/regTime.js
models/admin/ajax/regFront/registrant.php
models/front/registrations/registration.php
views/front/registrations/accountHeader.html
views/front/registrations/registration.html

index 5767f52..9da2479 100644 (file)
@@ -1000,7 +1000,29 @@ app.Views.Front.RegTime = Backbone.View.extend({
         // to the collection.
         var customFieldData = this.$( 'form.attendee-cf-form-new' ).serialize();
 
-        // return false;
+        // var newRegistrant = new app.Models.Front.RegRequestRegistrant({
+        //     option: 'add',
+        //     reg_request: regRequest.id,
+        //     reg_time: this.model.get( 'id' ),
+        //     reg_event: this.model.get( 'reg_event' ), // Todo: use correct reg_event
+        //     reg_class: this.model.get( 'parent' ).id, // Todo: use correct reg_class
+        //     reg_rate: rateId,
+        //     email: email,
+        //     fname: fname,
+        //     lname: lname,
+        //     addr1: addr1,
+        //     addr2: addr2,
+        //     city: city,
+        //     state: state,
+        //     zip: zip,
+        //     country: country,
+        //     customFields: customFieldData
+        // } );
+        // newRegistrant.save({error: function( model, response, options ){
+        //     console.log( 'Error run for adding model' );
+        //     console.log( response );
+        // }});
+        // this.model.collection.add( newRegistrant );
         var newRegistrant = this.model.registrants.create({
             option: 'add',
             reg_request: regRequest.id,
@@ -1018,7 +1040,7 @@ app.Views.Front.RegTime = Backbone.View.extend({
             zip: zip,
             country: country,
             customFields: customFieldData,
-        },{wait: true});
+        },{ wait: true, error: this.errorCallback });
 
         this.$('.glm-add-new-account').show();
         this.newRegAccount.destroy();
@@ -1026,6 +1048,11 @@ app.Views.Front.RegTime = Backbone.View.extend({
         app.regEventLock = false;
     },
 
+    errorCallback: function( collection, response ){
+        console.log( 'errorCallback Called' );
+        console.log( response );
+    },
+
     // cancel add new registrant
     cancelAddNew: function(){
         this.$('.glm-add-new-account').show();
index 1aa3fef..69ee51a 100644 (file)
@@ -107,7 +107,29 @@ app.Views.Front.RegTime = Backbone.View.extend({
         // to the collection.
         var customFieldData = this.$( 'form.attendee-cf-form-new' ).serialize();
 
-        // return false;
+        // var newRegistrant = new app.Models.Front.RegRequestRegistrant({
+        //     option: 'add',
+        //     reg_request: regRequest.id,
+        //     reg_time: this.model.get( 'id' ),
+        //     reg_event: this.model.get( 'reg_event' ), // Todo: use correct reg_event
+        //     reg_class: this.model.get( 'parent' ).id, // Todo: use correct reg_class
+        //     reg_rate: rateId,
+        //     email: email,
+        //     fname: fname,
+        //     lname: lname,
+        //     addr1: addr1,
+        //     addr2: addr2,
+        //     city: city,
+        //     state: state,
+        //     zip: zip,
+        //     country: country,
+        //     customFields: customFieldData
+        // } );
+        // newRegistrant.save({error: function( model, response, options ){
+        //     console.log( 'Error run for adding model' );
+        //     console.log( response );
+        // }});
+        // this.model.collection.add( newRegistrant );
         var newRegistrant = this.model.registrants.create({
             option: 'add',
             reg_request: regRequest.id,
@@ -125,7 +147,7 @@ app.Views.Front.RegTime = Backbone.View.extend({
             zip: zip,
             country: country,
             customFields: customFieldData,
-        },{wait: true});
+        },{ wait: true, error: this.errorCallback });
 
         this.$('.glm-add-new-account').show();
         this.newRegAccount.destroy();
@@ -133,6 +155,11 @@ app.Views.Front.RegTime = Backbone.View.extend({
         app.regEventLock = false;
     },
 
+    errorCallback: function( collection, response ){
+        console.log( 'errorCallback Called' );
+        console.log( response );
+    },
+
     // cancel add new registrant
     cancelAddNew: function(){
         this.$('.glm-add-new-account').show();
index a2da754..51b6cb6 100644 (file)
@@ -94,7 +94,7 @@ class GlmMembersAdmin_registrations_ajax_registrant extends GlmDataRegistrations
         switch ( $option ) {
 
         case 'add':
-
+            // wp_die( 'Error', 'Error', array( 'response' => 401 ) );
             // Call to add registrant
             $registrant = $this->addUpdateRegistrantToCart( $modelData, 'add' );
             $registrant['name'] = $registrant['fname'] . ' ' . $registrant['lname'];
index 70e3bd2..c552671 100644 (file)
         );
 
         // echo "<pre>".print_r($templateData,1)."</pre>";
-        
+
         // Return status, any suggested view, and any data to controller
         return array(
             'status'        => true,
index b28b1b2..d3ccc22 100644 (file)
@@ -1,7 +1,7 @@
 <div id="accountHeader" class="glm-row">
 
     <div id="accountHeader-left" class="accountHeader-section small-12 medium-12 medium-centered large-4 large-uncentered columns">
-        <a id="accountHeader-list-link"href="{$regUrl}" class="button glm-reg-header-btn">
+        <a id="accountHeader-list-link" href="{$regUrl}" class="button glm-reg-header-btn">
             <span>Event Registration List</span>
         </a>
 
index e74a996..e73a9d6 100644 (file)
     <% } %>
     <button class="glm-add-new-account">Add New {/literal}{$terms.reg_term_attendee_cap}{literal}</button>
     <div class="reg-class-accounts">
-        <span class="reg-class-accounts-title">List of attendees</span>
+        <span class="reg-class-accounts-title">List of {/literal}{$terms.reg_term_attendee_plur}{literal}</span>
     </div>
 </script>
 {/literal}
     <div class="row progress-row">
         <div class="progress-container columns">
             <ul class="progressbar">
-              <li class="active">Register</li>
+                <li class="active">{$terms.reg_term_register_cap}</li>
               <li >View Cart</li>
               <li>Checkout</li>
             </ul>