forked from extern/egroupware
Add an option for charset to use the current user's preferred charset
This commit is contained in:
parent
cae8752274
commit
8af97a3c10
@ -95,6 +95,7 @@ class importexport_export_csv implements importexport_iface_export_record
|
|||||||
}
|
}
|
||||||
$this->translation = &$GLOBALS['egw']->translation;
|
$this->translation = &$GLOBALS['egw']->translation;
|
||||||
$this->handle = $_stream;
|
$this->handle = $_stream;
|
||||||
|
if($_options['charset'] == 'user') $_options['charset'] = $GLOBALS['egw_info']['user']['preferences']['common']['csv_charset'];
|
||||||
$this->csv_charset = $_options['charset'] ? $_options['charset'] : 'utf-8';
|
$this->csv_charset = $_options['charset'] ? $_options['charset'] : 'utf-8';
|
||||||
if ( !empty( $_options ) ) {
|
if ( !empty( $_options ) ) {
|
||||||
$this->csv_options = array_merge( $this->csv_options, $_options );
|
$this->csv_options = array_merge( $this->csv_options, $_options );
|
||||||
|
@ -83,6 +83,7 @@ class importexport_import_csv implements importexport_iface_import_record { //,
|
|||||||
public function __construct( $_resource, array $_options ) {
|
public function __construct( $_resource, array $_options ) {
|
||||||
$this->resource = $_resource;
|
$this->resource = $_resource;
|
||||||
$this->csv_fieldsep = $_options['fieldsep'];
|
$this->csv_fieldsep = $_options['fieldsep'];
|
||||||
|
if($_options['charset'] == 'user') $_options['charset'] = $GLOBALS['egw_info']['user']['preferences']['common']['csv_charset'];
|
||||||
$this->csv_charset = $_options['charset'];
|
$this->csv_charset = $_options['charset'];
|
||||||
return;
|
return;
|
||||||
} // end of member function __construct
|
} // end of member function __construct
|
||||||
|
@ -173,7 +173,7 @@ class importexport_wizard_basic_export_csv
|
|||||||
$content['delimiter'] = ';';
|
$content['delimiter'] = ';';
|
||||||
}
|
}
|
||||||
if(!$content['charset'] && $content['plugin_options']['charset']) {
|
if(!$content['charset'] && $content['plugin_options']['charset']) {
|
||||||
$content['charset'] = $content['plugin_options']['charset'];
|
$content['charset'] = $content['plugin_options']['charset'] ? $content['plugin_options']['charset'] : 'user';
|
||||||
}
|
}
|
||||||
if(!array_key_exists('begin_with_fieldnames', $content) && array_key_exists('begin_with_fieldnames', $content['plugin_options'])) {
|
if(!array_key_exists('begin_with_fieldnames', $content) && array_key_exists('begin_with_fieldnames', $content['plugin_options'])) {
|
||||||
$content['begin_with_fieldnames'] = $content['plugin_options']['begin_with_fieldnames'];
|
$content['begin_with_fieldnames'] = $content['plugin_options']['begin_with_fieldnames'];
|
||||||
@ -189,7 +189,7 @@ class importexport_wizard_basic_export_csv
|
|||||||
'label' => lang('Field labels')
|
'label' => lang('Field labels')
|
||||||
);
|
);
|
||||||
$sel_options['charset'] = $GLOBALS['egw']->translation->get_installed_charsets()+
|
$sel_options['charset'] = $GLOBALS['egw']->translation->get_installed_charsets()+
|
||||||
array('utf-8' => 'utf-8 (Unicode)');
|
array('utf-8' => 'utf-8 (Unicode)', 'user' => lang('User preference'));
|
||||||
$sel_options['convert'] = array(
|
$sel_options['convert'] = array(
|
||||||
0 => lang('Database values'),
|
0 => lang('Database values'),
|
||||||
1 => lang('Human friendly values')
|
1 => lang('Human friendly values')
|
||||||
|
@ -197,7 +197,10 @@ class importexport_wizard_basic_import_csv
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sel_options['charset'] = $GLOBALS['egw']->translation->get_installed_charsets()+
|
$sel_options['charset'] = $GLOBALS['egw']->translation->get_installed_charsets()+
|
||||||
array('utf-8' => 'utf-8 (Unicode)');
|
array(
|
||||||
|
'utf-8' => 'utf-8 (Unicode)',
|
||||||
|
'user' => lang('User preference')
|
||||||
|
);
|
||||||
$preserv = $content;
|
$preserv = $content;
|
||||||
if($this->mapping_fields['cat_id']) {
|
if($this->mapping_fields['cat_id']) {
|
||||||
$sel_options['update_cats'] = array(
|
$sel_options['update_cats'] = array(
|
||||||
|
Loading…
Reference in New Issue
Block a user