@@ -88,7 +88,7 class TimeEntryQuery < Query | |||
|
88 | 88 | } unless activities.empty? |
|
89 | 89 | |
|
90 | 90 | add_custom_fields_filters(TimeEntryCustomField.where(:is_filter => true).all) |
|
91 | add_associations_custom_fields_filters :project, :user | |
|
91 | add_associations_custom_fields_filters :project, :issue, :user | |
|
92 | 92 | |
|
93 | 93 | @available_filters.each do |field, options| |
|
94 | 94 | options[:name] ||= l(options[:label] || "field_#{field}".gsub(/_id$/, '')) |
@@ -875,6 +875,7 en: | |||
|
875 | 875 | label_readonly: Read-only |
|
876 | 876 | label_required: Required |
|
877 | 877 | label_attribute_of_project: "Project's %{name}" |
|
878 | label_attribute_of_issue: "Issue's %{name}" | |
|
878 | 879 | label_attribute_of_author: "Author's %{name}" |
|
879 | 880 | label_attribute_of_assigned_to: "Assignee's %{name}" |
|
880 | 881 | label_attribute_of_user: "User's %{name}" |
@@ -851,6 +851,7 fr: | |||
|
851 | 851 | label_readonly: Lecture |
|
852 | 852 | label_required: Obligatoire |
|
853 | 853 | label_attribute_of_project: "%{name} du projet" |
|
854 | label_attribute_of_issue: "%{name} de la demande" | |
|
854 | 855 | label_attribute_of_author: "%{name} de l'auteur" |
|
855 | 856 | label_attribute_of_assigned_to: "%{name} de l'assigné" |
|
856 | 857 | label_attribute_of_user: "%{name} de l'utilisateur" |
@@ -519,6 +519,15 class TimelogControllerTest < ActionController::TestCase | |||
|
519 | 519 | assert_equal [t3, t1, t2], assigns(:entries) |
|
520 | 520 | end |
|
521 | 521 | |
|
522 | def test_index_with_filter_on_issue_custom_field | |
|
523 | issue = Issue.generate!(:project_id => 1, :tracker_id => 1, :custom_field_values => {2 => 'filter_on_issue_custom_field'}) | |
|
524 | entry = TimeEntry.generate!(:issue => issue, :hours => 2.5) | |
|
525 | ||
|
526 | get :index, :f => ['issue.cf_2'], :op => {'issue.cf_2' => '='}, :v => {'issue.cf_2' => ['filter_on_issue_custom_field']} | |
|
527 | assert_response :success | |
|
528 | assert_equal [entry], assigns(:entries) | |
|
529 | end | |
|
530 | ||
|
522 | 531 | def test_index_atom_feed |
|
523 | 532 | get :index, :project_id => 1, :format => 'atom' |
|
524 | 533 | assert_response :success |
@@ -98,6 +98,17 module ObjectHelpers | |||
|
98 | 98 | version |
|
99 | 99 | end |
|
100 | 100 | |
|
101 | def TimeEntry.generate!(attributes={}) | |
|
102 | entry = TimeEntry.new(attributes) | |
|
103 | entry.user ||= User.find(2) | |
|
104 | entry.issue ||= Issue.find(1) | |
|
105 | entry.project ||= entry.issue.project | |
|
106 | entry.activity ||= TimeEntryActivity.first | |
|
107 | entry.spent_on ||= Date.today | |
|
108 | entry.save! | |
|
109 | entry | |
|
110 | end | |
|
111 | ||
|
101 | 112 | def AuthSource.generate!(attributes={}) |
|
102 | 113 | @generated_auth_source_name ||= 'Auth 0' |
|
103 | 114 | @generated_auth_source_name.succ! |
General Comments 0
You need to be logged in to leave comments.
Login now