From 262340d866e306c266631021626ae9d8cc040779 Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Fri, 3 Jun 2016 12:57:12 +1000 Subject: [PATCH] minor tweaks --- booking.emails_admin.inc | 25 +++++++++++++------------ booking.module | 13 +------------ 2 files changed, 14 insertions(+), 24 deletions(-) diff --git a/booking.emails_admin.inc b/booking.emails_admin.inc index 0de4be6..6c49b46 100644 --- a/booking.emails_admin.inc +++ b/booking.emails_admin.inc @@ -260,10 +260,10 @@ function booking_emails_admin() { /** * Function to allow admin user to manually generate and send a workflow or custom email * - * @param $input_option - A pre-defined string that selects the checkboxes for a corresponding class of people + * @param * @return form render array */ -function booking_manual_email_form($form, &$form_state, $input_option = "") +function booking_manual_email_form($form, &$form_state) { global $event; //see http://www.jaypan.com/blog/themeing-drupal-7-forms-tables-checkboxes-or-radios @@ -284,7 +284,8 @@ function booking_manual_email_form($form, &$form_state, $input_option = "") $email_options_array['remindertravelrequired'] = 'Reminder Travel Form Required Email'; $email_options_array['travelcomplete'] = 'Travel Form Complete Email'; $preselection_options['---'] = "---"; - $preselection_options['bookedin'] = 'Status of Booked In'; + $preselection_options['bookedin'] = 'Status of Booked-in'; + $preselection_options['unpaid'] = 'Booked-in people with outstanding balance'; $preselection_options['test'] = 'Testing'; $header = array( @@ -327,6 +328,11 @@ function booking_manual_email_form($form, &$form_state, $input_option = "") //attach js for dynamically setting checkboxes $form['#attached']['js'][] = drupal_get_path("module", "booking")."/booking.js"; + $form['pretext'] = array( + '#type' => 'container', + '#children' => $prefix, + ); + //@todo add booking prefix $form['email-type'] = array( '#type' => 'select', @@ -436,15 +442,6 @@ function booking_manual_email_form($form, &$form_state, $input_option = "") } $options[$data->nid]['group_roles'] = $group_text; } - /* - //handle any checkbox pre-selection for this attendee - if ($input_option == 'unpaid') { - $values[$data->nid] = ($data->booking_payment_complete == 'Y' || $data->booking_status != 1) ? FALSE : TRUE; - } - elseif ($input_option == 'bookedin') { - $values[$data->nid] = $data->booking_status == 1 ? TRUE : FALSE; - } - */ } $form['table'] = array ( @@ -465,10 +462,12 @@ function booking_manual_email_form($form, &$form_state, $input_option = "") ); return array ( + /* 'first_para' => array ( '#type' => 'markup', '#markup' => $prefix, ), + */ 'form' => $form, ); } @@ -484,6 +483,7 @@ function booking_manual_email_form($form, &$form_state, $input_option = "") function _booking_email_get_default_selection_callback($form, $form_state) { global $event; $defaults = array(); + $prefix_text = $form_state['values']['pretext']; // $replacementform_data = array(); //get type of selection from $form_state['values']['booking-email-preselection'] @@ -520,6 +520,7 @@ function _booking_email_get_default_selection_callback($form, $form_state) { '#suffix' => '', '#attributes' => array('id' => 'booking_email_default_ids'), ); + $output_html = render($replacementform_data['booking-email-default-ids']); //watchdog('booking_debug', "
Manual Email ajax html\n@info
", array('@info' => print_r( $output_html, true))); diff --git a/booking.module b/booking.module index 0a97bec..20a5cf2 100644 --- a/booking.module +++ b/booking.module @@ -321,18 +321,7 @@ function booking_menu() { 'access arguments' => array('access administration pages'), 'type' => MENU_NORMAL_ITEM, ); - - $items['admin/booking/manual-email/%'] = array( - 'title' => 'Manually Email People Test', - 'description' => 'Send manual email to registered people with preselected values', - 'page callback' => 'drupal_get_form', - 'page arguments' => array('booking_manual_email_form', 3), - //'page callback' => 'booking_manual_email', - //'page arguments' => array(3), - 'access arguments' => array('access administration pages'), - //'type' => MENU_NORMAL_ITEM, - ); - + $items['admin/booking/manual-payments'] = array( 'title' => 'Manual Payment Processing', 'description' => 'Manually process peoples payments',