diff --git a/booking.admin.inc b/booking.admin.inc
index 7bd1204..9c4e9b0 100644
--- a/booking.admin.inc
+++ b/booking.admin.inc
@@ -112,6 +112,13 @@ function booking_admin() {
'#type' => 'fieldset',
'#title' => 'Miscellaneous Settings',
);
+ $form['misc']['booking_default_gender'] = array (
+ '#type' => 'select',
+ '#title' => t('Select Default Gender'),
+ '#description' => t('Select default gender for booking form.'),
+ '#options' => _booking_gender_options(),
+ '#default_value' => variable_get('booking_default_gender', 'M'),
+ );
$form['misc']['booking_default_country'] = array (
'#type' => 'select',
'#title' => t('Select Default Country'),
diff --git a/booking.constants.inc b/booking.constants.inc
index 1a4ae98..304a2e4 100644
--- a/booking.constants.inc
+++ b/booking.constants.inc
@@ -169,6 +169,16 @@ function _booking_readinggroup_colour_lookup($input = NULL)
return $group;
}
+/**
+ * Helper function to provide an array of genders
+ */
+function _booking_gender_options() {
+ $options_array = array();
+ $options_array['M'] = 'Male';
+ $options_array['F'] = 'Female';
+ return $options_array;
+}
+
/**
* Helper function to reliably (without using any external APIs) provide a list of options for the country field used in the registration form
*/
diff --git a/booking.import_data.inc b/booking.import_data.inc
index b992ddc..a4dd385 100644
--- a/booking.import_data.inc
+++ b/booking.import_data.inc
@@ -66,6 +66,7 @@ function booking_import_data_admin_submit($form, &$form_state)
$update_counter = 0;
$delimiter = ",";
$result_array = array();
+ $update_messages = array();
$datetime_fields = array('booking_outflight_origin_ts', 'booking_outflight_destination_ts', 'booking_rtrnflight_origin_ts',
'booking_rtrnflight_destination_ts');
@@ -166,9 +167,12 @@ function booking_import_data_admin_submit($form, &$form_state)
$rows = $query->execute();
//$args = $query->getArguments();
-
+ /*
watchdog('booking', "Update Query:
@info
Condition: @nid
Rows affected: @rows
Values:
@values", array('@info' => (string) $query, '@nid' => $record['nid'], '@rows' => $rows, '@values' => print_r( $update_array, true) )); + */ + + $update_messages[] = t("Update Query:
@values", array('@info' => (string) $query, '@nid' => $record['nid'], '@rows' => $rows, '@values' => print_r( $update_array, true) )); /* $result_array[] = t('Setting payment for id !nid to $!price of total required $!total and status to !status', @@ -214,6 +218,8 @@ function booking_import_data_admin_submit($form, &$form_state) //let the user know we finished drupal_set_message(t("Finished processing @count records from input file \"@filename\"", array('@count' => $update_counter, '@filename' => $file->filename))); + + watchdog('booking', "
Data Import concluded:\n" . implode("\n", $update_messages) . ""); /* // Make the storage of the file permanent diff --git a/booking.install b/booking.install index 84eb84b..4f37f01 100644 --- a/booking.install +++ b/booking.install @@ -605,7 +605,7 @@ function booking_schema() { 'pid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'), 'booking_eventid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE, 'disp-width' => '10'), 'booking_price' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '7', 'scale' => '2'), - 'booking_late_price' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '5', 'scale' => '2'), + 'booking_late_price' => array('type' => 'numeric', 'not null' => FALSE, 'default' => 0, 'precision' => '7', 'scale' => '2'), 'booking_price_descrip' => array('type' => 'varchar', 'length' => '100', 'not null' => TRUE), 'booking_buttonid' => array('type' => 'varchar', 'length' => '50', 'not null' => FALSE), 'booking_late_buttonid' => array('type' => 'varchar', 'length' => '50', 'not null' => FALSE), diff --git a/booking.module b/booking.module index 745d206..ecf8ec3 100644 --- a/booking.module +++ b/booking.module @@ -336,6 +336,18 @@ function booking_menu() { 'type' => MENU_NORMAL_ITEM, ); + //show flight info report only if we have passport info enabled + if (variable_get('booking_enable_passport', 0) == 1) + { + $items['admin/booking/flights'] = array( + 'title' => 'Booking View Flights', + 'description' => 'View Internal Flight Bookings', + 'page callback' => 'booking_report_flight_details', + 'access arguments' => array("acess reports"), + 'type' => MENU_NORMAL_ITEM, + ); + } + //configure study groups if (variable_get('booking_enable_studygroups', 0) == 1) { @@ -786,3 +798,14 @@ function booking_generate_luckynumbers() { return t("
View flight information for all attendees with status currently set to booked in.
"); + + $header = array( + 'booking_name' => array('data' => t('Name'), 'field' => 'booking_lastname'), + 'booking_destination_country' => array('data' => t('Country'), 'field' => 'booking_destination_country'), + 'booking_outflight_bookingnum' => array('data' => t('Reference'), 'field' => 'booking_outflight_bookingnum'), + 'booking_outflight_flightnum' => array('data' => t('Flight #'), 'field' => 'booking_outflight_flightnum'), + 'booking_outflight_origin' => array('data' => t('Description'), 'field' => 'booking_outflight_origin'), + 'booking_outflight_origin_ts' => array('data' => t('Departure Time'), 'field' => 'booking_outflight_origin_ts'), + 'booking_outflight_connecting_flightnum' => array('data' => t('Connecting Flight'), 'field' => 'booking_outflight_connecting_flightnum'), + 'booking_outflight_destination' => array('data' => t('Description'), 'field' => 'booking_outflight_destination'), + 'booking_outflight_destination_ts' => array('data' => t('Time'), 'field' => 'booking_outflight_destination_ts'), + 'booking_rtrnflight_bookingnum' => array('data' => t('Return Reference'), 'field' => 'booking_rtrnflight_bookingnum'), + 'booking_rtrnflight_flightnum' => array('data' => t('Flight #'), 'field' => 'booking_rtrnflight_flightnum'), + 'booking_rtrnflight_origin' => array('data' => t('Description'), 'field' => 'booking_rtrnflight_origin'), + 'booking_rtrnflight_origin_ts' => array('data' => t('Time'), 'field' => 'booking_rtrnflight_origin_ts'), + ); + + $query = db_select('booking_person', 'p'); + $query->fields('p'); + + $db_and = db_and(); + $db_and->condition('p.booking_event_id', $event->eid, '='); + $db_and->condition('p.booking_status', 1, '='); + $query->condition($db_and); + + $table_sort = $query->extend('TableSort')->orderbyHeader($header); + $result = $table_sort->execute(); + + foreach($result as $data) + { + $name_link = l(t('!first !last', array('!first' => ucwords($data->booking_firstname), '!last' => ucwords($data->booking_lastname))), + t('node/!id', array('!id' => $data->nid)) + ); + + $rows[] = array ( + 'data' => array( + $name_link, + $data->booking_destination_country, + $data->booking_outflight_bookingnum, + $data->booking_outflight_flightnum, + $data->booking_outflight_origin, + $data->booking_outflight_origin_ts == 0 ? '' : format_date($data->booking_outflight_origin_ts, 'custom', 'd/m/Y H:i'), + $data->booking_outflight_connecting_flightnum, + $data->booking_outflight_destination, + $data->booking_outflight_destination_ts == 0 ? '' : format_date($data->booking_outflight_destination_ts, 'custom', 'd/m/Y H:i'), + $data->booking_rtrnflight_bookingnum, + $data->booking_rtrnflight_flightnum, + $data->booking_rtrnflight_origin, + $data->booking_rtrnflight_origin_ts == 0 ? '' : format_date($data->booking_rtrnflight_origin_ts, 'custom', 'd/m/Y H:i'), + ), + ); + } + + $result = array ( + 'first_para' => array ( + '#type' => 'markup', + '#markup' => $prefix, + ), + 'table' => array ( + '#theme' => 'table', + '#header' => $header, + '#rows' => $rows, + '#attributes' => array('id' => 'sort-table'), + //'#sticky' => FALSE, + ) + ); + + return $result; +} + function booking_coming_page() { global $event;