add_system_message(_("At least one of the parameters is empty."), 'error'); forward('courses/my/add'); } else { if (!check_credits($credits)) { $Dippler->add_system_message(_("Credits has to be a numeric value."), 'error'); forward('courses/my/add'); } $course = new Course(); $course->type = "course"; $course->title = $title; $course->description = $description; $course->start = date_into_timestamp($start); $course->end = date_into_timestamp($end); $course->applyuntil = date_into_timestamp($applyuntil); $course->provider = $provider; $course->identifier = $identifier; $course->credits = $credits; $course->permission = $permission; $course->enrollment_procedure = $enrollment_procedure; $course->education_level = $education_level; $course->language_of_instruction = $language_of_instruction; $course->attendance_mode = $attendance_mode; $course->objective = $objective; $course->assessment = $assessment; $course->prerequisite = $prerequisite; $course->course_tag = $course_tag; $course->image = $image; $course->status = $status; if (!$course->create()) { $Dippler->add_system_message(_("Course could not be created."), 'error'); forward('courses/my/add'); } $Dippler->add_system_message(_("Course added.")); // Clear cache $Dippler->clearSessionInputValues(); forward($course->getURL("info")); } // Clear cache $Dippler->clearSessionInputValues(); forward("courses/my"); ?>