<% if @time_entry.safe_attribute?('user_id') || User.current.allowed_to?(:add_timeentries_for_other_users_on_project, @project || @last_project) %>
  <p>
    <%= label_for_field(:user_id, {:required => true }) -%><%= easy_select_tag(
      'user_id',
      {:name => @time_entry.user.name, :id => @time_entry.user_id},
      nil,
      url_for(:action => 'load_users', :format => 'json', :project_id => @project || @last_project),
      :onchange => "$.ajax({url: '#{j bulk_time_entries_path(:user_changed => '1', :format => 'js', :project_id => @project || @last_project).html_safe}', data: $('#bulk-time-entry-form').serialize()});"
    ) -%>
  </p>
<% else %>
  <%= hidden_field_tag 'user_id', @user.id %>
<% end %>
