From: Chuck Scott Date: Wed, 13 Dec 2017 16:36:44 +0000 (-0500) Subject: Fixed numerous problems with adding dates to the availability calendar in the reg... X-Git-Tag: v1.0.0^2~222 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=c0f65bb53de384db915869a69cfa031e9aab4cf8;p=WP-Plugins%2Fglm-member-db-registrations.git Fixed numerous problems with adding dates to the availability calendar in the reg event dashboard. --- diff --git a/classes/data/dataRegEvent.php b/classes/data/dataRegEvent.php index 1b92734..2bff88c 100644 --- a/classes/data/dataRegEvent.php +++ b/classes/data/dataRegEvent.php @@ -174,7 +174,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract 'field' => 'admin_active', 'type' => 'checkbox', 'use' => 'a', - 'default' => 0 + 'default' => 1 ), // Active flag to indicate that this event is available for registrations diff --git a/config/plugin.ini b/config/plugin.ini index 49019dd..2e00476 100644 --- a/config/plugin.ini +++ b/config/plugin.ini @@ -22,12 +22,10 @@ show_rate_type_numb['From'] = 20 registration_account_option[1] = 'Guest Registration' registration_account_option[2] = 'Saved Registration Accounts' registration_account_option[3] = 'Member Contact Registrations' -registration_account_option[4] = 'Ask for Alternate/Emergency Contact' registration_account_option_numb['Guest'] = 1 registration_account_option_numb['Saved'] = 2 registration_account_option_numb['Member'] = 3 -registration_account_option_numb['AlternateContact'] = 4 ; ; Payment Method - Use as Bitmap Index or List diff --git a/models/admin/ajax/updateAvailability.php b/models/admin/ajax/updateAvailability.php index c71f4e2..fb0748e 100644 --- a/models/admin/ajax/updateAvailability.php +++ b/models/admin/ajax/updateAvailability.php @@ -60,6 +60,10 @@ public function modelAction($actionData = false) { + if (GLM_MEMBERS_PLUGIN_ADMIN_DEBUG) { + trigger_error("Registration Event: updateAvailability class called", E_USER_NOTICE); + } + $haveRequest = false; // Get new time flag @@ -92,6 +96,10 @@ // Get the reg_time entry id if ($newTime) { + $active = false; + if (isset($_REQUEST['active']) && $_REQUEST['active'] == 'true') { + $active = true; + } // This is a new entry $allDay = false; if (isset($_REQUEST['allDay']) && $_REQUEST['allDay'] == 'true') { diff --git a/models/admin/registrations/events.php b/models/admin/registrations/events.php index bb571aa..4636efb 100644 --- a/models/admin/registrations/events.php +++ b/models/admin/registrations/events.php @@ -115,6 +115,7 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent $regClassesJSON = false; $regTimesJSON = false; $regEventDeleted = false; + $classes = false; // Register the masked input script that we need for input controls wp_dequeue_script('glm-members-admin-maskedinput'); diff --git a/views/admin/registrations/eventDashboard.html b/views/admin/registrations/eventDashboard.html index 59290fc..1e00caf 100644 --- a/views/admin/registrations/eventDashboard.html +++ b/views/admin/registrations/eventDashboard.html @@ -224,10 +224,6 @@

Dates and Availability

Event occurs every day from first day to last day at the times shown.

- {foreach $regEvent.recurrenceSummary as $rs} - - - {/foreach} {foreach $regEvent.reg_time as $rt} {if $rt.non_time_specific.value} {if $rt.attendee_max == 0} @@ -268,8 +264,8 @@ {if $regEvent.time_specific.value} {/if} - - + + {if $regEvent.time_specific.value} @@ -349,6 +345,7 @@ function initFullCalendar(){ $('#eventCalendar').fullCalendar({ + timezone: 'local', {if $regEvent} // Add existing registration dates/times events: [ @@ -388,14 +385,13 @@ {/foreach} {/if} ], - // Clicking on a date cell (not a reg event) Brings up the new reg event dialog + // Clicking on a date cell (not an existing event time) Brings up the new date dialog dayClick: function(date, allDay, jsEvent, view) { $('#dialogAvailSubmit').off('click'); - - $('#availabilityTitle').html('Create New: '+date.format()); + $('#availabilityTitle').html('Create New: '+date.format('MM/DD/YYYY')); $('#availabilityEditDialog').dialog('open'); - $('#dialogRegActive').prop('checked', true); + $('#dialogRegActive').prop('checked', false); $('#dialogTimeAllDay').prop('checked', false); $('#dialogStartTime').val(''); $('#dialogEndTime').val(''); @@ -406,15 +402,23 @@ $('#dialogAvailLine').hide(); $('#dialogAvailSubmit').on('click', function() { + if ($('#dialogStartTime').val() == '' || $('#dialogEndTime').val() == '') { + alert('Both start and end times are required!'); + } else { + // Submit clicked - var max = $('#dialogMaxAtt').val(); + {if $regEvent.time_specific.value} + var max = $('#dialogMaxAtt').val(); + {else} + var max = 0; + {/if} var startDate = new Date($('#dialogStartTime').val()); var startTime = $('#dialogStartTime').val(); // Initialize the event data object with submitted data var newEvent = { {if $regEvent.time_specific.value} - title: startTime + ' unlimited', + title: ' unlimited', {else} title: '', {/if} @@ -423,7 +427,11 @@ active: $('#dialogRegActive').is(":checked"), backgroundColor: '#aaa', allDay: $('#dialogTimeAllDay').is(':checked'), - attendees: $('#dialogAttendees').is(':checked'), + {if $regEvent.time_specific.value} + attendees: $('#dialogAttendees').is(':checked'), + {else} + attendees: 0, + {/if} max: max, count: 0, pending: 0, @@ -434,7 +442,7 @@ {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 + newEvent.title = ' ' + newEvent.max + '-0-0-' + newEvent.max } if (newEvent.active) { newEvent.backgroundColor = 'light-blue'; @@ -476,6 +484,7 @@ }); + } }); },
First Day of Event: {$rs.firstTime.start_time.datetime} - {$rs.firstTime.end_time.datetime}
Last Day of Event: {$rs.lastTime.start_time.datetime} - {$rs.lastTime.end_time.datetime}
Track Attendees:
Start Time:
End Time:
Start Time:
End Time:
Maximum Attendees: 0 = Unlimited
Registered Attendees: