From: Chuck Scott Date: Thu, 30 Nov 2017 21:31:11 +0000 (-0500) Subject: Fixed problem where times were not being included for classes for front-end time... X-Git-Tag: v1.0.0^2~237 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=a09c7c42ad3d416f9c618a19a2af35dfbf1dbbec;p=WP-Plugins%2Fglm-member-db-registrations.git Fixed problem where times were not being included for classes for front-end time-specific events. --- diff --git a/classes/data/dataRegEvent.php b/classes/data/dataRegEvent.php index 34cf6d3..b2d380c 100644 --- a/classes/data/dataRegEvent.php +++ b/classes/data/dataRegEvent.php @@ -706,12 +706,12 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract } // Get recurrence data from the event add-on - $this->regEventData['recurrences'] = apply_filters('glm-member-db-events-get-event-times', $this->regEventData['event']); +// $this->regEventData['recurrences'] = apply_filters('glm-member-db-events-get-event-times', $this->regEventData['event']); // If we don't have recurrences for the event - if (!is_array($this->regEventData['recurrences']) || count($this->regEventData['recurrences']) == 0) { - return false; - } +// if (!is_array($this->regEventData['recurrences']) || count($this->regEventData['recurrences']) == 0) { +// return false; +// } // Get the first and last times in the reg_times entries $firstTime = false; @@ -851,6 +851,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract if (!is_array($this->regEventData['reg_time']) || count($this->regEventData['reg_time']) == 0) { return false; } + /* // Check reg_time array $timeSpecific = $this->regEventData['time_specific']['value']; @@ -897,12 +898,12 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract // If we don't have any rates for this class, remove the class if (!is_array($regClass['reg_rate']) || count($regClass['reg_rate']) == 0) { - unset($this->regEventData['reg_class'][$regCLassKey]); + unset($this->regEventData['reg_class'][$regClassKey]); } else { - $this->regEventData['reg_class'][$regCLassKey]['times'] = array(); - $this->regEventData['reg_class'][$regCLassKey]['non_time_specific_time'] = array(); - $this->regEventData['reg_class'][$regCLassKey]['hasTimes'] = false; + $this->regEventData['reg_class'][$regClassKey]['times'] = array(); + $this->regEventData['reg_class'][$regClassKey]['non_time_specific_time'] = array(); + $this->regEventData['reg_class'][$regClassKey]['hasTimes'] = false; // For each event time except non-time-specific entry foreach ($this->regEventData['reg_time'] as $regTimeKey=>$regTime) { @@ -921,8 +922,8 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract $regRate['rate_id'] = $regRate['id']; unset($regRate['id']); - $this->regEventData['reg_class'][$regCLassKey]['times'][$regTime['event_time']] = array_merge($regTime, $regRate); - $this->regEventData['reg_class'][$regCLassKey]['hasTimes'] = true; + $this->regEventData['reg_class'][$regClassKey]['times'][$regTime['event_time']] = array_merge($regTime, $regRate); + $this->regEventData['reg_class'][$regClassKey]['hasTimes'] = true; } } @@ -930,7 +931,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract } - // If event time is for time-specific event (might be either mixed in) + // If event time is for non-time-specific event if ($regTime['non_time_specific']) { // Try to find a current rate for this time - within the start and end days before this time @@ -948,8 +949,8 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract $regRate['rate_id'] = $regRate['id']; unset($regRate['id'], $regRate['reg_event']); - $this->regEventData['reg_class'][$regCLassKey]['times'][$regTime['event_time']] = array_merge($regTime, $regRate); - $this->regEventData['reg_class'][$regCLassKey]['hasTimes'] = true; + $this->regEventData['reg_class'][$regClassKey]['times'][$regTime['event_time']] = array_merge($regTime, $regRate); + $this->regEventData['reg_class'][$regClassKey]['hasTimes'] = true; } } @@ -959,7 +960,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract } // Have rates for this class // Drop the rate supplied rate data that's now merged with time and saved with the class. - unset($this->regEventData['reg_class'][$ck]['reg_rate']); +// unset($this->regEventData['reg_class'][$regClassKey]['reg_rate']); } // for each class @@ -967,7 +968,7 @@ class GlmDataRegistrationsRegEvent extends GlmDataAbstract unset($this->regEventData['recurrences']); // Get rid of the provided reg_time entries - No longer needed - unset($this->regEventData['reg_time']); +// oops! unset($this->regEventData['reg_time']); // echo "
".print_r($this->regEventData,1)."
"; diff --git a/models/front/registrations/registration.php b/models/front/registrations/registration.php index 0e35a53..65f6ada 100644 --- a/models/front/registrations/registration.php +++ b/models/front/registrations/registration.php @@ -209,6 +209,7 @@ if ( $classStartingTime == '' || $time['start_datetime']['timestamp'] < $classStartingTime['start_datetime']['timestamp'] ) { $classStartingTime = $time; } + $rClass['loggedIn'] = ( isset($_SESSION['LoginAccount']) ) ? true : false; $rClass['reg_event'] = $regEventId; $rClass['reg_rate_id'] = $time['id'];