Fixed problems with add/edit time dialog box start and end dates and showing incorrec...
authorChuck Scott <cscott@gaslightmedia.com>
Tue, 28 Nov 2017 19:43:32 +0000 (14:43 -0500)
committerChuck Scott <cscott@gaslightmedia.com>
Tue, 28 Nov 2017 19:43:32 +0000 (14:43 -0500)
Fixed getEventForRegistration() so that it would not check reg_time records for event_time values.
Removed account name from cart summary check code construction in checkoutProcess.php and summaryContent.php.

classes/data/dataRegEvent.php
models/admin/ajax/summaryContent.php
models/admin/registrations/events.php
models/front/registrations/checkoutProcess.php
views/admin/registrations/eventDashboard.html
views/front/registrations/checkout.html

index 2b10096..c14eee2 100644 (file)
@@ -836,7 +836,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
             if ($timeSpecific) {
 
                 // Remove entry if it's not time specific or is in the past
-                if ($timeVal['event_time'] == 0 || $timeVal['start_datetime']['timestamp'] < time()) {
+                if ($timeVal['start_datetime']['timestamp'] < time()) {         // remove     $timeVal['event_time'] == 0 ||
                     unset($this->regEventData['reg_time'][$timeKey]);
                 }
 
@@ -885,7 +885,8 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                     if ($this->regEventData['time_specific']['value']) {
 
                         // If event time is for time-specific event (might be either mixed in)
-                        if ($tv['event_time']) {
+// Not checking time specific/non-time specific reg_time records at this time due to adding reg_times manually that don't have event_time(s) that match
+//                        if ($tv['event_time']) {
 
                             // Try to find a current rate for this time - within the start and end days before this time
                             foreach ($cv['reg_rate'] as $rk=>$rv) {
@@ -907,7 +908,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
 
                             }
 
-                        }
+//                        }
 
                     // Otherwise for non time specific eventes - rate days are per the first event date
                     } else {
index b5c5b37..974889f 100644 (file)
@@ -87,7 +87,7 @@
         $check = $_REQUEST['check'];
 
         // Make sure the check code matches
-        $md5 = md5($requestId.GLM_MEMBERS_REGISTRATIONS_PLUGIN_SECRET.$request['account']);
+        $md5 = md5($requestId.GLM_MEMBERS_REGISTRATIONS_PLUGIN_SECRET);
         if ($md5 != $check) {
             wp_die();
         }
index e16ca6c..bb10932 100644 (file)
@@ -276,7 +276,7 @@ class GlmMembersAdmin_registrations_events extends GlmDataRegistrationsRegEvent
                                 $regEventUpdated = true;
 
                                 // Create all needed reg_time entries
-                                $this->checkEventTimes($regEventID);
+                                // $this->checkEventTimes($regEventID);
 
                             }
 
index 8de770f..84e7b5f 100644 (file)
@@ -658,7 +658,7 @@ class GlmMembersFront_registrations_checkoutProcess extends GlmRegCartSupport
         $view = 'summary';
 
         // Build check code for display of summary in iframe
-        $summaryCheck = md5($this->cart['request']['id'].GLM_MEMBERS_REGISTRATIONS_PLUGIN_SECRET.$this->cart['request']['account']);
+        $summaryCheck = md5($this->cart['request']['id'].GLM_MEMBERS_REGISTRATIONS_PLUGIN_SECRET);
 
         // Compile template data
         $templateData = array(
index 93a3a2c..984d2b2 100644 (file)
     <table>
         <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><th style="text-align: left">All Day:</th><td><input id="dialogTimeAllDay" type="checkbox" value=""></td></tr>
-        <tr><th style="text-align: left">Track Attendees:</th><td><input id="dialogAttendees" type="checkbox" value=""></td></tr>
-        <tr><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><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>
+        <tr id="dialogAllDayLine"><th style="text-align: left">All Day:</th><td><input id="dialogTimeAllDay" type="checkbox" value=""></td></tr>
+        <tr id="dialogTrackLine"><th style="text-align: left">Track Attendees:</th><td><input id="dialogAttendees" type="checkbox" value=""></td></tr>
+        <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>
         <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>
                               {/if}
                                 start:              '{$t.start_datetime.datetime}',
                                 end:                '{$t.end_datetime.datetime}',
-                                active:             {$t.active.value},
+                                active:             {if $t.active.value}true{else}false{/if},
                               {if $t.active.value}
                                 backgroundColor:    'light-blue',
                               {else}
                                 backgroundColor:    '#aaa',
                               {/if}
                                 allday:             {$t.all_day.value},
-                                attendees:          {$t.attendees.value},
+                                attendees:          {if $t.attendees.value}true{else}false{/if},
                                 max:                {$t.attendee_max},
                                 count:              {$t.attendee_count},
                                 pending:            {$t.attendees_pending},
 
                             $('#availabilityEditDialog').dialog('open');
 
-                            $('#availabilityTitle').html(calEvent.datetime);
-                            $('#dialogRegActive').prop('checked', calEvent.active)
-                            $('#dialogTimeAllDay').prop('checked', calEvent.allDay)
+                            $('#dialogAllDayLine').hide();
+                            $('#dialogTrackLine').hide();
+                            $('#dialogStartTimeLine').hide();
+                            $('#dialogEndTimeLine').hide();
                             
+                            $('#availabilityTitle').html(calEvent.datetime);
+                            $('#dialogRegActive').prop('checked', calEvent.active);
+                            $('#dialogTimeAllDay').prop('checked', calEvent.allDay);
+                            $('#dialogStartTime').val(calEvent.start);
+                            $('#dialogEndTime').val(calEvent.end);
                             $('#dialogMaxAtt').val(calEvent.max);
                             $('#dialogRegLine').show();
                             $('#dialogRegAtt').html(calEvent.count);
index e0f675c..c512050 100644 (file)
@@ -21,6 +21,7 @@
     <form id="checkoutForm" href="{$regUrl}" method="post">
         <input type="hidden" name="page" value="checkoutProcess">
         <input type="hidden" name="active" value="{$regAccount.fieldData.active.value}">
+        <input type="hidden" name="glm_reg_cart_id" value="{$cartId}">
 
         <a href="#cart-summary">See summary of registration request and charges below</a>