Use automatic processing for human friendly values

This commit is contained in:
Nathan Gray 2011-04-04 19:07:06 +00:00
parent 630720a662
commit fa8bf4218e

View File

@ -133,14 +133,17 @@ class resources_import_csv implements importexport_iface_import_plugin {
// Failures
$this->errors = array();
$types = importexport_export_csv::$types;
$types['select-bool'] = array('bookable');
while ( $record = $import_csv->get_record() ) {
$success = false;
// don't import empty records
if( count( array_unique( $record ) ) < 2 ) continue;
// Automatically handle text categories without explicit translation
$record['cat_id'] = importexport_helper_functions::cat_name2id($record['cat_id']);
// Automatically handle human friendly values
importexport_import_csv::convert($record, $types, 'resources', $lookups);
if ( $_definition->plugin_options['conditions'] ) {
foreach ( $_definition->plugin_options['conditions'] as $condition ) {