|
|
|
@ -185,11 +185,14 @@ class Agenda { |
|
|
|
|
Database::update($this->tbl_personal_agenda, $attributes, array('id = ?' => $id)); |
|
|
|
|
break; |
|
|
|
|
case 'course': |
|
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
|
$attributes['title'] = $title; |
|
|
|
|
$attributes['content'] = $content; |
|
|
|
|
$attributes['start_date'] = $start; |
|
|
|
|
$attributes['end_date'] = $end; |
|
|
|
|
Database::update($this->tbl_course_agenda, $attributes, array('id = ?' => $id)); |
|
|
|
|
if (!empty($course_id)) { |
|
|
|
|
Database::update($this->tbl_course_agenda, $attributes, array('id = ? AND c_id = ?' => array($id, $course_id))); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 'admin': |
|
|
|
|
$attributes['title'] = $title; |
|
|
|
@ -208,7 +211,10 @@ class Agenda { |
|
|
|
|
Database::delete($this->tbl_personal_agenda, array('id = ?' => $id)); |
|
|
|
|
break; |
|
|
|
|
case 'course': |
|
|
|
|
Database::delete($this->tbl_course_agenda, array('id = ?' =>$id)); |
|
|
|
|
$course_id = api_get_course_int_id(); |
|
|
|
|
if (!empty($course_id)) { |
|
|
|
|
Database::delete($this->tbl_course_agenda, array('id = ? AND c_id = ?' => array($id, $course_id))); |
|
|
|
|
} |
|
|
|
|
break; |
|
|
|
|
case 'admin': |
|
|
|
|
Database::delete($this->tbl_global_agenda, array('id = ?' => $id)); |
|
|
|
|