From 26a43d620de1ec5769727d99cc2d88c9199283ce Mon Sep 17 00:00:00 2001 From: Nathan Coad Date: Fri, 22 Jun 2018 17:27:07 +1000 Subject: [PATCH] test default value --- booking.import_data.inc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/booking.import_data.inc b/booking.import_data.inc index 9349b10..14cac5e 100644 --- a/booking.import_data.inc +++ b/booking.import_data.inc @@ -5,17 +5,15 @@ */ -function booking_import_data_admin() +function booking_import_data_admin($form, &$form_state) { global $event; + $form = array(); $prefix = t("

Upload csv file containing data to import. Minimum fields present should be nid, " . - " along with user-specified fields of !config. CSV Column names should match exactly (case sensitive).

", - array('!config' => variable_get('booking_import_include_fields', ''))); + " along with fields specified below. CSV Column names should match exactly (case sensitive).

"); $prefix .= "

Note that only registration specific data like phone numbers, barcodes, etc can be updated, as well as study group membership and roles. Other data like room allocations cannot be uploaded at this time.

"; - $form = array(); - $form['file'] = array( '#type' => 'file', '#title' => t('CSV data'), @@ -30,13 +28,14 @@ function booking_import_data_admin() '#type' => 'select', '#multiple' => TRUE, '#title' => t('Select database fields for this import'), - '#description' => t('Select database fields to import from an uploaded CSV file. Ensure you hold down control/command when selecting multiple options.'), + '#description' => t('Select database fields to import from an uploaded CSV file. Ensure you hold down control/command when selecting multiple options. ' . + 'Fields are sorted alphabetically.'), '#options' => $booking_view_fields, '#size' => 10, + '#default_value' => isset($form_state['input']['booking_import_data_fields']) ? $form_state['input']['booking_import_data_fields'] : array('nid'), //'#default_value' => variable_get('booking_import_include_fields_dynamic', ''), ); - $form['submit'] = array ( '#type' => 'submit', '#value' => t('Submit'),