Adds support for multiselect custom fields (#1189).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8721 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-01-29 20:51:48 +00:00
parent 0c5af16e14
commit cd6db6a3cb
21 changed files with 657 additions and 41 deletions
+8
View File
@@ -9,6 +9,7 @@ function toggle_custom_field_format() {
p_values = $("custom_field_possible_values");
p_searchable = $("custom_field_searchable");
p_default = $("custom_field_default_value");
p_multiple = $("custom_field_multiple");
p_default.setAttribute('type','text');
Element.show(p_default.parentNode);
@@ -19,6 +20,7 @@ function toggle_custom_field_format() {
Element.hide(p_regexp.parentNode);
if (p_searchable) Element.show(p_searchable.parentNode);
Element.show(p_values.parentNode);
Element.show(p_multiple.parentNode);
break;
case "bool":
p_default.setAttribute('type','checkbox');
@@ -26,12 +28,14 @@ function toggle_custom_field_format() {
Element.hide(p_regexp.parentNode);
if (p_searchable) Element.hide(p_searchable.parentNode);
Element.hide(p_values.parentNode);
Element.hide(p_multiple.parentNode);
break;
case "date":
Element.hide(p_length.parentNode);
Element.hide(p_regexp.parentNode);
if (p_searchable) Element.hide(p_searchable.parentNode);
Element.hide(p_values.parentNode);
Element.hide(p_multiple.parentNode);
break;
case "float":
case "int":
@@ -39,6 +43,7 @@ function toggle_custom_field_format() {
Element.show(p_regexp.parentNode);
if (p_searchable) Element.hide(p_searchable.parentNode);
Element.hide(p_values.parentNode);
Element.hide(p_multiple.parentNode);
break;
case "user":
case "version":
@@ -47,12 +52,14 @@ function toggle_custom_field_format() {
if (p_searchable) Element.hide(p_searchable.parentNode);
Element.hide(p_values.parentNode);
Element.hide(p_default.parentNode);
Element.show(p_multiple.parentNode);
break;
default:
Element.show(p_length.parentNode);
Element.show(p_regexp.parentNode);
if (p_searchable) Element.show(p_searchable.parentNode);
Element.hide(p_values.parentNode);
Element.hide(p_multiple.parentNode);
break;
}
}
@@ -64,6 +71,7 @@ function toggle_custom_field_format() {
<p><%= f.text_field :name, :required => true %></p>
<p><%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :onchange => "toggle_custom_field_format();",
:disabled => !@custom_field.new_record? %></p>
<p><%= f.check_box :multiple, :disabled => !@custom_field.new_record? %></p>
<p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label>
<%= f.text_field :min_length, :size => 5, :no_label => true %> -
<%= f.text_field :max_length, :size => 5, :no_label => true %><br />(<%=l(:text_min_max_length_info)%>)</p>
+2 -2
View File
@@ -8,8 +8,8 @@
<% if journal.details.any? %>
<ul class="details">
<% for detail in journal.details %>
<li><%= show_detail(detail) %></li>
<% details_to_strings(journal.details).each do |string| %>
<li><%= string %></li>
<% end %>
</ul>
<% end %>
+2 -2
View File
@@ -19,8 +19,8 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
end
xml.content "type" => "html" do
xml.text! '<ul>'
change.details.each do |detail|
xml.text! '<li>' + show_detail(detail, false) + '</li>'
details_to_strings(change.details, false).each do |string|
xml.text! '<li>' + string + '</li>'
end
xml.text! '</ul>'
xml.text! textilizable(change, :notes, :only_path => false) unless change.notes.blank?
+2 -2
View File
@@ -1,8 +1,8 @@
<%= l(:text_issue_updated, :id => "##{@issue.id}", :author => h(@journal.user)) %>
<ul>
<% for detail in @journal.details %>
<li><%= show_detail(detail, true) %></li>
<% details_to_strings(@journal.details).each do |string| %>
<li><%= string %></li>
<% end %>
</ul>
+2 -2
View File
@@ -1,7 +1,7 @@
<%= l(:text_issue_updated, :id => "##{@issue.id}", :author => @journal.user) %>
<% for detail in @journal.details -%>
<%= show_detail(detail, true) %>
<% details_to_strings(@journal.details, true).each do |string| -%>
<%= string %>
<% end -%>
<%= @journal.notes if @journal.notes? %>