cleanup of logic

This commit is contained in:
Nathan Coad
2018-01-13 13:32:59 +11:00
parent 6a7260eec8
commit 2f91fef245

View File

@@ -37,9 +37,8 @@ function booking_register_page()
'#markup' => $output
)
);
//even if we are allowed to show the early access code, only show it if it is prior to the normal registration opening time
$return_array[] = array(
'form' => drupal_get_form('booking_form', true, $before_regn_open_check)
'form' => drupal_get_form('booking_form', true)
);
} elseif ($booking_times->booking_register_close < time()) {
//too late to register
@@ -64,7 +63,7 @@ function booking_register_page()
return $return_array;
}
function booking_form($node, &$form_state, $inserting = FALSE, $early_access_allowed = FALSE)
function booking_form($node, &$form_state, $inserting = FALSE)
{
global $event;
@@ -97,7 +96,6 @@ function booking_form($node, &$form_state, $inserting = FALSE, $early_access_all
$result = $price_query->execute();
//figure out if we're in the earlybird rate section and use that for determining pricing
// Registrations are open and before early bird closes
$earlybird_check = (($event->booking_register_open <= time()) && ($event->booking_earlybird_close > time()));
// Early access is allowed and the time now is before registrations would normally open
@@ -127,14 +125,6 @@ function booking_form($node, &$form_state, $inserting = FALSE, $early_access_all
'Without this code, your registration will not be accepted.<br />' .
'<p><strong>NOTE: each early-access code can only be used once, so don\'t pass it along to your friends!</strong></p></div><br />',
);
/*
$form['early-access']['booking_earlyaccess_explanation'] = array(
'#type' => 'container',
'#children' => t("<p>If you have been given an early-access code for registration, please enter it below. " .
"Without this code, your registration will not be accepted.</p>" .
"<p><strong>NOTE: each early-access code can only be used once, so don't pass it along to your friends!</strong></p>"),
);
*/
$form['early-access']['booking_earlyaccess_code'] = array(
'#type' => 'textfield',
'#title' => t('Unique Early-Access Code'),