Code Duplication    Length = 6-7 lines in 2 locations

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

@@ 1303-1308 (lines=6) @@
1300
        $event = $this->get_event($id);
1301
        if (!empty($event)) {
1302
            switch ($this->type) {
1303
                case 'personal':
1304
                    $sql = "UPDATE $this->tbl_personal_agenda SET
1305
                            enddate = DATE_ADD(enddate, INTERVAL $delta MINUTE)
1306
							WHERE id=".intval($id);
1307
                    Database::query($sql);
1308
                    break;
1309
                case 'course':
1310
                    $sql = "UPDATE $this->tbl_course_agenda SET
1311
                            end_date = DATE_ADD(end_date, INTERVAL $delta MINUTE)
@@ 1348-1354 (lines=7) @@
1345
1346
        if (!empty($event)) {
1347
            switch ($this->type) {
1348
                case 'personal':
1349
                    $sql = "UPDATE $this->tbl_personal_agenda SET
1350
                            all_day = $allDay, date = DATE_ADD(date, INTERVAL $delta MINUTE),
1351
                            enddate = DATE_ADD(enddate, INTERVAL $delta MINUTE)
1352
							WHERE id=".intval($id);
1353
                    Database::query($sql);
1354
                    break;
1355
                case 'course':
1356
                    $sql = "UPDATE $this->tbl_course_agenda SET
1357
                            all_day = $allDay,