Some formatting of travel information
This commit is contained in:
@@ -306,17 +306,10 @@ function travel_form($node, &$form_state, $inserting = FALSE, $nid = 0)
|
||||
function travel_form_validate($form, &$form_state) {
|
||||
//watchdog('booking', "<pre>Travel form:\n@info</pre>", array('@info' => print_r( $form_state, true)));
|
||||
|
||||
//check that a transport choice has been made
|
||||
/*
|
||||
if ((! isset($form_state['booking_transport_type'])) || $form_state['booking_transport_type'] == NULL)
|
||||
{
|
||||
form_set_error('booking_transport_type', t('You must select a transport type.'));
|
||||
}
|
||||
*/
|
||||
//verify boyfriend/girlfriend id is in the correct format
|
||||
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
|
||||
if (! is_numeric($form_state['values']['booking_bf_gf_nid'] ))
|
||||
{
|
||||
form_set_error('booking_bf_gf_nid',
|
||||
@@ -325,6 +318,14 @@ function travel_form_validate($form, &$form_state) {
|
||||
);
|
||||
}
|
||||
|
||||
//don't allow them to specify their own node id
|
||||
if ($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.')
|
||||
);
|
||||
}
|
||||
|
||||
//check that the partner exists
|
||||
$partner = db_query("SELECT person.nid " .
|
||||
"FROM {booking_person} person " .
|
||||
|
Reference in New Issue
Block a user