26 if (!Loader::includeModule(self::$moduleId))
31 $linksInfo = $this->getDuplicatedLinkInfo();
33 if ($linksInfo->SelectedRowsCount())
35 while ($linkInfo = $linksInfo->Fetch())
37 $duplicatedLinkId = (int)$linkInfo[
'FIRST_LINK_ID'];
38 $originalLinkId = (int)$linkInfo[
'LAST_LINK_ID'];
40 $events = $this->getEventList([$duplicatedLinkId, $originalLinkId]);
41 $duplicatedEvent = $events[$duplicatedLinkId];
42 $originalEvent = $events[$originalLinkId];
44 if (!$duplicatedEvent)
46 $this->deleteDuplicatedLink($duplicatedLinkId);
50 $this->deleteDuplicatedLink($originalLinkId);
52 if (!$duplicatedEvent || !$originalEvent)
57 if ($duplicatedEvent[
'DELETED'] ===
'Y')
59 $this->deleteDuplicatedLink($duplicatedLinkId);
63 $this->markEventAsDeleted((
int)$duplicatedEvent[
'ID']);
64 $this->deleteDuplicatedLink($duplicatedLinkId);
66 if ($originalEvent[
'DELETED'] ===
'Y')
68 $this->restoreEvent((
int)$originalEvent[
'PARENT_ID']);
75 \CCalendar::ClearCache();