Code Duplication    Length = 6-7 lines in 2 locations

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

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