function opentasks() { $link = mysql_connect(DB_HOST, DB_USER, DB_PASS); mysql_select_db(DB_NAME, $link); $query = "select * from healingcrystals_project_objects where parent_id='" . $this->active_checklist->getId() . "' and type='Task' and project_id='" . $this->active_project->getId() . "' and completed_on is not null"; $result = mysql_query($query, $link); while ($info = mysql_fetch_assoc($result)) { $task = new Task($info['id']); $open = $task->open($this->logged_user); if ($open && !is_error($open)) { $updated++; } } mysql_close($link); $this->redirectToUrl($this->active_checklist->getViewUrl()); }