mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
- Don't try a CSV preview on non-csv files
- Skip plugin definition wizards
This commit is contained in:
parent
c8eb6c5e24
commit
86f334bbf0
@ -394,7 +394,7 @@ class importexport_helper_functions {
|
||||
$file = $appdir. '/'. $entry;
|
||||
|
||||
foreach ($types as $type) {
|
||||
if( !is_file($file) || strpos($entry, $type) === false) continue;
|
||||
if( !is_file($file) || strpos($entry, $type) === false || strpos($entry,'wizard') !== false) continue;
|
||||
require_once($file);
|
||||
$reflectionClass = new ReflectionClass($classname);
|
||||
if($reflectionClass->IsInstantiable() &&
|
||||
|
@ -249,9 +249,13 @@
|
||||
|
||||
/**
|
||||
* Display the contents of the file for dry runs
|
||||
*
|
||||
* CSV files only
|
||||
*/
|
||||
protected function preview(&$_stream, &$definition_obj)
|
||||
{
|
||||
if(!$definition_obj->plugin_options['csv_fields']) return;
|
||||
|
||||
$import_csv = new importexport_import_csv( $_stream, array(
|
||||
'fieldsep' => $definition_obj->plugin_options['fieldsep'],
|
||||
'charset' => $definition_obj->plugin_options['charset'],
|
||||
@ -281,6 +285,10 @@
|
||||
public static function check_file(&$file, &$definition, &$message = array(), $dst_file = false)
|
||||
{
|
||||
$options =& $definition->plugin_options;
|
||||
|
||||
// Only CSV files
|
||||
if(!$options['csv_fields']) return true;
|
||||
|
||||
$data = fgetcsv($file, 8000, $options['fieldsep']);
|
||||
rewind($file);
|
||||
$data = translation::convert($data,$options['charset']);
|
||||
|
Loading…
Reference in New Issue
Block a user