Some formatting of travel information

This commit is contained in:
2014-02-28 17:42:04 +11:00
parent 397448d47c
commit 481c8251e5
2 changed files with 47 additions and 27 deletions

View File

@@ -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 " .