mirror of
https://github.com/redmine/redmine.git
synced 2025-11-14 17:26:06 +01:00
Fix that selected user on timelog#edit is incorrect (#32959).
Patch by Marius BALTEANU. git-svn-id: http://svn.redmine.org/redmine/trunk@19501 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -44,7 +44,7 @@ module TimelogHelper
|
|||||||
|
|
||||||
def user_collection_for_select_options(time_entry)
|
def user_collection_for_select_options(time_entry)
|
||||||
collection = time_entry.assignable_users
|
collection = time_entry.assignable_users
|
||||||
principals_options_for_select(collection, time_entry.user_id)
|
principals_options_for_select(collection, time_entry.user_id.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
def select_hours(data, criteria, value)
|
def select_hours(data, criteria, value)
|
||||||
|
|||||||
@@ -1458,4 +1458,19 @@ class TimelogControllerTest < Redmine::ControllerTest
|
|||||||
assert_response :success
|
assert_response :success
|
||||||
assert_select "td.issue_cf_#{field.id}", :text => 'This is a long text'
|
assert_select "td.issue_cf_#{field.id}", :text => 'This is a long text'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_edit_for_other_user
|
||||||
|
Role.find_by_name('Manager').add_permission! :log_time_for_other_users
|
||||||
|
@request.session[:user_id] = 2
|
||||||
|
|
||||||
|
get :edit, :params => {
|
||||||
|
:id => 1
|
||||||
|
}
|
||||||
|
|
||||||
|
assert_response :success
|
||||||
|
|
||||||
|
assert_select 'select[name=?]', 'time_entry[user_id]' do
|
||||||
|
assert_select 'option[value="2"][selected=selected]'
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user