Port and make it work with Redmine 2.1.2