<%= l(:label_bulk_edit_selected_time_entries) %>

<% if @unsaved_time_entries.present? %>
<%= l(:notice_failed_to_save_time_entries, :count => @unsaved_time_entries.size, :total => @saved_time_entries.size, :ids => @unsaved_time_entries.map {|i| "##{i.id}"}.join(', ')) %>
<% end %> <%= form_tag(bulk_update_time_entries_path, :id => 'bulk_edit_form') do %> <%= @time_entries.collect {|i| hidden_field_tag('ids[]', i.id, :id => nil)}.join.html_safe %>

<%= 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 %>