mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-06-25 04:11:49 +02:00
Keep previous CSV-only preview around too
This commit is contained in:
parent
2b96aff758
commit
f34afea1c7
@ -253,25 +253,30 @@
|
|||||||
*/
|
*/
|
||||||
protected function preview(importexport_iface_import_plugin &$plugin, &$stream, importexport_definition &$definition_obj)
|
protected function preview(importexport_iface_import_plugin &$plugin, &$stream, importexport_definition &$definition_obj)
|
||||||
{
|
{
|
||||||
$preview = $plugin->preview($stream, $definition_obj);
|
if(method_exists($plugin, 'preview'))
|
||||||
/*
|
|
||||||
$import_csv = new importexport_import_csv( $stream, array(
|
|
||||||
'fieldsep' => $definition_obj->plugin_options['fieldsep'],
|
|
||||||
'charset' => $definition_obj->plugin_options['charset'],
|
|
||||||
));
|
|
||||||
// set FieldMapping.
|
|
||||||
$import_csv->mapping = $definition_obj->plugin_options['field_mapping'];
|
|
||||||
|
|
||||||
$rows = array('h1'=>array(),'f1'=>array(),'.h1'=>'class=th');
|
|
||||||
for($row = 0; $row < $GLOBALS['egw_info']['user']['preferences']['common']['maxmatchs']; $row++)
|
|
||||||
{
|
{
|
||||||
$row_data = $import_csv->get_record();
|
$preview = $plugin->preview($stream, $definition_obj);
|
||||||
if($row_data === false) break;
|
}
|
||||||
$rows[$import_csv->get_current_position() <= $definition_obj->plugin_options['num_header_lines'] ? 'h1' : $row] = $row_data;
|
elseif($definition_obj->plugin_options['csv_fields'])
|
||||||
if($import_csv->get_current_position() <= $definition_obj->plugin_options['num_header_lines']) $row--;
|
{
|
||||||
|
$import_csv = new importexport_import_csv( $stream, array(
|
||||||
|
'fieldsep' => $definition_obj->plugin_options['fieldsep'],
|
||||||
|
'charset' => $definition_obj->plugin_options['charset'],
|
||||||
|
));
|
||||||
|
// set FieldMapping.
|
||||||
|
$import_csv->mapping = $definition_obj->plugin_options['field_mapping'];
|
||||||
|
|
||||||
|
$rows = array('h1'=>array(),'f1'=>array(),'.h1'=>'class=th');
|
||||||
|
for($row = 0; $row < $GLOBALS['egw_info']['user']['preferences']['common']['maxmatchs']; $row++)
|
||||||
|
{
|
||||||
|
$row_data = $import_csv->get_record();
|
||||||
|
if($row_data === false) break;
|
||||||
|
$rows[$import_csv->get_current_position() <= $definition_obj->plugin_options['num_header_lines'] ? 'h1' : $row] = $row_data;
|
||||||
|
if($import_csv->get_current_position() <= $definition_obj->plugin_options['num_header_lines']) $row--;
|
||||||
|
}
|
||||||
|
$preview = html::table($rows);
|
||||||
|
rewind($stream);
|
||||||
}
|
}
|
||||||
$preview = html::table($rows);
|
|
||||||
*/
|
|
||||||
return '<h2>' . lang('Preview') . ' - ' . $plugin->get_name() . '</h2>' . $preview;
|
return '<h2>' . lang('Preview') . ' - ' . $plugin->get_name() . '</h2>' . $preview;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user