display_agenda_items(); } else { $id = (int) $_GET['id']; show_add_form($id); } } else { display_agenda_items(); } break; case "delete": $id = (int) $_GET['id']; if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $id))) { // a coach can only delete an element belonging to his session if (api_is_allowed_to_edit() && !api_is_anonymous()) { if (!empty($id)) { $res_del = delete_agenda_item($id); if ($res_del) { Display::display_normal_message(get_lang("AgendaDeleteSuccess")); } } } } display_agenda_items(); break; case "showhide": $id = (int) $_GET['id']; if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $id))) { // a coach can only delete an element belonging to his session showhide_agenda_item($id); } display_agenda_items();
display_ical_import_form(); } break; case 'edit': // a coach can only delete an element belonging to his session if ($_POST['submit_event']) { store_edited_agenda_item($event_id, $_REQUEST['id_attach'], $_REQUEST['file_comment']); $action = 'view'; } else { show_add_form($event_id, $event_type); } break; case "delete": if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $event_id))) { // a coach can only delete an element belonging to his session delete_agenda_item($event_id); $action = 'view'; } break; case "showhide": if (!(api_is_course_coach() && !api_is_element_in_the_session(TOOL_AGENDA, $event_id))) { // a coach can only delete an element belonging to his session showhide_agenda_item($event_id); $action = 'view'; } if (!empty($_GET['agenda_id'])) { display_one_agenda_item($_GET['agenda_id']); } break; case "delete_attach": //delete attachment file