early access code development

This commit is contained in:
2017-06-29 11:38:26 +10:00
parent f7345875f8
commit d1dc168197

View File

@@ -36,8 +36,9 @@ 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, true)
'form' => drupal_get_form('booking_form', true, ($booking_times->booking_register_open < time()))
);
} elseif ($booking_times->booking_register_close < time()) {
//too late to register
@@ -939,6 +940,16 @@ function booking_form_validate($form, &$form_state) {
$data = $form_state['input'];
//watchdog('booking', '<pre>Booking registration form validation:\n@info</pre>', array('@info' => print_r( $data, true)));
//if necessary, validate early access code
if (variable_get('booking_enable_earlyaccess_codes', 0) == 1) {
if (isset($data['booking_regn_earlyaccess_code']) && $data['booking_regn_earlyaccess_code'] != '') {
}
else {
form_set_error('booking_regn_earlyaccess_code', t('You must enter an early access code to register now. If you do not have a code, please wait until normal registrations open.'));
}
}
//in case the date of birth field hasn't been filled out
watchdog('booking', 'Blank date of birth checking: @info', array(
'@info' => var_export($data['booking_dob'], TRUE)
@@ -970,7 +981,6 @@ function booking_form_validate($form, &$form_state) {
//verify partner id is in the correct format
if (isset($data['booking_partner_id']) && $data['booking_partner_id'] != '') {
if (!is_numeric($data['booking_partner_id'])) {
form_set_error('booking_partner_id', t('You have entered an invalid partner registration id. Please ensure you are using only the registration reference number your partner received via email. If you believe this to be incorrect, please !contact using the details provided.', array(
'!contact' => l('contact us', 'contact')