Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 717-732 (lines=16) @@
714
                            );
715
716
                            // Add groups
717
                            if (!empty($groupToAdd)) {
718
                                foreach ($groupToAdd as $group) {
719
                                    api_item_property_update(
720
                                        $this->course,
721
                                        TOOL_CALENDAR_EVENT,
722
                                        $id,
723
                                        "visible",
724
                                        api_get_user_id(),
725
                                        $group,
726
                                        0,
727
                                        $start,
728
                                        $end,
729
                                        $this->sessionId
730
                                    );
731
                                }
732
                            }
733
734
                            // Delete groups.
735
                            if (!empty($groupsToDelete)) {
@@ 749-764 (lines=16) @@
746
                            }
747
748
                            // Add users.
749
                            if (!empty($usersToAdd)) {
750
                                foreach ($usersToAdd as $userId) {
751
                                    api_item_property_update(
752
                                        $this->course,
753
                                        TOOL_CALENDAR_EVENT,
754
                                        $id,
755
                                        "visible",
756
                                        api_get_user_id(),
757
                                        $groupId,
758
                                        $userId,
759
                                        $start,
760
                                        $end,
761
                                        $this->sessionId
762
                                    );
763
                                }
764
                            }
765
766
                            // Delete users.
767
                            if (!empty($usersToDelete)) {