formatting

This commit is contained in:
2016-06-04 10:47:18 +10:00
parent 9f648c755d
commit 431c0d7eb1

View File

@@ -364,7 +364,10 @@ function travel_form_validate($form, &$form_state) {
if (isset($form_state['values']['booking_bf_gf_nid']) && $form_state['values']['booking_bf_gf_nid'] != '') { if (isset($form_state['values']['booking_bf_gf_nid']) && $form_state['values']['booking_bf_gf_nid'] != '') {
//make sure this is a node id not something else //make sure this is a node id not something else
if (!is_numeric($form_state['values']['booking_bf_gf_nid'])) { if (!is_numeric($form_state['values']['booking_bf_gf_nid'])) {
form_set_error('booking_bf_gf_nid', t('You have entered an invalid registration id for your boyfriend/girlfriend. ' . 'Please ensure you are using only the registration reference number your boyfriend/girlfriend received via email. For example, your registration ID is !id. ' . 'If you believe this to be incorrect, please !contact using the details provided.', array( form_set_error('booking_bf_gf_nid', t('You have entered an invalid registration id for your boyfriend/girlfriend. ' .
'Please ensure you are using only the registration reference number your boyfriend/girlfriend received via email. For example, your registration ID is !id. ' .
'If you believe this to be incorrect, please !contact using the details provided.',
array(
'!id' => $form_state['values']['personid'], '!id' => $form_state['values']['personid'],
'!contact' => l('contact us', 'contact') '!contact' => l('contact us', 'contact')
))); )));
@@ -374,7 +377,8 @@ function travel_form_validate($form, &$form_state) {
} }
//don't allow them to specify their own node id //don't allow them to specify their own node id
elseif ($form_state['values']['personid'] == $form_state['values']['booking_bf_gf_nid']) { elseif ($form_state['values']['personid'] == $form_state['values']['booking_bf_gf_nid']) {
form_set_error('booking_bf_gf_nid', t('You have entered your own registration id.' . 'Please ensure you enter only the registration reference number your boyfriend/girlfriend received via email when registering, not your own registration id.')); form_set_error('booking_bf_gf_nid', t('You have entered your own registration id. ' .
'Please ensure you enter only the registration reference number your boyfriend/girlfriend received via email when registering, not your own registration id.'));
watchdog('booking', "<pre>Travel form bf/gf same as person id\n@info</pre>", array( watchdog('booking', "<pre>Travel form bf/gf same as person id\n@info</pre>", array(
'@info' => print_r($form_state['values'], true) '@info' => print_r($form_state['values'], true)
)); ));
@@ -384,7 +388,10 @@ function travel_form_validate($form, &$form_state) {
':nid' => $form_state['values']['booking_bf_gf_nid'] ':nid' => $form_state['values']['booking_bf_gf_nid']
))->fetchObject(); ))->fetchObject();
if (!$partner) { if (!$partner) {
form_set_error('booking_bf_gf_nid', t('We cannot find a matching registration id for your boyfriend/girlfriend. ' . 'Please ensure you are using only the number that relates to their registration. For example, your registration ID is !id. ' . 'If you believe this to be incorrect, please !contact using the details provided.', array( form_set_error('booking_bf_gf_nid', t('We cannot find a matching registration id for your boyfriend/girlfriend. ' .
'Please ensure you are using only the number that relates to their registration. For example, your registration ID is !id. ' .
'If you believe this to be incorrect, please !contact using the details provided.',
array(
'!id' => $form_state['values']['personid'], '!id' => $form_state['values']['personid'],
'!contact' => l('contact us', 'contact') '!contact' => l('contact us', 'contact')
))); )));