mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 01:13:25 +01:00
Enable importing to categories with comma in their name
This commit is contained in:
parent
70e5dbf50f
commit
dbfc994542
@ -484,12 +484,21 @@ class importexport_import_csv implements importexport_iface_import_record { //,
|
|||||||
if($appname) {
|
if($appname) {
|
||||||
$GLOBALS['egw_info']['flags']['currentapp'] = $appname;
|
$GLOBALS['egw_info']['flags']['currentapp'] = $appname;
|
||||||
}
|
}
|
||||||
|
$categories = new categories('',$appname);
|
||||||
foreach((array)$fields['select-cat'] as $name) {
|
foreach((array)$fields['select-cat'] as $name) {
|
||||||
if($record[$name]) {
|
if($record[$name]) {
|
||||||
// Only parse name if it needs it
|
// Only parse name if it needs it
|
||||||
if($format == 1)
|
if($format == 1)
|
||||||
{
|
{
|
||||||
$cat_id = importexport_helper_functions::cat_name2id($record[$name]);
|
$existing_cat = $categories->exists('all',$record[$name]);
|
||||||
|
if($existing_cat)
|
||||||
|
{
|
||||||
|
$cat_id = $existing_cat;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$cat_id = importexport_helper_functions::cat_name2id($record[$name]);
|
||||||
|
}
|
||||||
// Don't clear it if it wasn't found
|
// Don't clear it if it wasn't found
|
||||||
if($cat_id) $record[$name] = $cat_id;
|
if($cat_id) $record[$name] = $cat_id;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user