Fix typo breaking some merge combinations, make sure to always merge to end date

This commit is contained in:
Nathan Gray 2015-12-04 20:58:37 +00:00
parent ebb669dccf
commit 7d20c6074d
2 changed files with 6 additions and 4 deletions

View File

@ -138,7 +138,7 @@ class calendar_merge extends bo_merge
}
}
// Handle merging a range of events into a document with pagerepeat instead of range
else if ((strpos($content, '$$pagerepeat') !== false || strpos($content, '{{pagerepeat') !== false) && is_array($ids) && $ids[0] && !$id[0]['id'])
else if ((strpos($content, '$$pagerepeat') !== false || strpos($content, '{{pagerepeat') !== false) && is_array($ids) && $ids[0] && !$ids[0]['id'])
{
// Passed a range, needs to be expanded
$events = $this->bo->search($this->query + $ids[0] + array(
@ -152,7 +152,7 @@ class calendar_merge extends bo_merge
$ids[] = $event;
}
}
return parent::merge_string($content, $ids, $err, $mimetype,$fix);
}

View File

@ -623,9 +623,10 @@ class calendar_ui
if($content['last'])
{
$this->last = new egw_time($content['last']);
$this->last->setTime(23, 59, 59);
$this->last = $this->last->format('ts');
}
$this->last->setTime(23, 59, 59);
$this->last = $this->last->format('ts');
$_GET['merge'] = $content['merge'];
$this->merge();
return;
@ -841,6 +842,7 @@ class calendar_ui
));
}
$merge = new calendar_merge();
//error_log('Timespan: ' . egw_time::to($timespan[0]['start']) . ' - ' . egw_time::to($timespan[0]['end']));
$error = $merge->download($_GET['merge'], $timespan, '', $GLOBALS['egw_info']['user']['preferences']['calendar']['document_dir']);
// Here? Doesn't actually give the message
egw_framework::refresh_opener($error, 'calendar');