access_id = 1; // Set its title and description appropriately $task_obj->title = $title; // Make date to timestamp conversions if (!empty($startline)) $startline = dateIntoTimestamp($startline); $task_obj->startline = $startline; if (!empty($deadline)) $deadline = dateIntoTimestamp($deadline); $task_obj->deadline = $deadline; $task_obj->target = $target; saveTargetRealations($task_obj->getGUID(), $target); $task_obj->lecturer = $lecturer; $task_obj->task = $task; $task_obj->competencies = $competencies; $task_obj->hassubtasks = $hassubtasks; if (get_input('collections')) { saveSubTask(get_input('collections'), $task_obj->getGUID()); } // Before we can set metadata, we need to save the object if (!$task_obj->save()) { /*translation:Wasn't able to edit task. Please try again.*/ register_error(elgg_echo("task_manager:task_edit_failure")); forward("mod/task_manager/add_task.php"); } // Remove course announcement from cache unset($_SESSION['title']); unset($_SESSION['startline']); unset($_SESSION['deadline']); unset($_SESSION['target']); unset($_SESSION['lecturer']); unset($_SESSION['task']); unset($_SESSION['competencies']); unset($_SESSION['hassubtasks']); // Forward to task forward("pg/task_manager/task/" . $task_obj->getGUID()); } ?>