Added destination country and updated import data functions

This commit is contained in:
2014-06-25 11:33:52 +10:00
parent e64749704e
commit d7b12517b5
6 changed files with 90 additions and 7 deletions

View File

@@ -11,7 +11,7 @@ function booking_import_data_admin()
{
global $event;
$prefix = t("<p>Upload csv file containing data to import. Minimum fields present should be <strong>nid</strong>, " .
$prefix = t("<p>Upload csv file containing data to import. Minimum fields present should be <strong>nid and booking_status</strong>, " .
" along with user-specified fields of <strong>!config</strong>. CSV Column names should match exactly (case sensitive).</p>",
array('!config' => variable_get('booking_import_include_fields', '')));
@@ -129,6 +129,7 @@ function booking_import_data_admin_submit($form, &$form_state)
//convert the booking status to the number used internally
elseif ($field == 'booking_status')
{
$update_text .= " set booking status to '" . $record[$field] . "'; ";
$update_array[$field] = _booking_status_lookup($record[$field]);
}
elseif ( (! isset($record[$field])) || $record[$field] == '' )
@@ -155,7 +156,8 @@ function booking_import_data_admin_submit($form, &$form_state)
//$args = $query->getArguments();
watchdog('booking', "Update Query:<br />@info<br />Rows affected<br />@rows", array('@info' => (string) $query, '@rows' => $rows));
watchdog('booking', "Update Query:<br />@info<br />Condition: @nid<br />Rows affected: @rows<br />Values: <br /><pre>@values</pre>",
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',