Calendar: Include current user as explicit select option for import target

This commit is contained in:
nathan 2023-02-06 16:38:33 -07:00
parent 95a4b319bb
commit eb416c3d91
2 changed files with 19 additions and 5 deletions

View File

@ -472,9 +472,17 @@ class calendar_import_csv extends importexport_basic_import_csv {
$owner = array_pop($owner);
}
$options = array(
'name' => 'calendar.import_csv',
'content' => array(
'owner' => $owner ? $owner : null
'name' => 'calendar.import_csv',
'content' => array(
'owner' => $owner ? [$owner] : null
),
'sel_options' => array(
'cal_owner' => [
[
'value' => $GLOBALS['egw_info']['user']['account_id'],
'label' => calendar_owner_etemplate_widget::get_owner_label($GLOBALS['egw_info']['user']['account_id'])
]
]
)
);
return $options;

View File

@ -303,10 +303,16 @@ class calendar_import_ical implements importexport_iface_import_plugin {
'content' => array(
'file_type' => 'ical',
'charset' => $GLOBALS['egw_info']['user']['preferences']['common']['csv_charset'],
'cal_owner' => $definition->plugin_options['cal_owner'] ?: $GLOBALS['egw_info']['user']['account_id']
'cal_owner' => [$definition->plugin_options['cal_owner'] ?: $GLOBALS['egw_info']['user']['account_id']]
),
'sel_options' => array(
'charset' => Api\Translation::get_installed_charsets()
'charset' => Api\Translation::get_installed_charsets(),
'cal_owner' => [
[
'value' => $GLOBALS['egw_info']['user']['account_id'],
'label' => calendar_owner_etemplate_widget::get_owner_label($GLOBALS['egw_info']['user']['account_id'])
]
]
),
'preserv' => array()
);