Fixes for values not set at initial registration form

This commit is contained in:
2015-03-09 15:32:05 +11:00
parent aad31946c6
commit a38d42b489
3 changed files with 57 additions and 46 deletions

View File

@@ -1253,8 +1253,11 @@ function _booking_details_email_summary($node) {
* Helper function to format travel form summary * Helper function to format travel form summary
*/ */
function _booking_travelform_email_summary($node) { function _booking_travelform_email_summary($node) {
$output = ''; global $event;
$rows = array();
if (! empty($node->tid))
{
//look up the actual name if a boyfriend/girlfriend is defined //look up the actual name if a boyfriend/girlfriend is defined
if ($node->booking_bf_gf_nid != 0) if ($node->booking_bf_gf_nid != 0)
{ {
@@ -1273,7 +1276,8 @@ function _booking_travelform_email_summary($node) {
if ($node->booking_transport_type == 'Flying') if ($node->booking_transport_type == 'Flying')
{ {
$rows[] = t('Catching the train to Study Week: !value', array('!value' => $node->booking_transport_from_morriset_reqd == 1 ? 'Yes' : 'No')); $rows[] = t('Catching the train to Study Week: !value',
array('!value' => $node->booking_transport_from_morriset_reqd == 1 ? 'Yes' : 'No'));
$rows[] = t('Inbound Flight Number: ' . $node->booking_flightnum_inbound); $rows[] = t('Inbound Flight Number: ' . $node->booking_flightnum_inbound);
$rows[] = t('Flight Arrival: !date', array('!date' => format_date($node->booking_flight_datetime_inbound, 'custom', 'd/m/Y H:i'))); $rows[] = t('Flight Arrival: !date', array('!date' => format_date($node->booking_flight_datetime_inbound, 'custom', 'd/m/Y H:i')));
$rows[] = t('Outbound Flight Number: ' . $node->booking_flightnum_outbound); $rows[] = t('Outbound Flight Number: ' . $node->booking_flightnum_outbound);
@@ -1281,17 +1285,20 @@ function _booking_travelform_email_summary($node) {
} }
$rows[] = t('Accommodation before Study Week Required: !value', array('!value' => $node->booking_accom_before_reqd == 1 ? 'Yes' : 'No')); $rows[] = t('Accommodation before Study Week Required: !value', array('!value' => $node->booking_accom_before_reqd == 1 ? 'Yes' : 'No'));
$rows[] = t('Accommodation after Study Week Required: !value', array('!value' => $node->booking_accom_after_reqd == 1 ? 'Yes' : 'No')); $rows[] = t('Accommodation after Study Week Required: !value', array('!value' => $node->booking_accom_after_reqd == 1 ? 'Yes' : 'No'));
//fields from booking_person //fields from booking_person
if (variable_get('booking_enable_dietary', 0) == 1) if (variable_get('booking_enable_dietary', 0) == 1)
$rows[] = t('Special Dietary Requirements: ' . $node->booking_dietary); $rows[] = t('Special Dietary Requirements: ' . $node->booking_dietary);
if (variable_get('booking_enable_roommate', 0) == 1) if (variable_get('booking_enable_roommate', 0) == 1)
$rows[] = t('Special Medical Conditions: ' . $node->booking_medical_conditions); $rows[] = t('Special Medical Conditions: ' . $node->booking_medical_conditions);
$rows[] = t('Boyfriend/Girlfriend: ' . $bf_gf); $rows[] = t('Boyfriend/Girlfriend: ' . $bf_gf);
$rows[] = t('Requested room mate(s): ' . $node->booking_room_mate1); $rows[] = t('Requested room mate(s): ' . $node->booking_room_mate1);
foreach ($rows as $key => $value) foreach ($rows as $key => $value)
$rows[$key] = wordwrap($value); $rows[$key] = wordwrap($value);
}
return implode("\n", $rows); return implode("\n", $rows);
} }

View File

@@ -1324,7 +1324,7 @@ function booking_load($nodes) {
} }
} }
//watchdog('booking', 'Final loaded node: @info', array('@info' => var_export($nodes, TRUE))); watchdog('booking', 'Final loaded node: @info', array('@info' => var_export($nodes, TRUE)));
// no return necessary since $nodes array members reference objects global to this function // no return necessary since $nodes array members reference objects global to this function
} }

View File

@@ -713,19 +713,23 @@ function booking_define_personspecific_tokens($node)
$tokens['payment-transaction-desc'] = $node->nid . ' ' . $node->booking_lastname; $tokens['payment-transaction-desc'] = $node->nid . ' ' . $node->booking_lastname;
$tokens['balance-payment-link'] = url('balance/' . $tempid, array('absolute' => TRUE)); $tokens['balance-payment-link'] = url('balance/' . $tempid, array('absolute' => TRUE));
$tokens['confirm-payment-link'] = url('confirm/' . $tempid, array('absolute' => TRUE)); $tokens['confirm-payment-link'] = url('confirm/' . $tempid, array('absolute' => TRUE));
$tokens['travel-link'] = url('travel/' . $tempid, array('absolute' => TRUE));
$tokens['paypal-total-amount'] = _booking_amount_owing($node, $amount_paid); $tokens['paypal-total-amount'] = _booking_amount_owing($node, $amount_paid);
//$tokens['paypal-total-amount'] = _booking_amount_owing($node->nid, $amount_paid); //$tokens['paypal-total-amount'] = _booking_amount_owing($node->nid, $amount_paid);
$tokens['paypal-deposit-amount'] = _booking_deposit_amount(); $tokens['paypal-deposit-amount'] = _booking_deposit_amount();
$tokens['regn-summary'] = _booking_details_email_summary($node); $tokens['regn-summary'] = _booking_details_email_summary($node);
if (variable_get('booking_enable_travelform', 0) == 1) {
$tokens['travel-link'] = url('travel/' . $tempid, array('absolute' => TRUE));
$tokens['travel-summary'] = _booking_travelform_email_summary($node); $tokens['travel-summary'] = _booking_travelform_email_summary($node);
}
if (variable_get('booking_enable_studygroups', 0) == 1) {
$tokens['studygroup-summary'] = _booking_studygroup_email_summary($node); $tokens['studygroup-summary'] = _booking_studygroup_email_summary($node);
$tokens['leaderhelper-pair'] = _booking_leader_helper_email_summary($node); $tokens['leaderhelper-pair'] = _booking_leader_helper_email_summary($node);
}
if (variable_get('booking_enable_roomallocations', 0) == 1) if (variable_get('booking_enable_roomallocations', 0) == 1)
{ {
$tokens['room-allocation'] = _booking_room_email_summary($node); $tokens['room-allocation'] = _booking_room_email_summary($node);
$tokens['bed-type'] = _booking_room_bedtype_lookup($node->booking_room_bedtype); $tokens['bed-type'] = _booking_room_bedtype_lookup(empty($node->booking_room_bedtype) ? '0' : $node->booking_room_bedtype);
} }
return $tokens; return $tokens;