From 8e1260d5c957964939a33b3e5e42ec4bb94392b4 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 23 Oct 2012 18:35:48 +0000 Subject: [PATCH] Copy alarms when copying an event --- calendar/inc/class.calendar_uiforms.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 61a03e69ff..83cfadd5ea 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -478,7 +478,6 @@ class calendar_uiforms extends calendar_ui case 'copy': // create new event with copied content, some content need to be unset to make a "new" event unset($event['id']); unset($event['uid']); - unset($event['alarm']); unset($event['reference']); unset($event['recurrence']); unset($event['recur_exception']); @@ -500,6 +499,14 @@ class calendar_uiforms extends calendar_ui $response = calendar_so::combine_status($status,$quantity,$role); } } + + // Copy alarms + foreach($event['alarm'] as $n => &$alarm) + { + unset($alarm['id']); + unset($alarm['cal_id']); + } + // Get links to be copied // With no ID, $content['link_to']['to_id'] is used $content['link_to']['to_id'] = array('to_app' => 'calendar', 'to_id' => 0);