Compatibility with latest Redmine.

Code revamped for work with latest redmine.