Merged r12989 and r12997 (#16236).

git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13020 e93f8b46-1217-0410-a6f0-8f06a7374b81
Merged r12970 (#16259).

git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13021 e93f8b46-1217-0410-a6f0-8f06a7374b81
Merged r12990 (#16338).

git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13022 e93f8b46-1217-0410-a6f0-8f06a7374b81
Merged r12990 and r12991 (#16326).

git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13023 e93f8b46-1217-0410-a6f0-8f06a7374b81
Merged r12968 (#16319).

git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13024 e93f8b46-1217-0410-a6f0-8f06a7374b81
Merged r12986 (#16381).

git-svn-id: http://svn.redmine.org/redmine/branches/2.5-stable@13025 e93f8b46-1217-0410-a6f0-8f06a7374b81