From 93881117e8b5680692701cdd2c0e2f917cd53e51 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Tue, 22 May 2018 12:32:09 +1000 Subject: [PATCH] form tweaks --- booking.emails_admin.inc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/booking.emails_admin.inc b/booking.emails_admin.inc index 5d0432c..2f0fd1b 100644 --- a/booking.emails_admin.inc +++ b/booking.emails_admin.inc @@ -356,8 +356,9 @@ function booking_emails_custom_ajax_form_callback($form, &$form_state) { $data = $form_state['input']; //check the selected email type - //configure the input text field and textarea based on select field $emailtype = $form_state['input']['email-type']; + + //configure the input text field and textarea based on select field if (strpos($emailtype, 'custom') !== false) { $subject = variable_get('booking_email_subject_' . $emailtype, ''); $form['form']['email-definition']['booking_email_subjectline_custom']['#value'] = $subject; @@ -367,9 +368,11 @@ function booking_emails_custom_ajax_form_callback($form, &$form_state) { //watchdog('booking_debug', 'custom text:
@info
', array('@info' => print_r( $text, true))); // TODO : Figure out what this should be if HTML emails are NOT enabled $form['form']['email-definition']['booking_email_body_custom']['value']['#value'] = $text; - - $form['form']['storage']['emailtype'] = $emailtype; - } + } + else { + $form['form']['email-definition']['booking_email_subjectline_custom']['#value'] = ''; + $form['form']['email-definition']['booking_email_body_custom']['value']['#value'] = ''; + } //watchdog('booking_debug', 'booking_emails_custom_ajax_form_callback:
@info
', array('@info' => print_r( $form, true)));