Code Duplication    Length = 16-16 lines in 2 locations

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

@@ 712-727 (lines=16) @@
709
                            );
710
711
                            // Add groups
712
                            if (!empty($groupToAdd)) {
713
                                foreach ($groupToAdd as $group) {
714
                                    api_item_property_update(
715
                                        $this->course,
716
                                        TOOL_CALENDAR_EVENT,
717
                                        $id,
718
                                        "visible",
719
                                        api_get_user_id(),
720
                                        $group,
721
                                        0,
722
                                        $start,
723
                                        $end,
724
                                        $this->sessionId
725
                                    );
726
                                }
727
                            }
728
729
                            // Delete groups.
730
                            if (!empty($groupsToDelete)) {
@@ 744-759 (lines=16) @@
741
                            }
742
743
                            // Add users.
744
                            if (!empty($usersToAdd)) {
745
                                foreach ($usersToAdd as $userId) {
746
                                    api_item_property_update(
747
                                        $this->course,
748
                                        TOOL_CALENDAR_EVENT,
749
                                        $id,
750
                                        "visible",
751
                                        api_get_user_id(),
752
                                        $groupId,
753
                                        $userId,
754
                                        $start,
755
                                        $end,
756
                                        $this->sessionId
757
                                    );
758
                                }
759
                            }
760
761
                            // Delete users.
762
                            if (!empty($usersToDelete)) {