data for base rate and per registrant.
render: function(){
// Check to see if there's a login
- if ( loginAccount ) {
- jQuery('#register').hide();
- }
+ // if ( loginAccount ) {
+ // jQuery('#register').hide();
+ // }
this.$el.append( this.event.render().el );
return this;
},
return this;
},
+ events: {
+ 'click .addRegistrant': 'newEntry',
+ 'click .glm-add-account': 'addAccount',
+ 'click .glm-add-new-account': 'addNewAccount',
+ 'click .add-new-registrant': 'addNew',
+ 'click .add-new-registrant-cancel': 'cancelAddNew',
+ },
+
render: function(){
this.model.set({ reg_count: this.model.registrants.length });
this.$el.html( this.template( this.model.toJSON() ) );
this.render();
},
- events: {
- 'click .addRegistrant': 'newEntry',
- 'click .glm-add-account': 'addAccount',
- 'click .glm-add-new-account': 'addNewAccount',
- 'click .add-new-registrant': 'addNew',
- 'click .add-new-registrant-cancel': 'cancelAddNew',
- },
-
addAccount: function(){
// Check to make sure the loginAccount is not empty
if ( loginAccount !== '' ) {
}
} );
} else {
- var rTime = null;
+ var rTime = null;
+ var times = this.model.get( 'times' );
+ var rateId = null;
+ _.each( times, function( time ){
+ rateId = time.rate_id;
+ } );
}
if ( app.timeSpecific && !rTime ) {
alert( 'You must select a time!' );
return this;
},
+ getClassCount: function(){
+ return this.model.classes.length;
+ },
+
});
app.Views.Front.RegRequestRegistrant = Backbone.View.extend({
render: function(){
// Check to see if there's a login
- if ( loginAccount ) {
- jQuery('#register').hide();
- }
+ // if ( loginAccount ) {
+ // jQuery('#register').hide();
+ // }
this.$el.append( this.event.render().el );
return this;
},
return this;
},
+ events: {
+ 'click .addRegistrant': 'newEntry',
+ 'click .glm-add-account': 'addAccount',
+ 'click .glm-add-new-account': 'addNewAccount',
+ 'click .add-new-registrant': 'addNew',
+ 'click .add-new-registrant-cancel': 'cancelAddNew',
+ },
+
render: function(){
this.model.set({ reg_count: this.model.registrants.length });
this.$el.html( this.template( this.model.toJSON() ) );
this.render();
},
- events: {
- 'click .addRegistrant': 'newEntry',
- 'click .glm-add-account': 'addAccount',
- 'click .glm-add-new-account': 'addNewAccount',
- 'click .add-new-registrant': 'addNew',
- 'click .add-new-registrant-cancel': 'cancelAddNew',
- },
-
addAccount: function(){
// Check to make sure the loginAccount is not empty
if ( loginAccount !== '' ) {
}
} );
} else {
- var rTime = null;
+ var rTime = null;
+ var times = this.model.get( 'times' );
+ var rateId = null;
+ _.each( times, function( time ){
+ rateId = time.rate_id;
+ } );
}
if ( app.timeSpecific && !rTime ) {
alert( 'You must select a time!' );
return this;
},
+ getClassCount: function(){
+ return this.model.classes.length;
+ },
+
});
// If the event is Time Specific then the reg_class need to have
// times array. If it doesn't then there's no current registration
// allowed for that event.
- foreach ( $regEvent['reg_class'] as $rClass ) {
+ foreach ( $regEvent['reg_class'] as $key => $rClass ) {
// Pull the rate data
- if ( isset( $rClass['times'] ) && is_array( $rClass['times'] ) ) {
+ if ( isset( $rClass['times'] ) && is_array( $rClass['times'] ) && count( $rClass['times'] ) > 0 ) {
foreach ( $rClass['times'] as &$time ) {
$rClass['loggedIn'] = ( isset($_SESSION['LoginAccount']) ) ? true : false;
$rClass['reg_rate_id'] = $time['id'];
$rClass['reg_rate_per_reg'] = $time['per_registrant'];
}
$jsonClasses[] = json_encode( $rClass, JSON_NUMERIC_CHECK );
+ } else if ( !isset( $rClass['times'] ) || empty( $rClass['times'] ) ) {
+ unset( $regEvent['reg_class'][$key] );
}
}
}
- // echo '<pre>$regEvent: ' . print_r( $regEvent, true ) . '</pre>';
+ echo '<pre>$regEvent: ' . print_r( $regEvent, true ) . '</pre>';
// Build the regClass JSON for the template.
$regClassJSON = '[' . implode( ',', $jsonClasses ) . ']';
</div>
<div>
<p><%= descr %></p>
- <% if ( !time_specific ) { %>
- <p>Attend any time during event</p>
- <% _.each(reg_time, function(rTime){ %>
- <% if ( rTime.attendee_max > 0 ) { %>
- <p> Maximum Registrants: <%= rTime.attendee_max %><br>
- Currently Available: <%= rTime.attendees_available %> </p>
- <% } %>
- <% }); %>
+ <% if ( this.getClassCount() == 0 ) { %>
+ <p> Registrations for this event not currently available at this time. </p>
<% } else { %>
+ <% if ( !time_specific ) { %>
+ <p>Attend any time during event</p>
+ <% _.each(reg_time, function(rTime){ %>
+ <% if ( rTime.attendee_max > 0 ) { %>
+ <p> Maximum Registrants: <%= rTime.attendee_max %><br>
+ Currently Available: <%= rTime.attendees_available %> </p>
+ <% } %>
+ <% }); %>
+ <% } else { %>
+ <% } %>
<% } %>
<p><%= terms %></p>