Code Duplication    Length = 12-12 lines in 2 locations

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

@@ 730-741 (lines=12) @@
727
                            }
728
729
                            // Delete groups.
730
                            if (!empty($groupsToDelete)) {
731
                                foreach ($groupsToDelete as $group) {
732
                                    api_item_property_delete(
733
                                        $this->course,
734
                                        TOOL_CALENDAR_EVENT,
735
                                        $id,
736
                                        0,
737
                                        $group,
738
                                        $this->sessionId
739
                                    );
740
                                }
741
                            }
742
743
                            // Add users.
744
                            if (!empty($usersToAdd)) {
@@ 762-773 (lines=12) @@
759
                            }
760
761
                            // Delete users.
762
                            if (!empty($usersToDelete)) {
763
                                foreach ($usersToDelete as $userId) {
764
                                    api_item_property_delete(
765
                                        $this->course,
766
                                        TOOL_CALENDAR_EVENT,
767
                                        $id,
768
                                        $userId,
769
                                        $groupId,
770
                                        $this->sessionId
771
                                    );
772
                                }
773
                            }
774
                        }
775
                    }
776