From: Chuck Scott Date: Thu, 30 Nov 2017 20:31:51 +0000 (-0500) Subject: Fixed deleting registrant when ulimited registrationsf or a non-time-specific event... X-Git-Tag: v1.0.0^2~238 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=83d095a560047fd8daf54bec7f85849d1cc7b6e2;p=WP-Plugins%2Fglm-member-db-registrations.git Fixed deleting registrant when ulimited registrationsf or a non-time-specific event. Fixed some reg event dashboard display issues. --- diff --git a/classes/regCartSupport.php b/classes/regCartSupport.php index 25e247a..ff8744a 100644 --- a/classes/regCartSupport.php +++ b/classes/regCartSupport.php @@ -935,7 +935,7 @@ class GlmRegCartSupport * @param integer $registrantId ID of registrant * @param integer $timeId ID of reg_time record * - * @return array A reg_time_pending record - FALSE if unable to get hold + * @return array A reg_time_pending record - FALSE if unable to get hold, TRUE if unlimited registration * @access public */ public function addRegTimePending($registrantId, $timeId) @@ -956,9 +956,18 @@ class GlmRegCartSupport AND E.id = T.reg_event ;", ARRAY_A); - // Check if no time record was found or there is no availability + // Check if no time record was found + if ($timeData == null) { + return false; + } + + // Check if this time has unlimited availability + if ($timeData['attendee_max'] == 0) { + return true; + } - if ($timeData == null || !isset($timeData['attendees_available']) || $timeData['attendees_available'] <= 0) { + // Check if there is no availability + if (!isset($timeData['attendees_available']) || $timeData['attendees_available'] <= 0) { return false; } diff --git a/views/admin/registrations/eventDashboard.html b/views/admin/registrations/eventDashboard.html index 1dc5717..f9e515c 100644 --- a/views/admin/registrations/eventDashboard.html +++ b/views/admin/registrations/eventDashboard.html @@ -257,13 +257,17 @@ Active: All Day: + {if $regEvent.time_specific.value} Track Attendees: + {/if} Start Time: End Time: + {if $regEvent.time_specific.value} Maximum Attendees: 0 = Unlimited Registered Attendees: Pending in Carts: Available for Registration: + {/if}
Upate
@@ -345,11 +349,15 @@ {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}, @@ -381,9 +389,9 @@ $('#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(); @@ -397,7 +405,11 @@ // 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"), @@ -411,6 +423,7 @@ 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 @@ -418,7 +431,7 @@ if (newEvent.active) { newEvent.backgroundColor = 'light-blue'; } - + {/if} // Try to send the data via AJAX var newTime = $.ajax({ @@ -473,16 +486,17 @@ $('#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); @@ -491,6 +505,7 @@ $('#dialogAvailLine').show(); $('#dialogAvailAtt').html(calEvent.available); $('#dialogAvailSubmit').attr('data-timeid', calEvent.timeid); + // Re-calculate total available when entering $('#dialogMaxAtt').on('change', function() { @@ -523,8 +538,12 @@ }); $('#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); });