From 8e05734a06d1d7825684b539258c513d729cc378 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 27 Dec 2017 15:28:51 -0500 Subject: [PATCH] Update for terms in view file. Use terms in the registration page when possible. --- js/frontRegApp.js | 31 ++++++++++++++++++-- js/views/front/regTime.js | 31 ++++++++++++++++++-- models/admin/ajax/regFront/registrant.php | 2 +- models/front/registrations/registration.php | 2 +- views/front/registrations/accountHeader.html | 2 +- views/front/registrations/registration.html | 4 +-- 6 files changed, 63 insertions(+), 9 deletions(-) diff --git a/js/frontRegApp.js b/js/frontRegApp.js index 5767f52..9da2479 100644 --- a/js/frontRegApp.js +++ b/js/frontRegApp.js @@ -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(); diff --git a/js/views/front/regTime.js b/js/views/front/regTime.js index 1aa3fef..69ee51a 100644 --- a/js/views/front/regTime.js +++ b/js/views/front/regTime.js @@ -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(); diff --git a/models/admin/ajax/regFront/registrant.php b/models/admin/ajax/regFront/registrant.php index a2da754..51b6cb6 100644 --- a/models/admin/ajax/regFront/registrant.php +++ b/models/admin/ajax/regFront/registrant.php @@ -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']; diff --git a/models/front/registrations/registration.php b/models/front/registrations/registration.php index 70e3bd2..c552671 100644 --- a/models/front/registrations/registration.php +++ b/models/front/registrations/registration.php @@ -369,7 +369,7 @@ ); // echo "
".print_r($templateData,1)."
"; - + // Return status, any suggested view, and any data to controller return array( 'status' => true, diff --git a/views/front/registrations/accountHeader.html b/views/front/registrations/accountHeader.html index b28b1b2..d3ccc22 100644 --- a/views/front/registrations/accountHeader.html +++ b/views/front/registrations/accountHeader.html @@ -1,7 +1,7 @@
- + Event Registration List diff --git a/views/front/registrations/registration.html b/views/front/registrations/registration.html index e74a996..e73a9d6 100644 --- a/views/front/registrations/registration.html +++ b/views/front/registrations/registration.html @@ -180,7 +180,7 @@ <% } %>
- List of attendees + List of {/literal}{$terms.reg_term_attendee_plur}{literal}
{/literal} @@ -330,7 +330,7 @@
    -
  • Register
  • +
  • {$terms.reg_term_register_cap}
  • View Cart
  • Checkout
-- 2.17.1