diff --git a/booking.emails_admin.inc b/booking.emails_admin.inc index a6708f2..29d584b 100644 --- a/booking.emails_admin.inc +++ b/booking.emails_admin.inc @@ -320,31 +320,30 @@ function booking_emails_custom_admin() { ); /*Text for emails*/ - $form['custom-logistics-emails'] = array( + $form['custom-emails'] = array( '#type' => 'fieldset', - '#title' => 'Custom Logistics Email Text Definitions', + '#title' => 'Custom Email Text Definitions', '#collapsible' => TRUE, '#collapsed' => FALSE, ); //add a bunch of custom emails - //@todo add an admin variable for this - for ($i = 1; $i <= 5; $i++) { - $subject_fieldname = 'booking_email_subject_customlogistics' . $i; - $body_fieldname = 'booking_email_customlogistics' . $i; - $form['custom-logistics-emails'][$subject_fieldname] = array ( + for ($i = 1; $i <= variable_get('booking_custom_email_count','5'); $i++) { + $subject_fieldname = 'booking_email_subject_custom' . $i; + $body_fieldname = 'booking_email_custom' . $i; + $form['custom-emails'][$subject_fieldname] = array ( '#type' => 'textfield', - '#title' => t('Subject line for Logistics Custom Email ' . $i), + '#title' => t('Subject line for Custom Email ' . $i), '#size' => 150, '#maxlength' => 300, - '#default_value' => variable_get($subject_fieldname,'[booking:eventname] Logistics'), + '#default_value' => variable_get($subject_fieldname,'[booking:eventname]'), ); - $form['custom-logistics-emails'][$body_fieldname] = array( - '#title' => t('Email text for Logistics Custom Email ' . $i), - '#description' => t(''), + $form['custom-emails'][$body_fieldname] = array( + '#title' => t('Email text for custom email ' . $i), + '#description' => t(''), '#default_value' => isset(variable_get($body_fieldname)['value']) ? variable_get($body_fieldname)['value'] : variable_get($body_fieldname, ''), '#type' => $form_type, - '#format' => $form_format, + '#format' => $form_format, ); } //let the builtin hook do all the hard work @@ -377,30 +376,31 @@ function booking_emails_customlogistics_admin() { ); /*Text for logistics emails*/ - $form['custom-emails'] = array( + $form['custom-logistics-emails'] = array( '#type' => 'fieldset', - '#title' => 'Custom Email Text Definitions', + '#title' => 'Custom Logistics Email Text Definitions', '#collapsible' => TRUE, '#collapsed' => FALSE, ); //add a bunch of custom emails - for ($i = 1; $i <= variable_get('booking_custom_email_count','5'); $i++) { - $subject_fieldname = 'booking_email_subject_custom' . $i; - $body_fieldname = 'booking_email_custom' . $i; - $form['custom-emails'][$subject_fieldname] = array ( + //@todo add an admin variable for this + for ($i = 1; $i <= 5; $i++) { + $subject_fieldname = 'booking_email_subject_customlogistics' . $i; + $body_fieldname = 'booking_email_customlogistics' . $i; + $form['custom-logistics-emails'][$subject_fieldname] = array ( '#type' => 'textfield', - '#title' => t('Subject line for Custom Email ' . $i), + '#title' => t('Subject line for Logistics Custom Email ' . $i), '#size' => 150, '#maxlength' => 300, - '#default_value' => variable_get($subject_fieldname,'[booking:eventname]'), + '#default_value' => variable_get($subject_fieldname,'[booking:eventname] Logistics'), ); - $form['custom-emails'][$body_fieldname] = array( - '#title' => t('Email text for custom email ' . $i), - '#description' => t(''), + $form['custom-logistics-emails'][$body_fieldname] = array( + '#title' => t('Email text for Logistics Custom Email ' . $i), + '#description' => t(''), '#default_value' => isset(variable_get($body_fieldname)['value']) ? variable_get($body_fieldname)['value'] : variable_get($body_fieldname, ''), '#type' => $form_type, - '#format' => $form_format, + '#format' => $form_format, ); } //let the builtin hook do all the hard work