Project

General

Profile

Defect #40924 » 40924.patch

Go MAEDA, 2024-06-30 13:26

View differences:

app/views/issues/destroy.html.erb
3 3
<%= form_tag({}, :method => :delete)  do %>
4 4
<%= @issues.collect {|i| hidden_field_tag('ids[]', i.id, :id => nil)}.join("\n").html_safe %>
5 5
<div class="box">
6
<p><strong><%= l(:text_destroy_time_entries_question, :hours => number_with_precision(@hours, :precision => 2)) %></strong></p>
6
<p><strong><%= l(:text_destroy_time_entries_question, :hours => format_hours(@hours)) %></strong></p>
7 7
<p>
8 8
<label><%= radio_button_tag 'todo', 'destroy', true %> <%= l(:text_destroy_time_entries) %></label><br />
9 9
<% unless Setting.timelog_required_fields.include?('issue_id') %>
app/views/timelog/bulk_edit.html.erb
21 21
  <%=
22 22
    content_tag 'li',
23 23
      link_to(
24
        "#{format_date(entry.spent_on)} - #{entry.project}: #{l(:label_f_hour_plural, :value => entry.hours)} (#{entry.user})",
24
        "#{format_date(entry.spent_on)} - #{entry.project}: #{l(:label_f_hour_plural, :value => format_hours(entry.hours))} (#{entry.user})",
25 25
        edit_time_entry_path(entry)
26 26
      )
27 27
  %>
test/functional/issues_controller_test.rb
8272 8272
    leaf = Issue.generate!
8273 8273
    TimeEntry.generate!(:issue => leaf)
8274 8274
    @request.session[:user_id] = 2
8275
    delete(
8276
      :destroy,
8277
      :params => {
8278
        :ids => [parent.id, leaf.id]
8279
      }
8280
    )
8275
    with_settings :timespan_format => 'minutes' do
8276
      delete(
8277
        :destroy,
8278
        :params => {
8279
          :ids => [parent.id, leaf.id]
8280
        }
8281
      )
8282
    end
8281 8283
    assert_response :success
8282
    assert_select 'p', :text => /3\.00 hours were reported/
8284
    assert_select 'p', :text => /3:00 hours were reported/
8283 8285
  end
8284 8286

  
8285 8287
  def test_destroy_issues_and_destroy_time_entries
test/functional/timelog_controller_test.rb
727 727
  def test_get_bulk_edit
728 728
    @request.session[:user_id] = 2
729 729

  
730
    get :bulk_edit, :params => {:ids => [1, 2]}
730
    with_settings :timespan_format => 'minutes' do
731
      get :bulk_edit, :params => {:ids => [1, 2]}
732
    end
731 733
    assert_response :success
732 734

  
733 735
    assert_select 'ul#bulk-selection' do
734 736
      assert_select 'li', 2
735
      assert_select 'li a', :text => '03/23/2007 - eCookbook: 4.25 hours (John Smith)'
737
      assert_select 'li a', :text => '03/23/2007 - eCookbook: 4:15 hours (John Smith)'
736 738
    end
737 739

  
738 740
    assert_select 'form#bulk_edit_form[action=?]', '/time_entries/bulk_update' do
(3-3/3)