// For some reason this is not available after the newRegistrant is added
// to the collection.
var customFieldData = this.$( 'form.attendee-cf-form-' + this.model.get('id') ).serialize();
+ var customFieldLevelData = this.$( 'form.attendee-cf-form-level-' + this.model.get('id') ).serialize();
var modelId = this.model.get( 'id' );
var fname = this.$('.reg_fname').val().trim();
country: country,
reg_time: this.model.get('reg_time'),
customFields: customFieldData,
+ customFieldsLevel: customFieldLevelData,
}, {wait: true});
// this.model.save();
if ( this.model.validationError ) {
resetCustomFields: function() {
// Call the custom fields ajax
app.setCustomFieldsForm(this.model.get('reg_event'), this.model.id, '.attendee-cf-' + this.model.id);
- app.setCustomFieldsForLevelForm(this.model.get('reg_event'), this.model.get('class_id'), this.model.id, '.attendee-cf-level-' + this.model.id);
+ app.setCustomFieldsForLevelForm(this.model.get('reg_event'), this.model.get('reg_class'), this.model.id, '.attendee-cf-level-' + this.model.id);
this.$('.reg-edit-form').hide();
},
// Call the custom fields ajax
app.setCustomFieldsForm(this.model.get('reg_event'), this.model.id, '.attendee-cf-' + this.model.id);
- app.setCustomFieldsForLevelForm(this.model.get('reg_event'), this.model.get('class_id'), this.model.id, '.attendee-cf-level-' + this.model.id);
+ app.setCustomFieldsForLevelForm(this.model.get('reg_event'), this.model.get('reg_class'), this.model.id, '.attendee-cf-level-' + this.model.id);
return this;
},
if ( app.timeSpecific ) {
this.newRegAccount = new app.Models.Front.RegRequestRegistrant({ reg_time: this.model.get( 'selectedTime' ) });
} else {
- // console.log(this.model);
this.newRegAccount = new app.Models.Front.RegRequestRegistrant({
reg_event: this.model.get('reg_event'),
reg_class: this.model.get('parent')
}
} else {
findByEmail = this.model.registrants.where({email: email, fname: fname, lname: lname});
- console.log( findByEmail.length );
if ( findByEmail.length > 0 ) {
this.$('#loading-' + this.model.get('id') ).hide();
}
// For some reason this is not available after the newRegistrant is added
// to the collection.
var customFieldData = this.$( 'form.attendee-cf-form-new' ).serialize();
+ var customFieldLevelData = this.$( 'form.attendee-cf-form-level-new' ).serialize();
var newRegistrant = this.model.registrants.create({
option: 'add',
zip: zip,
country: country,
customFields: customFieldData,
+ customFieldsLevel: customFieldLevelData,
},{ wait: true, error: this.errorCallback });
this.$('.glm-add-new-account').show();
// add a registrant to collection
addOne: function( item ){
- // console.log( 'regTime: addOne called' );
- // console.log( item.get('id') );
this.model.set({selectedTime: item.get('reg_time') })
this.render();
},
// delete a registrant in collection
deleteOne: function( item ){
- // console.log( 'regTime: deleteOne called' );
// this.render();
},
});
render: function(){
this.$el.html( this.template( this.model.toJSON() ) );
var regClass = this.model.get('reg_class');
- app.setCustomFieldsForLevelForm( this.model.get('reg_event'), regClass.get('id'), this.model.id, '.attendee-cf-level-' + this.model.id);
+ app.setCustomFieldsForLevelForm( this.model.get('reg_event'), regClass.get('id'), this.model.id, '.attendee-cf-level-new');
return this;
},
// For some reason this is not available after the newRegistrant is added
// to the collection.
var customFieldData = this.$( 'form.attendee-cf-form-' + this.model.get('id') ).serialize();
+ var customFieldLevelData = this.$( 'form.attendee-cf-form-level-' + this.model.get('id') ).serialize();
var modelId = this.model.get( 'id' );
var fname = this.$('.reg_fname').val().trim();
country: country,
reg_time: this.model.get('reg_time'),
customFields: customFieldData,
+ customFieldsLevel: customFieldLevelData,
}, {wait: true});
// this.model.save();
if ( this.model.validationError ) {
resetCustomFields: function() {
// Call the custom fields ajax
app.setCustomFieldsForm(this.model.get('reg_event'), this.model.id, '.attendee-cf-' + this.model.id);
- app.setCustomFieldsForLevelForm(this.model.get('reg_event'), this.model.get('class_id'), this.model.id, '.attendee-cf-level-' + this.model.id);
+ app.setCustomFieldsForLevelForm(this.model.get('reg_event'), this.model.get('reg_class'), this.model.id, '.attendee-cf-level-' + this.model.id);
this.$('.reg-edit-form').hide();
},
// Call the custom fields ajax
app.setCustomFieldsForm(this.model.get('reg_event'), this.model.id, '.attendee-cf-' + this.model.id);
- app.setCustomFieldsForLevelForm(this.model.get('reg_event'), this.model.get('class_id'), this.model.id, '.attendee-cf-level-' + this.model.id);
+ app.setCustomFieldsForLevelForm(this.model.get('reg_event'), this.model.get('reg_class'), this.model.id, '.attendee-cf-level-' + this.model.id);
return this;
},
if ( app.timeSpecific ) {
this.newRegAccount = new app.Models.Front.RegRequestRegistrant({ reg_time: this.model.get( 'selectedTime' ) });
} else {
- // console.log(this.model);
this.newRegAccount = new app.Models.Front.RegRequestRegistrant({
reg_event: this.model.get('reg_event'),
reg_class: this.model.get('parent')
}
} else {
findByEmail = this.model.registrants.where({email: email, fname: fname, lname: lname});
- console.log( findByEmail.length );
if ( findByEmail.length > 0 ) {
this.$('#loading-' + this.model.get('id') ).hide();
}
// For some reason this is not available after the newRegistrant is added
// to the collection.
var customFieldData = this.$( 'form.attendee-cf-form-new' ).serialize();
+ var customFieldLevelData = this.$( 'form.attendee-cf-form-level-new' ).serialize();
var newRegistrant = this.model.registrants.create({
option: 'add',
zip: zip,
country: country,
customFields: customFieldData,
+ customFieldsLevel: customFieldLevelData,
},{ wait: true, error: this.errorCallback });
this.$('.glm-add-new-account').show();
// add a registrant to collection
addOne: function( item ){
- // console.log( 'regTime: addOne called' );
- // console.log( item.get('id') );
this.model.set({selectedTime: item.get('reg_time') })
this.render();
},
// delete a registrant in collection
deleteOne: function( item ){
- // console.log( 'regTime: deleteOne called' );
// this.render();
},
});
render: function(){
this.$el.html( this.template( this.model.toJSON() ) );
var regClass = this.model.get('reg_class');
- app.setCustomFieldsForLevelForm( this.model.get('reg_event'), regClass.get('id'), this.model.id, '.attendee-cf-level-' + this.model.id);
+ app.setCustomFieldsForLevelForm( this.model.get('reg_event'), regClass.get('id'), this.model.id, '.attendee-cf-level-new');
return this;
},
*/
public function addUpdateRegistrantToCart( $modelData, $action )
{
+ // trigger_error( print_r($modelData, true) );
+
$validated = false;
if ( $action == 'add' ) {
);
$registrant['customFields'] = $modelData['customFields'];
+ // Parse str for the custom field data
+ parse_str( $modelData['customFieldsLevel'], $queryParams2 );
+
+ // Store the custom Level field data
+ $_REQUEST = $queryParams2;
+ // trigger_error(print_r($_REQUEST,1));
+ // trigger_error(print_r($regRequestRegistrantId,1));
+ // trigger_error(print_r($regRequestClassId,1));
+ apply_filters(
+ 'glm-members-customfields-form-submit',
+ '',
+ 'glm_reg_customfields_reg_event_' . $modelData['reg_event'] . '_level_' . $modelData['reg_class'],
+ $regRequestRegistrantId,
+ true
+ );
+ $registrant['customFieldsLevel'] = $modelData['customFieldsLevel'];
+
+
return $registrant;
}
{literal}
</div>
</form>
- <form class="attendee-cf-level-form-<%= id %>">
- <div class="attendee-cf-level-<%= id %>"></div>
+ <form class="attendee-cf-form-level-new">
+ <div class="attendee-cf-level-new"></div>
</form>
{/literal}{/if}{literal}
{/literal}{if $regEvent.time_specific.value}
<h4>Additional Info Needed</h4>
{/literal}{/if}{literal}
<form class="attendee-cf-form-<%= id %>"><div class="attendee-cf-<%= id %>"></div></form>
- <form class="attendee-cf-level-form-<%= id %>"><div class="attendee-cf-level-<%= id %>"></div></form>
+ <form class="attendee-cf-form-level-<%= id %>"><div class="attendee-cf-level-<%= id %>"></div></form>
{/literal}{/if}{literal}
</div>
{/literal}{if $regEvent.time_specific.value}
}
},
setCustomFieldsForLevelForm: function( reg_event_id, reg_level_id, record_id, target ){
- console.log('record_id: ', record_id);
if ( customFieldActive ) {
var formData = {
'action': 'glm_members_admin_ajax',
})
.done( function( formHtml ) {
if ( target === 'return' ) {
- console.log( formHtml );
return formHtml;
} else {
jQuery(target).html( formHtml );
})
.done( function( formHtml ) {
if ( target === 'return' ) {
- console.log( formHtml );
return formHtml;
} else {
jQuery(target).html( formHtml );
var id = $(this).data('descr');
var descr = $('body').find( $('#' + id) );
var descr_length = descr.text().length;
- console.log(descr_length);
if( descr.height() < 47 && descr_length > 150 ){
$(descr).animate({
height: '100%',