test full_html for textareas

This commit is contained in:
2017-06-27 08:29:21 +10:00
parent d88df40702
commit ec7a9ea0d8
4 changed files with 17 additions and 27 deletions

View File

@@ -611,7 +611,7 @@ function booking_admin() {
$form['regn_options']['booking_enable_earlyaccess_codes'] = array( $form['regn_options']['booking_enable_earlyaccess_codes'] = array(
'#type' => 'radios', '#type' => 'radios',
'#title' => t('Allow early access to registration form with unique code?'), '#title' => t('Allow early access to registration form with unique code?'),
'#description' => t('Select whether to enable the feature that will allow early registrations with a unique code. Note this feature is still under development.'), '#description' => t('Select whether to enable the feature that will allow early registrations with a unique code. Turning on this feature will allow registrations immediately, regardless of event registration start date.'),
'#options' => array( '#options' => array(
0 => t('No'), 0 => t('No'),
t('Yes') t('Yes')

View File

@@ -112,20 +112,25 @@ function _booking_regn_notifyonly_email($node, $balance_payment) {
function _booking_registration_email_generate($node, $waiting_list, $balance_payment, $manual) { function _booking_registration_email_generate($node, $waiting_list, $balance_payment, $manual) {
global $event; global $event;
$tokens = booking_define_personspecific_tokens($node); $tokens = booking_define_personspecific_tokens($node);
$body = "";
if ($balance_payment == True) { if ($balance_payment == True) {
$contact_message = token_replace(variable_get('booking_email_regn_complete_text'), $tokens); $body = variable_get('booking_email_regn_complete_text');
//$contact_message = token_replace(variable_get('booking_email_regn_complete_text'), $tokens);
} }
elseif ($waiting_list == False) { elseif ($waiting_list == False) {
$contact_message = token_replace(variable_get('booking_email_bookedin_text'), $tokens); $body = variable_get('booking_email_bookedin_text');
//$contact_message = token_replace(variable_get('booking_email_bookedin_text'), $tokens);
} }
else { else {
//booking is on the waiting list //booking is on the waiting list
$contact_message = token_replace(variable_get('booking_email_waitinglist_text'), $tokens); $body = variable_get('booking_email_waitinglist_text');
//$contact_message = token_replace(variable_get('booking_email_waitinglist_text'), $tokens);
} }
watchdog('booking_debug', "<pre>Email generation:\n@info</pre>", array('@info' => print_r( $body, true)));
//$contact_message .= "\n\n" . t("!details", array('!details' => _booking_details_email_summary($node))); //$contact_message .= "\n\n" . t("!details", array('!details' => _booking_details_email_summary($node)));
return $contact_message; return token_replace($body, $tokens);
} }

View File

@@ -64,14 +64,14 @@ function booking_emails_admin() {
$form['emails']['booking_email_notification_text'] = array( $form['emails']['booking_email_notification_text'] = array(
'#title' => t('Notification Email'), '#title' => t('Notification Email'),
'#type' => 'textarea', '#type' => 'textarea',
//'#format' => 'full_html', '#format' => 'full_html',
'#description' => t('Email to send to the notification email address (defined in general configuration) when a person has registered'), '#description' => t('Email to send to the notification email address (defined in general configuration) when a person has registered'),
'#default_value' => variable_get('booking_email_notification_text', '[booking:regn-summary]'), '#default_value' => variable_get('booking_email_notification_text', '[booking:regn-summary]'),
); );
$form['emails']['booking_email_bookedin_text'] = array( $form['emails']['booking_email_bookedin_text'] = array(
'#title' => t('Registration Successful Email'), '#title' => t('Registration Successful Email'),
'#type' => 'textarea', '#type' => 'textarea',
//'#format' => 'full_html', '#format' => 'full_html',
'#description' => t('Text to use in an email indicating the person has booked in, paid their deposit and is not on the waiting list'), '#description' => t('Text to use in an email indicating the person has booked in, paid their deposit and is not on the waiting list'),
'#default_value' => variable_get('booking_email_bookedin_text', $default_email_text), '#default_value' => variable_get('booking_email_bookedin_text', $default_email_text),
); );
@@ -626,7 +626,7 @@ function _booking_email_get_default_selection_callback($form, $form_state) {
* Function to handle sending the manual emails * Function to handle sending the manual emails
*/ */
function booking_manual_email_form_submit($form, &$form_state) { function booking_manual_email_form_submit($form, &$form_state) {
$counter = 0; $counter = 0;
$update_messages = array(); $update_messages = array();
$checkboxes = $form_state['values']['table']; //$values['booking_price_active']; $checkboxes = $form_state['values']['table']; //$values['booking_price_active'];
//watchdog('booking', 'Formstate when setting buttons: @info', array ('@info' => var_export($form_state['values'], TRUE))); //watchdog('booking', 'Formstate when setting buttons: @info', array ('@info' => var_export($form_state['values'], TRUE)));

View File

@@ -86,24 +86,7 @@ function booking_form($node, &$form_state, $inserting = FALSE, $early_access_all
//watchdog('booking', 'Booking registration form loading data from form submission: @info', array('@info' => var_export($form_state, TRUE))); //watchdog('booking', 'Booking registration form loading data from form submission: @info', array('@info' => var_export($form_state, TRUE)));
} }
//figure out if we're in the earlybird rate section //figure out if we're in the earlybird rate section and use that for determining pricing
/*
$early = db_query("SELECT booking_earlybird_close FROM {booking_event} where eid = :eid",
array(
':eid' => $event->eid
))->fetchObject();
if ($early->booking_earlybird_close > time())
$select_early = 1;
else {
$select_early = 0;
//watchdog('booking', 'No longer accepting earlybird prices');
}
$result = db_query("SELECT pid, booking_price_descrip, booking_price, booking_late_price FROM {booking_price} where booking_eventid = :eid " . "and booking_price_active=1 and booking_depositonly = 0", array(
':eid' => $event->eid
));
*/
$select_early = _booking_is_earlybird(); $select_early = _booking_is_earlybird();
$price_query = db_select('booking_price', 'p'); $price_query = db_select('booking_price', 'p');
@@ -948,6 +931,8 @@ function booking_form($node, &$form_state, $inserting = FALSE, $early_access_all
return $form; return $form;
} }
// @todo - validate the early access code here, booking_regn_earlyaccess_code
function booking_form_validate($form, &$form_state) { function booking_form_validate($form, &$form_state) {
global $event; global $event;
$node = $form_state['values']['form_id']; $node = $form_state['values']['form_id'];