Code Duplication    Length = 6-7 lines in 2 locations

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

@@ 1089-1094 (lines=6) @@
1086
        $event = $this->get_event($id);
1087
        if (!empty($event)) {
1088
            switch ($this->type) {
1089
                case 'personal':
1090
                    $sql = "UPDATE $this->tbl_personal_agenda SET
1091
                            all_day = 0, enddate = DATE_ADD(enddate, INTERVAL $delta MINUTE)
1092
							WHERE id=".intval($id);
1093
                    Database::query($sql);
1094
                    break;
1095
                case 'course':
1096
                    $sql = "UPDATE $this->tbl_course_agenda SET
1097
                            all_day = 0,  end_date = DATE_ADD(end_date, INTERVAL $delta MINUTE)
@@ 1133-1139 (lines=7) @@
1130
1131
        if (!empty($event)) {
1132
            switch ($this->type) {
1133
                case 'personal':
1134
                    $sql = "UPDATE $this->tbl_personal_agenda SET
1135
                            all_day = $allDay, date = DATE_ADD(date, INTERVAL $delta MINUTE),
1136
                            enddate = DATE_ADD(enddate, INTERVAL $delta MINUTE)
1137
							WHERE id=".intval($id);
1138
                    Database::query($sql);
1139
                    break;
1140
                case 'course':
1141
                    $sql = "UPDATE $this->tbl_course_agenda SET
1142
                            all_day = $allDay, start_date = DATE_ADD(start_date,INTERVAL $delta MINUTE),