2006-06-28 22:11:03 +04:00
|
|
|
<%= error_messages_for 'custom_field' %>
|
|
|
|
|
2013-10-20 12:29:55 +04:00
|
|
|
<div class="splitcontentleft">
|
2011-12-09 22:15:55 +04:00
|
|
|
<div class="box tabular">
|
2014-02-15 14:04:25 +04:00
|
|
|
<p><%= f.select :field_format, custom_field_formats_for_select(@custom_field), {}, :disabled => !@custom_field.new_record? %></p>
|
2006-12-17 17:22:09 +03:00
|
|
|
<p><%= f.text_field :name, :required => true %></p>
|
2013-12-14 12:22:43 +04:00
|
|
|
<p><%= f.text_area :description, :rows => 7 %></p>
|
2012-08-07 20:58:51 +04:00
|
|
|
|
2013-12-14 12:22:43 +04:00
|
|
|
<% if @custom_field.format.multiple_supported %>
|
2013-01-12 13:27:03 +04:00
|
|
|
<p>
|
|
|
|
<%= f.check_box :multiple %>
|
|
|
|
<% if !@custom_field.new_record? && @custom_field.multiple %>
|
|
|
|
<em class="info"><%= l(:text_turning_multiple_off) %></em>
|
|
|
|
<% end %>
|
|
|
|
</p>
|
2012-08-07 20:58:51 +04:00
|
|
|
<% end %>
|
|
|
|
|
2013-12-14 12:22:43 +04:00
|
|
|
<%= render_custom_field_format_partial f, @custom_field %>
|
2012-08-07 20:58:51 +04:00
|
|
|
|
2009-03-21 03:22:59 +03:00
|
|
|
<%= call_hook(:view_custom_fields_form_upper_box, :custom_field => @custom_field, :form => f) %>
|
2007-03-12 20:59:02 +03:00
|
|
|
</div>
|
2013-12-14 12:22:43 +04:00
|
|
|
<p><%= submit_tag l(:button_save) %></p>
|
|
|
|
</div>
|
2006-06-28 22:11:03 +04:00
|
|
|
|
2013-12-14 12:22:43 +04:00
|
|
|
<div class="splitcontentright">
|
2011-12-09 22:15:55 +04:00
|
|
|
<div class="box tabular">
|
2009-01-17 11:25:55 +03:00
|
|
|
<% case @custom_field.class.name
|
2007-03-12 20:59:02 +03:00
|
|
|
when "IssueCustomField" %>
|
2006-12-17 17:22:09 +03:00
|
|
|
<p><%= f.check_box :is_required %></p>
|
2013-12-14 12:22:43 +04:00
|
|
|
<p><%= f.check_box :is_for_all, :data => {:disables => '#custom_field_project_ids input'} %></p>
|
2007-04-17 14:53:20 +04:00
|
|
|
<p><%= f.check_box :is_filter %></p>
|
2013-12-14 12:22:43 +04:00
|
|
|
<% if @custom_field.format.searchable_supported %>
|
2007-12-14 21:54:55 +03:00
|
|
|
<p><%= f.check_box :searchable %></p>
|
2013-12-14 12:22:43 +04:00
|
|
|
<% end %>
|
2013-07-13 13:20:11 +04:00
|
|
|
<p>
|
|
|
|
<label><%= l(:field_visible) %></label>
|
|
|
|
<label class="block">
|
2013-12-14 12:22:43 +04:00
|
|
|
<%= radio_button_tag 'custom_field[visible]', 1, @custom_field.visible?, :id => 'custom_field_visible_on',
|
|
|
|
:data => {:disables => '.custom_field_role input'} %>
|
2013-07-13 13:20:11 +04:00
|
|
|
<%= l(:label_visibility_public) %>
|
|
|
|
</label>
|
|
|
|
<label class="block">
|
2013-12-14 12:22:43 +04:00
|
|
|
<%= radio_button_tag 'custom_field[visible]', 0, !@custom_field.visible?, :id => 'custom_field_visible_off',
|
|
|
|
:data => {:enables => '.custom_field_role input'} %>
|
2013-07-13 13:20:11 +04:00
|
|
|
<%= l(:label_visibility_roles) %>:
|
|
|
|
</label>
|
|
|
|
<% Role.givable.sorted.each do |role| %>
|
|
|
|
<label class="block custom_field_role" style="padding-left:2em;">
|
2013-12-14 12:22:43 +04:00
|
|
|
<%= check_box_tag 'custom_field[role_ids][]', role.id, @custom_field.roles.include?(role), :id => nil %>
|
2013-07-13 13:20:11 +04:00
|
|
|
<%= role.name %>
|
|
|
|
</label>
|
|
|
|
<% end %>
|
|
|
|
<%= hidden_field_tag 'custom_field[role_ids][]', '' %>
|
|
|
|
</p>
|
2011-08-02 16:42:08 +04:00
|
|
|
|
2006-12-17 17:22:09 +03:00
|
|
|
<% when "UserCustomField" %>
|
|
|
|
<p><%= f.check_box :is_required %></p>
|
2010-11-07 17:15:01 +03:00
|
|
|
<p><%= f.check_box :visible %></p>
|
2009-01-17 14:18:04 +03:00
|
|
|
<p><%= f.check_box :editable %></p>
|
2012-08-07 23:17:59 +04:00
|
|
|
<p><%= f.check_box :is_filter %></p>
|
2006-07-29 13:32:58 +04:00
|
|
|
|
2006-12-17 17:22:09 +03:00
|
|
|
<% when "ProjectCustomField" %>
|
|
|
|
<p><%= f.check_box :is_required %></p>
|
2010-11-07 17:15:01 +03:00
|
|
|
<p><%= f.check_box :visible %></p>
|
2013-12-14 12:22:43 +04:00
|
|
|
<% if @custom_field.format.searchable_supported %>
|
2010-02-28 13:55:24 +03:00
|
|
|
<p><%= f.check_box :searchable %></p>
|
2013-12-14 12:22:43 +04:00
|
|
|
<% end %>
|
2012-08-07 23:17:59 +04:00
|
|
|
<p><%= f.check_box :is_filter %></p>
|
|
|
|
|
|
|
|
<% when "VersionCustomField" %>
|
|
|
|
<p><%= f.check_box :is_required %></p>
|
|
|
|
<p><%= f.check_box :is_filter %></p>
|
|
|
|
|
|
|
|
<% when "GroupCustomField" %>
|
|
|
|
<p><%= f.check_box :is_required %></p>
|
|
|
|
<p><%= f.check_box :is_filter %></p>
|
2006-07-29 13:32:58 +04:00
|
|
|
|
2008-07-22 22:52:00 +04:00
|
|
|
<% when "TimeEntryCustomField" %>
|
|
|
|
<p><%= f.check_box :is_required %></p>
|
2012-12-09 23:18:57 +04:00
|
|
|
<p><%= f.check_box :is_filter %></p>
|
2008-07-22 22:52:00 +04:00
|
|
|
|
2009-10-22 02:34:22 +04:00
|
|
|
<% else %>
|
|
|
|
<p><%= f.check_box :is_required %></p>
|
2011-08-02 16:42:08 +04:00
|
|
|
|
2006-07-29 13:32:58 +04:00
|
|
|
<% end %>
|
2009-03-21 03:22:59 +03:00
|
|
|
<%= call_hook(:"view_custom_fields_form_#{@custom_field.type.to_s.underscore}", :custom_field => @custom_field, :form => f) %>
|
2006-07-29 13:32:58 +04:00
|
|
|
</div>
|
2013-10-20 12:29:55 +04:00
|
|
|
|
|
|
|
<% if @custom_field.is_a?(IssueCustomField) %>
|
2013-12-14 12:22:43 +04:00
|
|
|
<fieldset class="box" id="custom_field_tracker_ids"><legend><%=l(:label_tracker_plural)%></legend>
|
2014-01-08 09:36:34 +04:00
|
|
|
<% Tracker.sorted.each do |tracker| %>
|
2013-10-20 12:29:55 +04:00
|
|
|
<%= check_box_tag "custom_field[tracker_ids][]",
|
|
|
|
tracker.id,
|
|
|
|
(@custom_field.trackers.include? tracker),
|
|
|
|
:id => "custom_field_tracker_ids_#{tracker.id}" %>
|
|
|
|
<label class="no-css" for="custom_field_tracker_ids_<%=tracker.id%>">
|
|
|
|
<%= h(tracker.name) %>
|
|
|
|
</label>
|
|
|
|
<% end %>
|
|
|
|
<%= hidden_field_tag "custom_field[tracker_ids][]", '' %>
|
2013-12-14 12:22:43 +04:00
|
|
|
<p><%= check_all_links 'custom_field_tracker_ids' %></p>
|
2013-10-20 12:29:55 +04:00
|
|
|
</fieldset>
|
|
|
|
|
|
|
|
<fieldset class="box" id="custom_field_project_ids"><legend><%= l(:label_project_plural) %></legend>
|
|
|
|
<%= render_project_nested_lists(Project.all) do |p|
|
|
|
|
content_tag('label', check_box_tag('custom_field[project_ids][]', p.id, @custom_field.projects.to_a.include?(p), :id => nil) + ' ' + h(p))
|
|
|
|
end %>
|
|
|
|
<%= hidden_field_tag('custom_field[project_ids][]', '', :id => nil) %>
|
|
|
|
<p><%= check_all_links 'custom_field_project_ids' %></p>
|
|
|
|
</fieldset>
|
|
|
|
<% end %>
|
2013-12-14 12:22:43 +04:00
|
|
|
</div>
|
2013-02-15 14:45:34 +04:00
|
|
|
|
|
|
|
<% include_calendar_headers_tags %>
|