Code Duplication    Length = 6-7 lines in 2 locations

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

@@ 1106-1111 (lines=6) @@
1103
        $event = $this->get_event($id);
1104
        if (!empty($event)) {
1105
            switch ($this->type) {
1106
                case 'personal':
1107
                    $sql = "UPDATE $this->tbl_personal_agenda SET
1108
                            all_day = 0, enddate = DATE_ADD(enddate, INTERVAL $delta MINUTE)
1109
							WHERE id=".intval($id);
1110
                    Database::query($sql);
1111
                    break;
1112
                case 'course':
1113
                    $sql = "UPDATE $this->tbl_course_agenda SET
1114
                            all_day = 0,  end_date = DATE_ADD(end_date, INTERVAL $delta MINUTE)
@@ 1150-1156 (lines=7) @@
1147
1148
        if (!empty($event)) {
1149
            switch ($this->type) {
1150
                case 'personal':
1151
                    $sql = "UPDATE $this->tbl_personal_agenda SET
1152
                            all_day = $allDay, date = DATE_ADD(date, INTERVAL $delta MINUTE),
1153
                            enddate = DATE_ADD(enddate, INTERVAL $delta MINUTE)
1154
							WHERE id=".intval($id);
1155
                    Database::query($sql);
1156
                    break;
1157
                case 'course':
1158
                    $sql = "UPDATE $this->tbl_course_agenda SET
1159
                            all_day = $allDay, start_date = DATE_ADD(start_date,INTERVAL $delta MINUTE),