mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-27 00:09:13 +01:00
Addressbook: Fix creating CSV import definition field mapping step failed
Incorrect select options broke the "target field" column
This commit is contained in:
parent
4a1455d05e
commit
a1b6222c4b
@ -41,17 +41,21 @@ class addressbook_wizard_import_contacts_csv extends importexport_wizard_basic_i
|
||||
{
|
||||
$s .= ' ♦';
|
||||
}
|
||||
$cat_list['cat-'.$cat['id']] = empty($cat['description']) ? $s : array(
|
||||
$cat_list[] = array(
|
||||
'value' => 'cat-' . $cat['id'],
|
||||
'label' => $s,
|
||||
'title' => $cat['description'],
|
||||
'title' => $cat['description']
|
||||
);
|
||||
}
|
||||
if(count($cat_list) > 0) {
|
||||
$this->mapping_fields[lang('Categories')] = $cat_list;
|
||||
$this->mapping_fields[] = array(
|
||||
'label' => lang('Categories'),
|
||||
'children' => $cat_list
|
||||
);
|
||||
}
|
||||
|
||||
foreach($bocontacts->customfields as $name => $data) {
|
||||
$this->mapping_fields['#'.$name] = $data['label'];
|
||||
$this->mapping_fields[] = ['value' => '#' . $name, 'label' => $data['label']];
|
||||
}
|
||||
unset($this->mapping_fields['jpegphoto']); // can't cvs import that
|
||||
|
||||
|
@ -280,16 +280,17 @@ export const Et2WidgetWithSelectMixin = <T extends Constructor<LitElement>>(supe
|
||||
<span>Override _optionTemplate(). ${option.value} => ${option.label}</span>`;
|
||||
}
|
||||
|
||||
_groupTemplate(option) : TemplateResult
|
||||
_groupTemplate(option : SelectOption) : TemplateResult
|
||||
{
|
||||
if(!Array.isArray(option.value))
|
||||
if(!Array.isArray(option.value) && !Array.isArray(option.children) && !option.hasChildren)
|
||||
{
|
||||
return this._optionTemplate(option);
|
||||
}
|
||||
// option.value is deprecated, option.children is defined in SelectOption
|
||||
const options = Array.isArray(option.value) ? <SelectOption[]>option.value : <SelectOption[]>option.children;
|
||||
return html`
|
||||
|
||||
<small>${this.noLang ? option.label : this.egw().lang(option.label)}</small>
|
||||
${option.value.map(this._optionTemplate.bind(this))}
|
||||
${options.map(this._optionTemplate.bind(this))}
|
||||
<sl-divider></sl-divider>
|
||||
`;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user