Code Duplication    Length = 14-14 lines in 2 locations

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

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