<%= select_tag('time_entry[project_id]', project_tree_options_for_select(@target_projects, :include_blank => l(:label_no_change_option), :selected => @target_project), :onchange => "updateBulkEditFrom('#{escape_javascript url_for(:action => 'bulk_edit', :format => 'js')}')" ) %>
<%= text_field :time_entry, :issue_id, :size => 6 %>
<%= date_field :time_entry, :spent_on, :size => 10, :value => @time_entry_params[:spent_on] %><%= calendar_for('time_entry_spent_on') %>
<%= text_field :time_entry, :hours, :size => 6, :value => @time_entry_params[:hours] %>
<% if @available_activities.any? %><%= select_tag('time_entry[activity_id]', content_tag('option', l(:label_no_change_option), :value => '') + options_from_collection_for_select(@available_activities, :id, :name, @time_entry_params[:activity_id])) %>
<% end %><%= text_field(:time_entry, :comments, :size => 100, :value => @time_entry_params[:comments]) %>
<% @custom_fields.each do |custom_field| %><%= custom_field_tag_for_bulk_edit('time_entry', custom_field, @time_entries, @time_entry_params[:custom_field_values][custom_field.id.to_s]) %>
<%= wikitoolbar_for "time_entry_custom_field_values_#{custom_field.id}", preview_issue_path(:project_id => @project) if custom_field.full_text_formatting? %> <% end %> <%= call_hook(:view_time_entries_bulk_edit_details_bottom, { :time_entries => @time_entries }) %><%= submit_tag l(:button_submit) %>
<% end %> <%= javascript_tag do %> $(document).ready(function(){ $('#time_entry_project_id').change(function(){ $('#time_entry_issue').text(''); }); }); <% if @project || @target_project %> observeAutocompleteField('time_entry_issue_id', function(request, callback) { var url = '<%= j auto_complete_issues_path %>'; var data = { term: request.term }; var project_id; <% if @project %> project_id = '<%= @project.id %>'; <% end %> current_project_id = $('#time_entry_project_id').val(); if(current_project_id === ''){ data['project_id'] = project_id; } else { data['project_id'] = current_project_id; } $.get(url, data, null, 'json') .done(function(data){ callback(data); }) .fail(function(jqXHR, status, error){ callback([]); }); }, { select: function(event, ui, data) { $('#time_entry_issue').text(ui.item.label); } } ); <% end %> <% end %>