Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 735-746 (lines=12) @@
732
                            }
733
734
                            // Delete groups.
735
                            if (!empty($groupsToDelete)) {
736
                                foreach ($groupsToDelete as $group) {
737
                                    api_item_property_delete(
738
                                        $this->course,
739
                                        TOOL_CALENDAR_EVENT,
740
                                        $id,
741
                                        0,
742
                                        $group,
743
                                        $this->sessionId
744
                                    );
745
                                }
746
                            }
747
748
                            // Add users.
749
                            if (!empty($usersToAdd)) {
@@ 767-778 (lines=12) @@
764
                            }
765
766
                            // Delete users.
767
                            if (!empty($usersToDelete)) {
768
                                foreach ($usersToDelete as $userId) {
769
                                    api_item_property_delete(
770
                                        $this->course,
771
                                        TOOL_CALENDAR_EVENT,
772
                                        $id,
773
                                        $userId,
774
                                        $groupId,
775
                                        $this->sessionId
776
                                    );
777
                                }
778
                            }
779
                        }
780
                    }
781