Fix calendar did not work with merge changes

ff94af1f7d
This commit is contained in:
nathan
2024-05-21 11:40:14 -06:00
parent e596d60395
commit 700cb987ea
2 changed files with 63 additions and 60 deletions

View File

@@ -921,7 +921,7 @@ export abstract class EgwApp
let fileSelect = <Et2MergeDialog><unknown>loadWebComponent('et2-merge-dialog', { let fileSelect = <Et2MergeDialog><unknown>loadWebComponent('et2-merge-dialog', {
application: this.appname, application: this.appname,
path: dirs.pop() || "" path: dirs.pop() || ""
}, et2.widgetContainer); }, et2?.widgetContainer ?? null);
if(!et2) if(!et2)
{ {
document.body.append(fileSelect); document.body.append(fileSelect);

View File

@@ -153,13 +153,15 @@ class calendar_merge extends Api\Storage\Merge
$ids = json_decode($_REQUEST['id'], true); $ids = json_decode($_REQUEST['id'], true);
} }
foreach($_REQUEST['document'] as &$document)
{
// Try to make time span into appropriate ranges to match // Try to make time span into appropriate ranges to match
$template = $ids['view'] ?: ''; $template = $ids['view'] ?: '';
if(stripos($_REQUEST['document'], 'month') !== false || stripos($_REQUEST['document'], lang('month')) !== false) if(stripos($document, 'month') !== false || stripos($document, lang('month')) !== false)
{ {
$template = 'month'; $template = 'month';
} }
if(stripos($_REQUEST['document'], 'week') !== false || stripos($_REQUEST['document'], lang('week')) !== false) if(stripos($document, 'week') !== false || stripos($document, lang('week')) !== false)
{ {
$template = 'week'; $template = 'week';
} }
@@ -216,7 +218,8 @@ class calendar_merge extends Api\Storage\Merge
} }
// Add path into document // Add path into document
static::check_document($_REQUEST['document'], $GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir']); static::check_document($document, $GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir']);
}
return parent::merge_entries(array_key_exists('0', $ids) ? $ids : $timespan, $document_merge, $options, $return); return parent::merge_entries(array_key_exists('0', $ids) ? $ids : $timespan, $document_merge, $options, $return);
} }