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

@ -474,7 +474,15 @@ class calendar_import_csv extends importexport_basic_import_csv {
$options = array( $options = array(
'name' => 'calendar.import_csv', 'name' => 'calendar.import_csv',
'content' => array( 'content' => array(
'owner' => $owner ? $owner : null '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; return $options;

View File

@ -303,10 +303,16 @@ class calendar_import_ical implements importexport_iface_import_plugin {
'content' => array( 'content' => array(
'file_type' => 'ical', 'file_type' => 'ical',
'charset' => $GLOBALS['egw_info']['user']['preferences']['common']['csv_charset'], '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( '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() 'preserv' => array()
); );