Fix error when no time specific entry is there.
.reg-class-accounts {
padding: 5px;
}
+
.new-reg {
background-color: white;
border: 1px solid black;
.new-reg .reg_email {
width: 96%;
}
+
+.new-reg-notime {
+ background-color: white;
+ border: 1px solid black;
+ padding: 2rem;
+ position: absolute;
+ left: 1rem;
+ top: 0;
+ width: 40rem;
+ z-index: 999;
+}
+.new-reg-notime h2 {
+ width: auto;
+}
+.new-reg-notime .reg_fname,
+.new-reg-notime .reg_lname,
+.new-reg-notime .reg_addr1,
+.new-reg-notime .reg_addr2,
+.new-reg-notime .reg_city,
+.new-reg-notime .reg_state,
+.new-reg-notime .reg_zip,
+.new-reg-notime .reg_country {
+ width: 46%;
+ margin-right: 1rem;
+ float: left;
+}
+.new-reg-notime .reg_email {
+ width: 95%;
+}
#reg-select-time {
width: 150px;
}
var zip = this.$('.reg_zip').val().trim();
var country = this.$('.reg_country').val().trim();
var rTime = this.$('#reg-select-time').val().trim();
- if ( !rTime ) {
+ if ( app.timeSpecific && !rTime ) {
alert( 'You must select a time!' );
return;
}
app.Views.Front.RegistrantForm = Backbone.View.extend({
tagName: 'div',
- className: 'new-reg',
+ className: function(){
+ if ( app.timeSpecific === true ) {
+ return 'new-reg';
+ } else {
+ return 'new-reg-notime';
+ }
+ },
template: _.template( jQuery('#eventReg-registrant-add').html() ),
var zip = this.$('.reg_zip').val().trim();
var country = this.$('.reg_country').val().trim();
var rTime = this.$('#reg-select-time').val().trim();
- if ( !rTime ) {
+ if ( app.timeSpecific && !rTime ) {
alert( 'You must select a time!' );
return;
}
app.Views.Front.RegistrantForm = Backbone.View.extend({
tagName: 'div',
- className: 'new-reg',
+ className: function(){
+ if ( app.timeSpecific === true ) {
+ return 'new-reg';
+ } else {
+ return 'new-reg-notime';
+ }
+ },
template: _.template( jQuery('#eventReg-registrant-add').html() ),
if ( is_array( $regEvent['recurrences'] ) && count( $regEvent['recurrences'] ) ) {
foreach ($regEvent['recurrences'] as $k=>$v) {
$first = current($v['times']);
- $first = current($v['times']);
+ // $first = current($v['times']);
+ // echo '<pre>$first: ' . print_r( $first, true ) . '</pre>';
$last = end($v['times']);
$regEvent['recurrences'][$k]['first_time'] = $first;
$regEvent['recurrences'][$k]['lastTime'] = $last;
if ($v['times'] && count($v['times']) > 0) {
- if (!$regEventFirstTime || $regEventFirstTime['timestamp'] < $first ) {
+ if (!$regEventFirstTime || ( isset( $regEventFirstTime['timestamp'] ) && $regEventFirstTime['timestamp'] < $first ) ) {
$regEventFirstTime = $first;
}
}
}
// echo '<pre>$registrants: ' . print_r( $registrants, true ) . '</pre>';
+// echo '<pre>$regEvent: ' . print_r( $regEvent, true ) . '</pre>';
// Compile template data
$templateData = array(
'regEvent' => $regEvent,
{/literal}
{* Template for registrant add form *}{literal}
<script type="text/template" id="eventReg-registrant-add">
- <div style="float: right; width: 48%;">
- <div id="eventCalendar" style="width: 90%;"></div>
- </div>
- <div style="width: 48%;">
+ {/literal}{if $regEvent.time_specific.value}
+ <div style="float: right; width: 48%;">
+ <div id="eventCalendar" style="width: 90%;"></div>
+ </div>
+ {/if}{literal}
+ {/literal}{if $regEvent.time_specific.value}
+ <div style="width: 48%;">
+ {else}
+ <div>
+ {/if}{literal}
<div>
{/literal}{$terms.reg_term_contact_information}{literal}
</div>
<input class="reg_zip" placeholder="Zip/Postal Code">
<input class="reg_country" placeholder="Country">
</div>
- <div>
- Selected Time: <span id="reg-select-time-display"></span>
- <input type="hidden" id="reg-select-time">
- </div>
+ {/literal}{if $regEvent.time_specific.value}
+ <div>
+ Selected Time: <span id="reg-select-time-display"></span>
+ <input type="hidden" id="reg-select-time">
+ </div>
+ {/if}{literal}
</div>
<div>
var regex = {literal}/^([a-zA-Z0-9_.+-])+\@(([a-zA-Z0-9-])+\.)+([a-zA-Z0-9]{2,4})+$/;{/literal}
return regex.test(email);
},
+ {if $regEvent.time_specific.value}
initFullCalendar: function(){
if ({$regEvent.time_specific.value}) {
$('#eventCalendar').fullCalendar({
{/if}
start : '{$t.start_datetime.datetime}',
end : '{$t.end_datetime.datetime}',
- allday : {$t.all_day.value},
+ allday : {if $t.all_day.value}true{else}false{/if},
reg_time: {$t.id}
}
{$sep = ','}
});
}
},
+ timeSpecific: true,
+ {else}
+ timeSpecific: false,
+ {/if}
};
var regEvent = '';
var cart = '';