<tr><th id="availabilityTitle" colspan="2"><!-- item date / time goes here --></th></tr>
<tr><th style="text-align: left">Active:</th><td><input id="dialogRegActive" type="checkbox" value=""></td></tr>
<tr id="dialogAllDayLine"><th style="text-align: left">All Day:</th><td><input id="dialogTimeAllDay" type="checkbox" value=""></td></tr>
+ {if $regEvent.time_specific.value}
<tr id="dialogTrackLine"><th style="text-align: left">Track Attendees:</th><td><input id="dialogAttendees" type="checkbox" value=""></td></tr>
+ {/if}
<tr id="dialogStartTimeLine"><th style="text-align: left">Start Time:</th><td><input id="dialogStartTime" class="glm-form-text-input-short time-input not-all-day" type="text" value=""></td></tr>
<tr id="dialogEndTimeLine"><th style="text-align: left">End Time:</th><td><input id="dialogEndTime" class="glm-form-text-input-short time-input not-all-day" type="text" value=""></td></tr>
+ {if $regEvent.time_specific.value}
<tr><th style="text-align: left">Maximum Attendees:</th><td><input class="glm-form-text-input-veryshort availabilityInput" type="text" id="dialogMaxAtt" value=""> 0 = Unlimited</td></tr>
<tr id="dialogRegLine"><th style="text-align: left">Registered Attendees:</th><td id="dialogRegAtt"></td></tr>
<tr id="dialogPendLine"><th style="text-align: left">Pending in Carts:</th><td id="dialogPendAtt"></td></tr>
<tr id="dialogAvailLine"><th style="text-align: left">Available for Registration:</th><td id="dialogAvailAtt"></td></tr>
+ {/if}
<tr><td style="text-align: right">
<div id="dialogAvailSubmit" class="button-primary" data-timeid="">Upate</div>
</td></tr>
{foreach $regEvent.reg_time as $t}
{if $t.non_time_specific.value == false}
{$sep}{
+ {if $regEvent.time_specific.value}
{if $t.attendee_max == 0}
title: 'unlimited',
{else}
title: '{$t.attendee_max}-{$t.attendee_count}-{$t.attendees_pending}-{$t.attendees_available}',
{/if}
+ {else}
+ title: '',
+ {/if}
start: '{$t.start_datetime.datetime}',
end: '{$t.end_datetime.datetime}',
active: {if $t.active.value}true{else}false{/if},
$('#availabilityEditDialog').dialog('open');
$('#dialogRegActive').prop('checked', true);
$('#dialogTimeAllDay').prop('checked', false);
- $('#dialogAttendees').prop('checked', true);
$('#dialogStartTime').val('');
$('#dialogEndTime').val('');
+ $('#dialogAttendees').prop('checked', true);
$('#dialogMaxAtt').val(0);
$('#dialogRegLine').hide();
$('#dialogPendLine').hide();
// Initialize the event data object with submitted data
var newEvent = {
+ {if $regEvent.time_specific.value}
title: startTime + ' unlimited',
+ {else}
+ title: '',
+ {/if}
start: date.format() + ' ' + startTime,
end: date.format() + ' ' + $('#dialogEndTime').val(),
active: $('#dialogRegActive').is(":checked"),
timeId: false
};
+ {if $regEvent.time_specific.value}
// If max or active is set, override the defaults
if (newEvent.max > 0 ) {
newEvent.title = startTime + ' ' + newEvent.max + '-0-0-' + newEvent.max
if (newEvent.active) {
newEvent.backgroundColor = 'light-blue';
}
-
+ {/if}
// Try to send the data via AJAX
var newTime = $.ajax({
$('#availabilityEditDialog').dialog('open');
- $('#dialogAllDayLine').hide();
+ $('#dialogAllDayLine').show();
$('#dialogTrackLine').hide();
- $('#dialogStartTimeLine').hide();
- $('#dialogEndTimeLine').hide();
+ $('#dialogTimeAllDay').show();
+ $('#dialogStartTimeLine').show();
+ $('#dialogEndTimeLine').show();
$('#availabilityTitle').html(calEvent.datetime);
$('#dialogRegActive').prop('checked', calEvent.active);
- $('#dialogTimeAllDay').prop('checked', calEvent.allDay);
$('#dialogStartTime').val(calEvent.start);
$('#dialogEndTime').val(calEvent.end);
+ $('#dialogTimeAllDay').prop('checked', calEvent.allDay);
$('#dialogMaxAtt').val(calEvent.max);
$('#dialogRegLine').show();
$('#dialogRegAtt').html(calEvent.count);
$('#dialogAvailLine').show();
$('#dialogAvailAtt').html(calEvent.available);
$('#dialogAvailSubmit').attr('data-timeid', calEvent.timeid);
+
// Re-calculate total available when entering
$('#dialogMaxAtt').on('change', function() {
});
$('#availabilityEditDialog').dialog('close');
$('#dialogAvailSubmit').off('click');
-
+
+ {if $regEvent.time_specific.value}
calEvent.title = max + '-' + calEvent.count + '-' + calEvent.pending + '-' + calEvent.available;
+ {else}
+ calEvent.title = '';
+ {/if}
$('#eventCalendar').fullCalendar('updateEvent', calEvent);
});