Added hasTimes flag to registration class in getEventForRegistration()
authorChuck Scott <cscott@gaslightmedia.com>
Wed, 18 Oct 2017 14:12:15 +0000 (10:12 -0400)
committerChuck Scott <cscott@gaslightmedia.com>
Wed, 18 Oct 2017 14:12:15 +0000 (10:12 -0400)
classes/data/dataRegEvent.php

index ec94f45..f5f0902 100644 (file)
@@ -664,6 +664,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
             } else {
 
                 $this->regEventData['reg_class'][$ck]['times'] = array();
+                $this->regEventData['reg_class'][$ck]['hasTimes'] = false;
 
                 // For each event time
                 foreach ($this->regEventData['reg_time'] as $tk=>$tv) {
@@ -684,6 +685,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                                 // If it's time to register with this time/rate - Add it to the class data
                                 if (time() > $earliestTime && time() < $latestTime) {
                                     $this->regEventData['reg_class'][$ck]['times'][$tv['event_time']] = array_merge($tv, $rv);
+                                    $this->regEventData['reg_class'][$ck]['hasTimes'] = true;
                                 }
 
                             }
@@ -707,6 +709,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
                                 // If it's time to register with this time/rate - Add it to the class data
                                 if (time() > $earliestTime && time() < $latestTime) {
                                     $this->regEventData['reg_class'][$ck]['times'][$tv['event_time']] = array_merge($tv, $rv);
+                                    $this->regEventData['reg_class'][$ck]['hasTimes'] = true;
                                 }
 
                             }
@@ -728,7 +731,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract
         // Get rid of all of the recurrence data - No longer needed
         unset($this->regEventData['recurrences']);
 
-        // Get rid of the provided reg_time entries
+        // Get rid of the provided reg_time entries - No longer needed
         unset($this->regEventData['reg_time']);
 
         // echo "<pre>".print_r($this->regEventData,1)."<pre>";