Code Duplication    Length = 14-14 lines in 2 locations

main/inc/lib/agenda.lib.php 2 locations

@@ 656-669 (lines=14) @@
653
654
                        if ($sendTo['everyone']) {
655
                            // Delete all from group
656
                            if (isset($eventInfo['send_to']['groups']) &&
657
                                !empty($eventInfo['send_to']['groups'])
658
                            ) {
659
                                foreach ($eventInfo['send_to']['groups'] as $group) {
660
                                    api_item_property_delete(
661
                                        $this->course,
662
                                        TOOL_CALENDAR_EVENT,
663
                                        $id,
664
                                        0,
665
                                        $group,
666
                                        $this->sessionId
667
                                    );
668
                                }
669
                            }
670
671
                            // Storing the selected users.
672
                            if (isset($eventInfo['send_to']['users']) &&
@@ 672-685 (lines=14) @@
669
                            }
670
671
                            // Storing the selected users.
672
                            if (isset($eventInfo['send_to']['users']) &&
673
                                !empty($eventInfo['send_to']['users'])
674
                            ) {
675
                                foreach ($eventInfo['send_to']['users'] as $userId) {
676
                                    api_item_property_delete(
677
                                        $this->course,
678
                                        TOOL_CALENDAR_EVENT,
679
                                        $id,
680
                                        $userId,
681
                                        $groupId,
682
                                        $this->sessionId
683
                                    );
684
                                }
685
                            }
686
687
                            // Add to everyone only.
688
                            api_item_property_update(