@@ -273,7 +273,7 class IssuesController < ApplicationController | |||||
273 | return |
|
273 | return | |
274 | end |
|
274 | end | |
275 | @available_statuses = Workflow.available_statuses(@project) |
|
275 | @available_statuses = Workflow.available_statuses(@project) | |
276 |
@custom_fields = @project.all_issue_custom_fields |
|
276 | @custom_fields = @project.all_issue_custom_fields | |
277 | end |
|
277 | end | |
278 |
|
278 | |||
279 | def move |
|
279 | def move |
@@ -66,6 +66,26 module CustomFieldsHelper | |||||
66 | def custom_field_tag_with_label(name, custom_value) |
|
66 | def custom_field_tag_with_label(name, custom_value) | |
67 | custom_field_label_tag(name, custom_value) + custom_field_tag(name, custom_value) |
|
67 | custom_field_label_tag(name, custom_value) + custom_field_tag(name, custom_value) | |
68 | end |
|
68 | end | |
|
69 | ||||
|
70 | def custom_field_tag_for_bulk_edit(custom_field) | |||
|
71 | field_name = "custom_field_values[#{custom_field.id}]" | |||
|
72 | field_id = "custom_field_values_#{custom_field.id}" | |||
|
73 | case custom_field.field_format | |||
|
74 | when "date" | |||
|
75 | text_field_tag(field_name, '', :id => field_id, :size => 10) + | |||
|
76 | calendar_for(field_id) | |||
|
77 | when "text" | |||
|
78 | text_area_tag(field_name, '', :id => field_id, :rows => 3, :style => 'width:90%') | |||
|
79 | when "bool" | |||
|
80 | select_tag(field_name, options_for_select([[l(:label_no_change_option), ''], | |||
|
81 | [l(:general_text_yes), '1'], | |||
|
82 | [l(:general_text_no), '0']]), :id => field_id) | |||
|
83 | when "list" | |||
|
84 | select_tag(field_name, options_for_select([[l(:label_no_change_option), '']] + custom_field.possible_values), :id => field_id) | |||
|
85 | else | |||
|
86 | text_field_tag(field_name, '', :id => field_id) | |||
|
87 | end | |||
|
88 | end | |||
69 |
|
89 | |||
70 | # Return a string used to display a custom value |
|
90 | # Return a string used to display a custom value | |
71 | def show_value(custom_value) |
|
91 | def show_value(custom_value) |
@@ -46,9 +46,7 | |||||
46 | </p> |
|
46 | </p> | |
47 |
|
47 | |||
48 | <% @custom_fields.each do |custom_field| %> |
|
48 | <% @custom_fields.each do |custom_field| %> | |
49 | <p><label><%= h(custom_field.name) %> |
|
49 | <p><label><%= h(custom_field.name) %> <%= custom_field_tag_for_bulk_edit(custom_field) %></label></p> | |
50 | <%= select_tag "custom_field_values[#{custom_field.id}]", options_for_select([[l(:label_no_change_option), '']] + custom_field.possible_values) %></label> |
|
|||
51 | </p> |
|
|||
52 | <% end %> |
|
50 | <% end %> | |
53 |
|
51 | |||
54 | <%= call_hook(:view_issues_bulk_edit_details_bottom, { :issues => @issues }) %> |
|
52 | <%= call_hook(:view_issues_bulk_edit_details_bottom, { :issues => @issues }) %> |
@@ -115,3 +115,17 custom_fields_008: | |||||
115 | field_format: date |
|
115 | field_format: date | |
116 | default_value: "" |
|
116 | default_value: "" | |
117 | editable: true |
|
117 | editable: true | |
|
118 | custom_fields_009: | |||
|
119 | name: Project 1 cf | |||
|
120 | min_length: 0 | |||
|
121 | regexp: "" | |||
|
122 | is_for_all: false | |||
|
123 | is_filter: true | |||
|
124 | type: IssueCustomField | |||
|
125 | max_length: 0 | |||
|
126 | possible_values: "" | |||
|
127 | id: 9 | |||
|
128 | is_required: false | |||
|
129 | field_format: date | |||
|
130 | default_value: "" | |||
|
131 | editable: true |
@@ -946,7 +946,15 class IssuesControllerTest < ActionController::TestCase | |||||
946 | get :bulk_edit, :ids => [1, 2] |
|
946 | get :bulk_edit, :ids => [1, 2] | |
947 | assert_response :success |
|
947 | assert_response :success | |
948 | assert_template 'bulk_edit' |
|
948 | assert_template 'bulk_edit' | |
|
949 | ||||
|
950 | # Project specific custom field, date type | |||
|
951 | field = CustomField.find(9) | |||
|
952 | assert !field.is_for_all? | |||
|
953 | assert_equal 'date', field.field_format | |||
|
954 | assert_tag :input, :attributes => {:name => 'custom_field_values[9]'} | |||
|
955 | ||||
949 | # System wide custom field |
|
956 | # System wide custom field | |
|
957 | assert CustomField.find(1).is_for_all? | |||
950 | assert_tag :select, :attributes => {:name => 'custom_field_values[1]'} |
|
958 | assert_tag :select, :attributes => {:name => 'custom_field_values[1]'} | |
951 | end |
|
959 | end | |
952 |
|
960 |
General Comments 0
You need to be logged in to leave comments.
Login now