fix email imploding for html mail of summaries
This commit is contained in:
@@ -1402,26 +1402,22 @@ function _booking_travelform_email_summary($node) {
|
|||||||
global $event;
|
global $event;
|
||||||
$rows = array();
|
$rows = array();
|
||||||
|
|
||||||
if (! empty($node->tid))
|
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) {
|
||||||
{
|
|
||||||
$query = db_query("Select booking_firstname, booking_lastname from {booking_person} where nid = :nid",
|
$query = db_query("Select booking_firstname, booking_lastname from {booking_person} where nid = :nid",
|
||||||
array(':nid' => $node->booking_bf_gf_nid))
|
array(':nid' => $node->booking_bf_gf_nid))
|
||||||
->fetchObject();
|
->fetchObject();
|
||||||
$bf_gf = $query->booking_firstname . " " . $query->booking_lastname;
|
$bf_gf = $query->booking_firstname . " " . $query->booking_lastname;
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
$bf_gf = "N/A";
|
$bf_gf = "N/A";
|
||||||
|
}
|
||||||
$rows = array();
|
|
||||||
|
|
||||||
$rows[] = t('Name: !first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname));
|
$rows[] = t('Name: !first !last', array('!first' => $node->booking_firstname, '!last' => $node->booking_lastname));
|
||||||
$rows[] = t('Transport Type: !transport', array('!transport' => $node->booking_transport_type));
|
$rows[] = t('Transport Type: !transport', array('!transport' => $node->booking_transport_type));
|
||||||
|
|
||||||
if ($node->booking_transport_type == 'Flying')
|
if ($node->booking_transport_type == 'Flying') {
|
||||||
{
|
|
||||||
$rows[] = t('Catching the train to Study Week: !value',
|
$rows[] = t('Catching the train to Study Week: !value',
|
||||||
array('!value' => $node->booking_transport_from_morriset_reqd == 1 ? 'Yes' : 'No'));
|
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);
|
||||||
@@ -1429,24 +1425,34 @@ function _booking_travelform_email_summary($node) {
|
|||||||
$rows[] = t('Outbound Flight Number: ' . $node->booking_flightnum_outbound);
|
$rows[] = t('Outbound Flight Number: ' . $node->booking_flightnum_outbound);
|
||||||
$rows[] = t('Flight Departure: !date', array('!date' => format_date($node->booking_flight_datetime_outbound, 'custom', 'd/m/Y H:i')));
|
$rows[] = t('Flight Departure: !date', array('!date' => format_date($node->booking_flight_datetime_outbound, 'custom', 'd/m/Y H:i')));
|
||||||
}
|
}
|
||||||
|
|
||||||
$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);
|
||||||
}
|
}
|
||||||
|
} //end empty travel node check
|
||||||
//watchdog('booking_debug', "<pre>Travel form summary\n@info</pre>", array('@info' => print_r( $rows, true)));
|
//watchdog('booking_debug', "<pre>Travel form summary\n@info</pre>", array('@info' => print_r( $rows, true)));
|
||||||
return implode("\n", $rows);
|
|
||||||
|
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
||||||
|
return implode("\n<br />", $rows);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return implode("\n", $rows);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1479,10 +1485,16 @@ function _booking_studygroup_email_summary($node) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($rows as $key => $value)
|
foreach ($rows as $key => $value) {
|
||||||
$rows[$key] = wordwrap($value);
|
$rows[$key] = wordwrap($value);
|
||||||
|
}
|
||||||
|
|
||||||
return implode("\n", $rows);
|
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
||||||
|
return implode("\n<br />", $rows);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return implode("\n", $rows);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1559,7 +1571,12 @@ function _booking_leader_helper_email_summary($node) {
|
|||||||
foreach ($rows as $key => $value) {
|
foreach ($rows as $key => $value) {
|
||||||
$rows[$key] = wordwrap($value);
|
$rows[$key] = wordwrap($value);
|
||||||
}
|
}
|
||||||
return implode("\n", $rows);
|
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
||||||
|
return implode("\n<br />", $rows);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return implode("\n", $rows);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1584,10 +1601,16 @@ function _booking_room_email_summary($node) {
|
|||||||
$rows[] = t("\tNo room currently allocated.");
|
$rows[] = t("\tNo room currently allocated.");
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($rows as $key => $value)
|
foreach ($rows as $key => $value) {
|
||||||
$rows[$key] = wordwrap($value);
|
$rows[$key] = wordwrap($value);
|
||||||
|
}
|
||||||
|
|
||||||
return implode("\n", $rows);
|
if(variable_get('booking_enable_html_mail', 0) == 1) {
|
||||||
|
return implode("\n<br />", $rows);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return implode("\n", $rows);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user