diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php index 4c743c4a0d..f750212c20 100644 --- a/calendar/inc/class.calendar_uiforms.inc.php +++ b/calendar/inc/class.calendar_uiforms.inc.php @@ -1053,6 +1053,17 @@ class calendar_uiforms extends calendar_ui { $content['new_alarm']['date'] = $next_occurrence['start'] - $offset; } + // Avoid duplicates + foreach($content['alarm'] as $key => $alarm) + { + if($alarm['offset'] == $offset && ( + ($alarm['all'] && $content['new_alarm']['owner'] == 0) || + (!$alarm['all'] && $alarm['owner'] == $content['new_alarm']['owner']) + )) + { + break 2; + } + } if ($this->bo->check_perms(Acl::EDIT,!$content['new_alarm']['owner'] ? $event : 0,$content['new_alarm']['owner'])) { $alarm = array(