move logistics emails also

This commit is contained in:
2017-07-02 09:16:05 +10:00
parent 8444477ab2
commit 45d473a646
2 changed files with 74 additions and 6 deletions

View File

@@ -74,7 +74,7 @@ function booking_emails_workflow_admin() {
'#type' => 'fieldset',
'#title' => 'Built-In Workflow Email Definitions',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#collapsed' => FALSE,
);
//if HTML mail is enabled, allow user to specify footer
@@ -261,6 +261,7 @@ function booking_emails_workflow_admin() {
*/
/*Text for logistics emails*/
/*
$form['custom-logistics-emails'] = array(
'#type' => 'fieldset',
'#title' => 'Custom Logistics Email Text Definitions',
@@ -288,7 +289,7 @@ function booking_emails_workflow_admin() {
'#format' => $form_format,
);
}
*/
//let the builtin hook do all the hard work
return system_settings_form($form, FALSE);
}
@@ -319,11 +320,68 @@ function booking_emails_custom_admin() {
);
/*Text for emails*/
$form['custom-logistics-emails'] = array(
'#type' => 'fieldset',
'#title' => 'Custom Logistics 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 (
'#type' => 'textfield',
'#title' => t('Subject line for Logistics Custom Email ' . $i),
'#size' => 150,
'#maxlength' => 300,
'#default_value' => variable_get($subject_fieldname,'[booking:eventname] Logistics'),
);
$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,
);
}
//let the builtin hook do all the hard work
return system_settings_form($form, FALSE);
}
/**
* Function to allow admin user to define custom logistics emails that can be sent by Bookings module, from the logistics email address
*
* @param
* @return form render array
*/
function booking_emails_custom_admin() {
global $event;
$form = array();
if(variable_get('booking_enable_html_mail', 0) == 1) {
$form_type = 'text_format';
$form_format = 'full_html';
}
else {
$form_type = 'textarea';
$form_format = NULL;
}
//include the token definitions
$form['tokens'] = array(
'#theme' => 'token_tree',
'#token_types' => array('booking'),
);
/*Text for logistics emails*/
$form['custom-emails'] = array(
'#type' => 'fieldset',
'#title' => 'Custom Email Text Definitions',
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#collapsed' => FALSE,
);
//add a bunch of custom emails
@@ -345,6 +403,8 @@ function booking_emails_custom_admin() {
'#format' => $form_format,
);
}
//let the builtin hook do all the hard work
return system_settings_form($form, FALSE);
}
/**

View File

@@ -205,7 +205,15 @@ function booking_menu() {
'file' => 'booking.emails_admin.inc',
'type' => MENU_LOCAL_ACTION,
);
$items['admin/config/booking/emails/logistics'] = array(
'title' => 'Booking module custom logistics email definitions',
'description' => 'Configure custom logistics emails used by the Booking module',
'page callback' => 'drupal_get_form',
'page arguments' => array('booking_emails_customlogistics_admin'),
'access arguments' => array('access administration pages'),
'file' => 'booking.emails_admin.inc',
'type' => MENU_LOCAL_ACTION,
);
$items['admin/config/booking/events'] = array(
'title' => 'Booking module event settings',
'description' => 'Configure events for the Booking module',