This commit is contained in:
2016-05-26 11:24:46 +10:00
parent fa969ee4a0
commit 8b208a5fdb

View File

@@ -125,7 +125,7 @@ function booking_manual_email()
'#type' => 'tableselect', '#type' => 'tableselect',
'#header' => $header, '#header' => $header,
'#options' => _booking_manual_email_generate_options(), '#options' => _booking_manual_email_generate_options(),
'#default_value' => $values, //'#default_value' => $values,
'#empty' => t('No attendees found.'), '#empty' => t('No attendees found.'),
'#attributes' => array('id' => 'sort-table'), '#attributes' => array('id' => 'sort-table'),
'#prefix' => '<div id="manual-email-attendees-items">', '#prefix' => '<div id="manual-email-attendees-items">',
@@ -234,6 +234,8 @@ function _booking_manual_email_selecttype_dropdown_callback($form, &$form_state)
$select_type = $form_state['values']['select-type']; $select_type = $form_state['values']['select-type'];
$new_default_values = array(); $new_default_values = array();
$options = _booking_manual_email_generate_options();
// generate new default values // generate new default values
// @todo use a function for this // @todo use a function for this
if ($select_type == "Unpaid") { if ($select_type == "Unpaid") {
@@ -244,7 +246,7 @@ function _booking_manual_email_selecttype_dropdown_callback($form, &$form_state)
// update cached options for tableselect // update cached options for tableselect
$cached_form = form_get_cache($form['#build_id'], $form_state); $cached_form = form_get_cache($form['#build_id'], $form_state);
$cached_form['table']['#options'] = _booking_manual_email_generate_options(); $cached_form['table']['#options'] = $options;
form_set_cache($form['#build_id'], $cached_form, $form_state); form_set_cache($form['#build_id'], $cached_form, $form_state);
// remove radios from tableselect // remove radios from tableselect