public function admin_destroy_milestone() { if (!isset($_POST['id'])) { error(__("Error"), __("No milestone ID specified.", "progress")); } if (!isset($_POST['hash']) or $_POST['hash'] != Config::current()->secure_hashkey) { show_403(__("Access Denied"), __("Invalid security key.")); } $milestone = new Milestone($_POST['id']); if ($milestone->no_results) { error(__("Error"), __("Invalid milestone ID specified.", "progress")); } if (!$milestone->deletable()) { show_403(__("Access Denied"), __("You do not have sufficient privileges to delete this milestone.", "progress")); } foreach ($milestone->tickets as $ticket) { $ticket->update(null, null, $_POST['move_milestone']); } Milestone::delete($milestone->id); Flash::notice(__("Milestone deleted.", "progress"), "/admin/?action=manage_milestones"); }