@@ -293,8 +293,11 class ProjectsController < ApplicationController | |||||
293 | new_project = Project.find(params[:new_project_id]) |
|
293 | new_project = Project.find(params[:new_project_id]) | |
294 | new_tracker = Tracker.find(params[:new_tracker_id]) |
|
294 | new_tracker = Tracker.find(params[:new_tracker_id]) | |
295 | @issues.each { |i| |
|
295 | @issues.each { |i| | |
296 |
# |
|
296 | # project dependent properties | |
297 |
|
|
297 | unless i.project_id == new_project.id | |
|
298 | i.category = nil | |||
|
299 | i.fixed_version = nil | |||
|
300 | end | |||
298 | # move the issue |
|
301 | # move the issue | |
299 | i.project = new_project |
|
302 | i.project = new_project | |
300 | i.tracker = new_tracker |
|
303 | i.tracker = new_tracker |
@@ -161,6 +161,7 class TabularFormBuilder < ActionView::Helpers::FormBuilder | |||||
161 | (field_helpers - %w(radio_button hidden_field) + %w(date_select)).each do |selector| |
|
161 | (field_helpers - %w(radio_button hidden_field) + %w(date_select)).each do |selector| | |
162 | src = <<-END_SRC |
|
162 | src = <<-END_SRC | |
163 | def #{selector}(field, options = {}) |
|
163 | def #{selector}(field, options = {}) | |
|
164 | return super if options.delete :no_label | |||
164 | label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "") |
|
165 | label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "") | |
165 | label = @template.content_tag("label", label_text, |
|
166 | label = @template.content_tag("label", label_text, | |
166 | :class => (@object.errors[field] ? "error" : nil), |
|
167 | :class => (@object.errors[field] ? "error" : nil), | |
@@ -171,7 +172,7 class TabularFormBuilder < ActionView::Helpers::FormBuilder | |||||
171 | class_eval src, __FILE__, __LINE__ |
|
172 | class_eval src, __FILE__, __LINE__ | |
172 | end |
|
173 | end | |
173 |
|
174 | |||
174 | def select(field, choices, options = {}) |
|
175 | def select(field, choices, options = {}, html_options = {}) | |
175 | label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "") |
|
176 | label_text = l(("field_"+field.to_s.gsub(/\_id$/, "")).to_sym) + (options.delete(:required) ? @template.content_tag("span", " *", :class => "required"): "") | |
176 | label = @template.content_tag("label", label_text, |
|
177 | label = @template.content_tag("label", label_text, | |
177 | :class => (@object.errors[field] ? "error" : nil), |
|
178 | :class => (@object.errors[field] ? "error" : nil), |
@@ -72,6 +72,6 module CustomFieldsHelper | |||||
72 |
|
72 | |||
73 | # Return an array of custom field formats which can be used in select_tag |
|
73 | # Return an array of custom field formats which can be used in select_tag | |
74 | def custom_field_formats_for_select |
|
74 | def custom_field_formats_for_select | |
75 |
CustomField::FIELD_FORMATS. |
|
75 | CustomField::FIELD_FORMATS.sort {|a,b| a[1][:order]<=>b[1][:order]}.collect { |k| [ l(k[1][:name]), k[0] ] } | |
76 | end |
|
76 | end | |
77 | end |
|
77 | end |
@@ -18,12 +18,12 | |||||
18 | class CustomField < ActiveRecord::Base |
|
18 | class CustomField < ActiveRecord::Base | |
19 | has_many :custom_values, :dependent => true |
|
19 | has_many :custom_values, :dependent => true | |
20 |
|
20 | |||
21 |
FIELD_FORMATS = { " |
|
21 | FIELD_FORMATS = { "string" => { :name => :label_string, :order => 1 }, | |
22 | "date" => :label_date, |
|
22 | "text" => { :name => :label_text, :order => 2 }, | |
23 | "bool" => :label_boolean, |
|
23 | "int" => { :name => :label_integer, :order => 3 }, | |
24 | "int" => :label_integer, |
|
24 | "list" => { :name => :label_list, :order => 4 }, | |
25 | "string" => :label_string, |
|
25 | "date" => { :name => :label_date, :order => 5 }, | |
26 | "text" => :label_text |
|
26 | "bool" => { :name => :label_boolean, :order => 6 } | |
27 | }.freeze |
|
27 | }.freeze | |
28 |
|
28 | |||
29 | validates_presence_of :name, :field_format |
|
29 | validates_presence_of :name, :field_format |
@@ -6,7 +6,7 | |||||
6 | <li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li> |
|
6 | <li><%=l(:label_registered_on)%>: <%= format_date(@user.created_on) %></li> | |
7 | <% for custom_value in @custom_values %> |
|
7 | <% for custom_value in @custom_values %> | |
8 | <% if !custom_value.value.empty? %> |
|
8 | <% if !custom_value.value.empty? %> | |
9 | <li><%= custom_value.custom_field.name%>: <%= show_value(custom_value) %></li> |
|
9 | <li><%= custom_value.custom_field.name%>: <%=h show_value(custom_value) %></li> | |
10 | <% end %> |
|
10 | <% end %> | |
11 | <% end %> |
|
11 | <% end %> | |
12 | </ul> |
|
12 | </ul> |
@@ -1,52 +1,70 | |||||
1 | <%= error_messages_for 'custom_field' %> |
|
1 | <%= error_messages_for 'custom_field' %> | |
2 |
|
2 | |||
|
3 | <script> | |||
|
4 | function toggle_custom_field_format() { | |||
|
5 | format = $("custom_field_field_format"); | |||
|
6 | p_length = $("custom_field_min_length"); | |||
|
7 | p_regexp = $("custom_field_regexp"); | |||
|
8 | p_values = $("custom_field_possible_values"); | |||
|
9 | switch (format.value) { | |||
|
10 | case "list": | |||
|
11 | Element.hide(p_length.parentNode); | |||
|
12 | Element.hide(p_regexp.parentNode); | |||
|
13 | Element.show(p_values.parentNode); | |||
|
14 | break; | |||
|
15 | case "int": | |||
|
16 | case "string": | |||
|
17 | case "text": | |||
|
18 | Element.show(p_length.parentNode); | |||
|
19 | Element.show(p_regexp.parentNode); | |||
|
20 | Element.hide(p_values.parentNode); | |||
|
21 | break; | |||
|
22 | case "date": | |||
|
23 | case "bool": | |||
|
24 | Element.hide(p_length.parentNode); | |||
|
25 | Element.hide(p_regexp.parentNode); | |||
|
26 | Element.hide(p_values.parentNode); | |||
|
27 | break; | |||
|
28 | default: | |||
|
29 | Element.show(p_length.parentNode); | |||
|
30 | Element.show(p_regexp.parentNode); | |||
|
31 | Element.show(p_values.parentNode); | |||
|
32 | break; | |||
|
33 | } | |||
|
34 | } | |||
|
35 | </script> | |||
|
36 | ||||
3 | <!--[form:custom_field]--> |
|
37 | <!--[form:custom_field]--> | |
4 | <div class="box"> |
|
38 | <div class="box"> | |
5 | <p><label for="custom_field_name"><%=l(:field_name)%><span class="required"> *</span></label> |
|
39 | <p><%= f.text_field :name, :required => true %></p> | |
6 | <%= text_field 'custom_field', 'name' %></p> |
|
40 | <p><%= f.select :field_format, custom_field_formats_for_select, {}, :onchange => "toggle_custom_field_format();" %></p> | |
7 |
|
||||
8 | <p><label for="custom_field_field_format"><%=l(:field_field_format)%></label> |
|
|||
9 | <%= select("custom_field", "field_format", custom_field_formats_for_select) %></p> |
|
|||
10 |
|
||||
11 | <p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label> |
|
41 | <p><label for="custom_field_min_length"><%=l(:label_min_max_length)%></label> | |
12 |
<%= text_field |
|
42 | <%= f.text_field :min_length, :size => 5, :no_label => true %> - | |
13 |
<%= text_field |
|
43 | <%= f.text_field :max_length, :size => 5, :no_label => true %><br>(<%=l(:text_min_max_length_info)%>)</p> | |
14 |
|
44 | <p><%= f.text_field :regexp, :size => 50 %><br>(<%=l(:text_regexp_info)%>)</p> | ||
15 | <p><label for="custom_field_regexp"><%=l(:field_regexp)%></label> |
|
45 | <p><%= f.text_area :possible_values, :rows => 5, :cols => 60 %><br>(<%=l(:text_possible_values_info)%>)</p> | |
16 | <%= text_field 'custom_field', 'regexp', :size => 50 %><br>(<%=l(:text_regexp_info)%>)</p> |
|
|||
17 |
|
||||
18 | <p><label for="custom_field_possible_values"><%=l(:field_possible_values)%></label> |
|
|||
19 | <%= text_area 'custom_field', 'possible_values', :rows => 5, :cols => 60 %><br>(<%=l(:text_possible_values_info)%>)</p> |
|
|||
20 | </div> |
|
46 | </div> | |
|
47 | <%= javascript_tag "toggle_custom_field_format();" %> | |||
21 | <!--[eoform:custom_field]--> |
|
48 | <!--[eoform:custom_field]--> | |
22 |
|
49 | |||
23 | <div class="box"> |
|
50 | <div class="box"> | |
24 | <% case type.to_s |
|
51 | <% case @custom_field.type.to_s | |
25 |
|
|
52 | when "IssueCustomField" %> | |
26 |
|
|
53 | ||
27 | <fieldset><legend><%=l(:label_tracker_plural)%></legend> |
|
54 | <fieldset><legend><%=l(:label_tracker_plural)%></legend> | |
28 | <% for tracker in @trackers %> |
|
55 | <% for tracker in @trackers %> | |
29 | <input type="checkbox" |
|
56 | <%= check_box_tag "tracker_ids[]", tracker.id, (@custom_field.trackers.include? tracker) %> <%= tracker.name %> | |
30 | name="tracker_ids[]" |
|
57 | <% end %> | |
31 | value="<%= tracker.id %>" |
|
58 | </fieldset> | |
32 | <%if @custom_field.trackers.include? tracker%>checked="checked"<%end%> |
|
59 | | |
33 | > <%= tracker.name %> |
|
60 | <p><%= f.check_box :is_required %></p> | |
34 | <% end %></fieldset> |
|
61 | <p><%= f.check_box :is_for_all %></p> | |
35 | |
|
62 | ||
36 |
|
63 | <% when "UserCustomField" %> | ||
37 | <p><label for="custom_field_is_required"><%=l(:field_is_required)%></label> |
|
64 | <p><%= f.check_box :is_required %></p> | |
38 | <%= check_box 'custom_field', 'is_required' %></p> |
|
|||
39 |
|
||||
40 | <p><label for="custom_field_is_for_all"><%=l(:field_is_for_all)%></label> |
|
|||
41 | <%= check_box 'custom_field', 'is_for_all' %></p> |
|
|||
42 |
|
||||
43 | <% when "UserCustomField" %> |
|
|||
44 | <p><label for="custom_field_is_required"><%=l(:field_is_required)%></label> |
|
|||
45 | <%= check_box 'custom_field', 'is_required' %></p> |
|
|||
46 |
|
65 | |||
47 |
<% |
|
66 | <% when "ProjectCustomField" %> | |
48 | <p><label for="custom_field_is_required"><%=l(:field_is_required)%></label> |
|
67 | <p><%= f.check_box :is_required %></p> | |
49 | <%= check_box 'custom_field', 'is_required' %></p> |
|
|||
50 |
|
68 | |||
51 | <% end %> |
|
69 | <% end %> | |
52 | </div> |
|
70 | </div> |
@@ -1,6 +1,6 | |||||
1 | <h2><%=l(:label_custom_field)%> (<%=l(@custom_field.type_name)%>)</h2> |
|
1 | <h2><%=l(:label_custom_field)%> (<%=l(@custom_field.type_name)%>)</h2> | |
2 |
|
2 | |||
3 | <%= start_form_tag({:action => 'edit', :id => @custom_field}, :class => "tabular") %> |
|
3 | <% labelled_tabular_form_for :custom_field, @custom_field, :url => { :action => "edit", :id => @custom_field } do |f| %> | |
4 |
|
|
4 | <%= render :partial => 'form', :locals => { :f => f } %> | |
5 |
|
|
5 | <%= submit_tag l(:button_save) %> | |
6 |
<% |
|
6 | <% end %> |
@@ -14,7 +14,7 | |||||
14 | <tr class="<%= cycle("odd", "even") %>"> |
|
14 | <tr class="<%= cycle("odd", "even") %>"> | |
15 | <td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td> |
|
15 | <td><%= link_to custom_field.name, :action => 'edit', :id => custom_field %></td> | |
16 | <td align="center"><%= l(custom_field.type_name) %></td> |
|
16 | <td align="center"><%= l(custom_field.type_name) %></td> | |
17 | <td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format]) %></td> |
|
17 | <td align="center"><%= l(CustomField::FIELD_FORMATS[custom_field.field_format][:name]) %></td> | |
18 | <td align="center"><%= image_tag 'true' if custom_field.is_required? %></td> |
|
18 | <td align="center"><%= image_tag 'true' if custom_field.is_required? %></td> | |
19 | <td align="center"><%= image_tag 'true' if custom_field.is_for_all? %></td> |
|
19 | <td align="center"><%= image_tag 'true' if custom_field.is_for_all? %></td> | |
20 | <td align="center"><%= custom_field.projects.count.to_s + ' ' + lwr(:label_project, custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td> |
|
20 | <td align="center"><%= custom_field.projects.count.to_s + ' ' + lwr(:label_project, custom_field.projects.count) if custom_field.is_a? IssueCustomField and !custom_field.is_for_all? %></td> |
@@ -1,8 +1,7 | |||||
1 | <h2><%=l(:label_custom_field_new)%> (<%=l(@custom_field.type_name)%>)</h2> |
|
1 | <h2><%=l(:label_custom_field_new)%> (<%=l(@custom_field.type_name)%>)</h2> | |
2 |
|
2 | |||
3 | <%= start_form_tag({:action => 'new'}, :class => "tabular") %> |
|
3 | <% labelled_tabular_form_for :custom_field, @custom_field, :url => { :action => "new" } do |f| %> | |
4 |
|
|
4 | <%= render :partial => 'form', :locals => { :f => f } %> | |
5 |
|
|
5 | <%= hidden_field_tag 'type', @custom_field.type %> | |
6 |
|
|
6 | <%= submit_tag l(:button_save) %> | |
7 |
<% |
|
7 | <% end %> | |
8 |
|
@@ -60,7 +60,7 end %> | |||||
60 | <%= submit_tag l(:button_change) %> |
|
60 | <%= submit_tag l(:button_change) %> | |
61 | <%= end_form_tag %> |
|
61 | <%= end_form_tag %> | |
62 | <% end %> |
|
62 | <% end %> | |
63 |
|
63 | | ||
64 | </div> |
|
64 | </div> | |
65 |
|
65 | |||
66 | <div id="history" class="box"> |
|
66 | <div id="history" class="box"> |
@@ -3,5 +3,6 | |||||
3 | <%= render(:partial => 'documents/document', |
|
3 | <%= render(:partial => 'documents/document', | |
4 | :collection => Document.find(:all, |
|
4 | :collection => Document.find(:all, | |
5 | :limit => 10, |
|
5 | :limit => 10, | |
|
6 | :order => 'documents.created_on DESC', | |||
6 | :conditions => "documents.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})", |
|
7 | :conditions => "documents.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})", | |
7 | :include => [:project])) unless @user.projects.empty? %> No newline at end of file |
|
8 | :include => [:project])) unless @user.projects.empty? %> |
@@ -3,5 +3,6 | |||||
3 | <%= render (:partial => 'news/news', |
|
3 | <%= render (:partial => 'news/news', | |
4 | :collection => News.find(:all, |
|
4 | :collection => News.find(:all, | |
5 | :limit => 10, |
|
5 | :limit => 10, | |
|
6 | :order => 'news.created_on DESC', | |||
6 | :conditions => "news.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})", |
|
7 | :conditions => "news.project_id in (#{@user.projects.collect{|m| m.id}.join(',')})", | |
7 | :include => [:project, :author])) unless @user.projects.empty? %> No newline at end of file |
|
8 | :include => [:project, :author])) unless @user.projects.empty? %> |
@@ -17,12 +17,12 | |||||
17 | @fixed_issues.each do |issue| %> |
|
17 | @fixed_issues.each do |issue| %> | |
18 | <% unless ver_id == issue.fixed_version_id %> |
|
18 | <% unless ver_id == issue.fixed_version_id %> | |
19 | <% if ver_id %></ul><% end %> |
|
19 | <% if ver_id %></ul><% end %> | |
20 |
<h3> |
|
20 | <h3><%= issue.fixed_version.name %></h3> | |
21 | <p><%= format_date(issue.fixed_version.effective_date) %><br /> |
|
21 | <p><%= format_date(issue.fixed_version.effective_date) %><br /> | |
22 | <%=h issue.fixed_version.description %></p> |
|
22 | <%=h issue.fixed_version.description %></p> | |
23 | <ul> |
|
23 | <ul> | |
24 | <% ver_id = issue.fixed_version_id |
|
24 | <% ver_id = issue.fixed_version_id | |
25 | end %> |
|
25 | end %> | |
26 |
<li><%= link_to issue. |
|
26 | <li><%= link_to "#{issue.tracker.name} #{issue.id}", :controller => 'issues', :action => 'show', :id => issue %>: <%=h issue.subject %></li> | |
27 | <% end %> |
|
27 | <% end %> | |
28 | </div> No newline at end of file |
|
28 | </div> |
@@ -31,7 +31,7 | |||||
31 | <% if delete_allowed %> |
|
31 | <% if delete_allowed %> | |
32 | <td align="center"> |
|
32 | <td align="center"> | |
33 | <div class="contextual"> |
|
33 | <div class="contextual"> | |
34 |
<%= link_to_if_authorized |
|
34 | <%= link_to_if_authorized '', {:controller => 'versions', :action => 'destroy_file', :id => version, :attachment_id => file}, :confirm => l(:text_are_you_sure), :post => true, :class => 'pic picDelete' %> | |
35 | </div> |
|
35 | </div> | |
36 | </td> |
|
36 | </td> | |
37 | <% end %> |
|
37 | <% end %> |
@@ -6,7 +6,7 | |||||
6 | <div class="box"> |
|
6 | <div class="box"> | |
7 | <p><label><%= l(:label_issue_plural) %>:</label> |
|
7 | <p><label><%= l(:label_issue_plural) %>:</label> | |
8 | <% for issue in @issues %> |
|
8 | <% for issue in @issues %> | |
9 | <b><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %></b> - <%= issue.subject %> |
|
9 | <b><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %></b> - <%=h issue.subject %> | |
10 | <%= hidden_field_tag "issue_ids[]", issue.id %><br /> |
|
10 | <%= hidden_field_tag "issue_ids[]", issue.id %><br /> | |
11 | <% end %> |
|
11 | <% end %> | |
12 | <i>(<%= @issues.length%> <%= lwr(:label_issue, @issues.length)%>)</i></p> |
|
12 | <i>(<%= @issues.length%> <%= lwr(:label_issue, @issues.length)%>)</i></p> |
@@ -1,7 +1,7 | |||||
1 | <h2><%=l(:label_overview)%></h2> |
|
1 | <h2><%=l(:label_overview)%></h2> | |
2 |
|
2 | |||
3 | <div class="splitcontentleft"> |
|
3 | <div class="splitcontentleft"> | |
4 |
<%= simple_format(auto_link(h |
|
4 | <%= simple_format(auto_link(h(@project.description))) %> | |
5 | <ul> |
|
5 | <ul> | |
6 | <% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %> |
|
6 | <% unless @project.homepage.empty? %><li><%=l(:field_homepage)%>: <%= auto_link @project.homepage %></li><% end %> | |
7 | <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li> |
|
7 | <li><%=l(:field_created_on)%>: <%= format_date(@project.created_on) %></li> |
@@ -9,6 +9,7 http://redmine.org/ | |||||
9 |
|
9 | |||
10 | * comments can now be added on news |
|
10 | * comments can now be added on news | |
11 | * "my page" is now customizable |
|
11 | * "my page" is now customizable | |
|
12 | * more powerfull and savable filters for issues lists | |||
12 | * improved issues change history |
|
13 | * improved issues change history | |
13 | * new functionality: move an issue to another project or tracker |
|
14 | * new functionality: move an issue to another project or tracker | |
14 | * new functionality: add a note to an issue |
|
15 | * new functionality: add a note to an issue | |
@@ -29,8 +30,10 http://redmine.org/ | |||||
29 | * csv output encoded to ISO-8859-1 |
|
30 | * csv output encoded to ISO-8859-1 | |
30 | * user custom field displayed on account/show |
|
31 | * user custom field displayed on account/show | |
31 | * default configuration improved (default roles, trackers, status, permissions and workflows) |
|
32 | * default configuration improved (default roles, trackers, status, permissions and workflows) | |
|
33 | * javascript added on custom field form to show/hide fields according to the format of custom field | |||
32 | * fixed: custom fields not in csv exports |
|
34 | * fixed: custom fields not in csv exports | |
33 | * fixed: project settings now displayed according to user's permissions |
|
35 | * fixed: project settings now displayed according to user's permissions | |
|
36 | * fixed: application error when no version is selected on projects/add_file | |||
34 |
|
37 | |||
35 | == 10/08/2006 v0.3.0 |
|
38 | == 10/08/2006 v0.3.0 | |
36 |
|
39 |
General Comments 0
You need to be logged in to leave comments.
Login now