##// END OF EJS Templates
Change projects homepage limit to 255 chars (#663, #1095)....
Jean-Philippe Lang -
r1443:dfcc8e1492dc
parent child
Show More
@@ -0,0 +1,9
1 class ChangeProjectsHomepageLimit < ActiveRecord::Migration
2 def self.up
3 change_column :projects, :homepage, :string, :limit => nil, :default => ''
4 end
5
6 def self.down
7 change_column :projects, :homepage, :string, :limit => 60, :default => ''
8 end
9 end
@@ -1,261 +1,261
1 # redMine - project management software
1 # redMine - project management software
2 # Copyright (C) 2006 Jean-Philippe Lang
2 # Copyright (C) 2006 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 class Project < ActiveRecord::Base
18 class Project < ActiveRecord::Base
19 # Project statuses
19 # Project statuses
20 STATUS_ACTIVE = 1
20 STATUS_ACTIVE = 1
21 STATUS_ARCHIVED = 9
21 STATUS_ARCHIVED = 9
22
22
23 has_many :members, :include => :user, :conditions => "#{User.table_name}.status=#{User::STATUS_ACTIVE}"
23 has_many :members, :include => :user, :conditions => "#{User.table_name}.status=#{User::STATUS_ACTIVE}"
24 has_many :users, :through => :members
24 has_many :users, :through => :members
25 has_many :custom_values, :dependent => :delete_all, :as => :customized
25 has_many :custom_values, :dependent => :delete_all, :as => :customized
26 has_many :enabled_modules, :dependent => :delete_all
26 has_many :enabled_modules, :dependent => :delete_all
27 has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"
27 has_and_belongs_to_many :trackers, :order => "#{Tracker.table_name}.position"
28 has_many :issues, :dependent => :destroy, :order => "#{Issue.table_name}.created_on DESC", :include => [:status, :tracker]
28 has_many :issues, :dependent => :destroy, :order => "#{Issue.table_name}.created_on DESC", :include => [:status, :tracker]
29 has_many :issue_changes, :through => :issues, :source => :journals
29 has_many :issue_changes, :through => :issues, :source => :journals
30 has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
30 has_many :versions, :dependent => :destroy, :order => "#{Version.table_name}.effective_date DESC, #{Version.table_name}.name DESC"
31 has_many :time_entries, :dependent => :delete_all
31 has_many :time_entries, :dependent => :delete_all
32 has_many :queries, :dependent => :delete_all
32 has_many :queries, :dependent => :delete_all
33 has_many :documents, :dependent => :destroy
33 has_many :documents, :dependent => :destroy
34 has_many :news, :dependent => :delete_all, :include => :author
34 has_many :news, :dependent => :delete_all, :include => :author
35 has_many :issue_categories, :dependent => :delete_all, :order => "#{IssueCategory.table_name}.name"
35 has_many :issue_categories, :dependent => :delete_all, :order => "#{IssueCategory.table_name}.name"
36 has_many :boards, :dependent => :destroy, :order => "position ASC"
36 has_many :boards, :dependent => :destroy, :order => "position ASC"
37 has_one :repository, :dependent => :destroy
37 has_one :repository, :dependent => :destroy
38 has_many :changesets, :through => :repository
38 has_many :changesets, :through => :repository
39 has_one :wiki, :dependent => :destroy
39 has_one :wiki, :dependent => :destroy
40 # Custom field for the project issues
40 # Custom field for the project issues
41 has_and_belongs_to_many :custom_fields,
41 has_and_belongs_to_many :custom_fields,
42 :class_name => 'IssueCustomField',
42 :class_name => 'IssueCustomField',
43 :order => "#{CustomField.table_name}.position",
43 :order => "#{CustomField.table_name}.position",
44 :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}",
44 :join_table => "#{table_name_prefix}custom_fields_projects#{table_name_suffix}",
45 :association_foreign_key => 'custom_field_id'
45 :association_foreign_key => 'custom_field_id'
46
46
47 acts_as_tree :order => "name", :counter_cache => true
47 acts_as_tree :order => "name", :counter_cache => true
48
48
49 acts_as_searchable :columns => ['name', 'description'], :project_key => 'id', :permission => nil
49 acts_as_searchable :columns => ['name', 'description'], :project_key => 'id', :permission => nil
50 acts_as_event :title => Proc.new {|o| "#{l(:label_project)}: #{o.name}"},
50 acts_as_event :title => Proc.new {|o| "#{l(:label_project)}: #{o.name}"},
51 :url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}}
51 :url => Proc.new {|o| {:controller => 'projects', :action => 'show', :id => o.id}}
52
52
53 attr_protected :status, :enabled_module_names
53 attr_protected :status, :enabled_module_names
54
54
55 validates_presence_of :name, :identifier
55 validates_presence_of :name, :identifier
56 validates_uniqueness_of :name, :identifier
56 validates_uniqueness_of :name, :identifier
57 validates_associated :custom_values, :on => :update
57 validates_associated :custom_values, :on => :update
58 validates_associated :repository, :wiki
58 validates_associated :repository, :wiki
59 validates_length_of :name, :maximum => 30
59 validates_length_of :name, :maximum => 30
60 validates_length_of :homepage, :maximum => 60
60 validates_length_of :homepage, :maximum => 255
61 validates_length_of :identifier, :in => 3..20
61 validates_length_of :identifier, :in => 3..20
62 validates_format_of :identifier, :with => /^[a-z0-9\-]*$/
62 validates_format_of :identifier, :with => /^[a-z0-9\-]*$/
63
63
64 before_destroy :delete_all_members
64 before_destroy :delete_all_members
65
65
66 def identifier=(identifier)
66 def identifier=(identifier)
67 super unless identifier_frozen?
67 super unless identifier_frozen?
68 end
68 end
69
69
70 def identifier_frozen?
70 def identifier_frozen?
71 errors[:identifier].nil? && !(new_record? || identifier.blank?)
71 errors[:identifier].nil? && !(new_record? || identifier.blank?)
72 end
72 end
73
73
74 def issues_with_subprojects(include_subprojects=false)
74 def issues_with_subprojects(include_subprojects=false)
75 conditions = nil
75 conditions = nil
76 if include_subprojects
76 if include_subprojects
77 ids = [id] + child_ids
77 ids = [id] + child_ids
78 conditions = ["#{Project.table_name}.id IN (#{ids.join(',')}) AND #{Project.visible_by}"]
78 conditions = ["#{Project.table_name}.id IN (#{ids.join(',')}) AND #{Project.visible_by}"]
79 end
79 end
80 conditions ||= ["#{Project.table_name}.id = ?", id]
80 conditions ||= ["#{Project.table_name}.id = ?", id]
81 # Quick and dirty fix for Rails 2 compatibility
81 # Quick and dirty fix for Rails 2 compatibility
82 Issue.send(:with_scope, :find => { :conditions => conditions }) do
82 Issue.send(:with_scope, :find => { :conditions => conditions }) do
83 Version.send(:with_scope, :find => { :conditions => conditions }) do
83 Version.send(:with_scope, :find => { :conditions => conditions }) do
84 yield
84 yield
85 end
85 end
86 end
86 end
87 end
87 end
88
88
89 # returns latest created projects
89 # returns latest created projects
90 # non public projects will be returned only if user is a member of those
90 # non public projects will be returned only if user is a member of those
91 def self.latest(user=nil, count=5)
91 def self.latest(user=nil, count=5)
92 find(:all, :limit => count, :conditions => visible_by(user), :order => "created_on DESC")
92 find(:all, :limit => count, :conditions => visible_by(user), :order => "created_on DESC")
93 end
93 end
94
94
95 def self.visible_by(user=nil)
95 def self.visible_by(user=nil)
96 user ||= User.current
96 user ||= User.current
97 if user && user.admin?
97 if user && user.admin?
98 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
98 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
99 elsif user && user.memberships.any?
99 elsif user && user.memberships.any?
100 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND (#{Project.table_name}.is_public = #{connection.quoted_true} or #{Project.table_name}.id IN (#{user.memberships.collect{|m| m.project_id}.join(',')}))"
100 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND (#{Project.table_name}.is_public = #{connection.quoted_true} or #{Project.table_name}.id IN (#{user.memberships.collect{|m| m.project_id}.join(',')}))"
101 else
101 else
102 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND #{Project.table_name}.is_public = #{connection.quoted_true}"
102 return "#{Project.table_name}.status=#{Project::STATUS_ACTIVE} AND #{Project.table_name}.is_public = #{connection.quoted_true}"
103 end
103 end
104 end
104 end
105
105
106 def self.allowed_to_condition(user, permission, options={})
106 def self.allowed_to_condition(user, permission, options={})
107 statements = []
107 statements = []
108 base_statement = "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
108 base_statement = "#{Project.table_name}.status=#{Project::STATUS_ACTIVE}"
109 if options[:project]
109 if options[:project]
110 project_statement = "#{Project.table_name}.id = #{options[:project].id}"
110 project_statement = "#{Project.table_name}.id = #{options[:project].id}"
111 project_statement << " OR #{Project.table_name}.parent_id = #{options[:project].id}" if options[:with_subprojects]
111 project_statement << " OR #{Project.table_name}.parent_id = #{options[:project].id}" if options[:with_subprojects]
112 base_statement = "(#{project_statement}) AND (#{base_statement})"
112 base_statement = "(#{project_statement}) AND (#{base_statement})"
113 end
113 end
114 if user.admin?
114 if user.admin?
115 # no restriction
115 # no restriction
116 elsif user.logged?
116 elsif user.logged?
117 statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.non_member.allowed_to?(permission)
117 statements << "#{Project.table_name}.is_public = #{connection.quoted_true}" if Role.non_member.allowed_to?(permission)
118 allowed_project_ids = user.memberships.select {|m| m.role.allowed_to?(permission)}.collect {|m| m.project_id}
118 allowed_project_ids = user.memberships.select {|m| m.role.allowed_to?(permission)}.collect {|m| m.project_id}
119 statements << "#{Project.table_name}.id IN (#{allowed_project_ids.join(',')})" if allowed_project_ids.any?
119 statements << "#{Project.table_name}.id IN (#{allowed_project_ids.join(',')})" if allowed_project_ids.any?
120 elsif Role.anonymous.allowed_to?(permission)
120 elsif Role.anonymous.allowed_to?(permission)
121 # anonymous user allowed on public project
121 # anonymous user allowed on public project
122 statements << "#{Project.table_name}.is_public = #{connection.quoted_true}"
122 statements << "#{Project.table_name}.is_public = #{connection.quoted_true}"
123 else
123 else
124 # anonymous user is not authorized
124 # anonymous user is not authorized
125 statements << "1=0"
125 statements << "1=0"
126 end
126 end
127 statements.empty? ? base_statement : "((#{base_statement}) AND (#{statements.join(' OR ')}))"
127 statements.empty? ? base_statement : "((#{base_statement}) AND (#{statements.join(' OR ')}))"
128 end
128 end
129
129
130 def project_condition(with_subprojects)
130 def project_condition(with_subprojects)
131 cond = "#{Project.table_name}.id = #{id}"
131 cond = "#{Project.table_name}.id = #{id}"
132 cond = "(#{cond} OR #{Project.table_name}.parent_id = #{id})" if with_subprojects
132 cond = "(#{cond} OR #{Project.table_name}.parent_id = #{id})" if with_subprojects
133 cond
133 cond
134 end
134 end
135
135
136 def self.find(*args)
136 def self.find(*args)
137 if args.first && args.first.is_a?(String) && !args.first.match(/^\d*$/)
137 if args.first && args.first.is_a?(String) && !args.first.match(/^\d*$/)
138 project = find_by_identifier(*args)
138 project = find_by_identifier(*args)
139 raise ActiveRecord::RecordNotFound, "Couldn't find Project with identifier=#{args.first}" if project.nil?
139 raise ActiveRecord::RecordNotFound, "Couldn't find Project with identifier=#{args.first}" if project.nil?
140 project
140 project
141 else
141 else
142 super
142 super
143 end
143 end
144 end
144 end
145
145
146 def to_param
146 def to_param
147 identifier
147 identifier
148 end
148 end
149
149
150 def active?
150 def active?
151 self.status == STATUS_ACTIVE
151 self.status == STATUS_ACTIVE
152 end
152 end
153
153
154 def archive
154 def archive
155 # Archive subprojects if any
155 # Archive subprojects if any
156 children.each do |subproject|
156 children.each do |subproject|
157 subproject.archive
157 subproject.archive
158 end
158 end
159 update_attribute :status, STATUS_ARCHIVED
159 update_attribute :status, STATUS_ARCHIVED
160 end
160 end
161
161
162 def unarchive
162 def unarchive
163 return false if parent && !parent.active?
163 return false if parent && !parent.active?
164 update_attribute :status, STATUS_ACTIVE
164 update_attribute :status, STATUS_ACTIVE
165 end
165 end
166
166
167 def active_children
167 def active_children
168 children.select {|child| child.active?}
168 children.select {|child| child.active?}
169 end
169 end
170
170
171 # Returns an array of the trackers used by the project and its sub projects
171 # Returns an array of the trackers used by the project and its sub projects
172 def rolled_up_trackers
172 def rolled_up_trackers
173 @rolled_up_trackers ||=
173 @rolled_up_trackers ||=
174 Tracker.find(:all, :include => :projects,
174 Tracker.find(:all, :include => :projects,
175 :select => "DISTINCT #{Tracker.table_name}.*",
175 :select => "DISTINCT #{Tracker.table_name}.*",
176 :conditions => ["#{Project.table_name}.id = ? OR #{Project.table_name}.parent_id = ?", id, id],
176 :conditions => ["#{Project.table_name}.id = ? OR #{Project.table_name}.parent_id = ?", id, id],
177 :order => "#{Tracker.table_name}.position")
177 :order => "#{Tracker.table_name}.position")
178 end
178 end
179
179
180 # Deletes all project's members
180 # Deletes all project's members
181 def delete_all_members
181 def delete_all_members
182 Member.delete_all(['project_id = ?', id])
182 Member.delete_all(['project_id = ?', id])
183 end
183 end
184
184
185 # Users issues can be assigned to
185 # Users issues can be assigned to
186 def assignable_users
186 def assignable_users
187 members.select {|m| m.role.assignable?}.collect {|m| m.user}.sort
187 members.select {|m| m.role.assignable?}.collect {|m| m.user}.sort
188 end
188 end
189
189
190 # Returns the mail adresses of users that should be always notified on project events
190 # Returns the mail adresses of users that should be always notified on project events
191 def recipients
191 def recipients
192 members.select {|m| m.mail_notification? || m.user.mail_notification?}.collect {|m| m.user.mail}
192 members.select {|m| m.mail_notification? || m.user.mail_notification?}.collect {|m| m.user.mail}
193 end
193 end
194
194
195 # Returns an array of all custom fields enabled for project issues
195 # Returns an array of all custom fields enabled for project issues
196 # (explictly associated custom fields and custom fields enabled for all projects)
196 # (explictly associated custom fields and custom fields enabled for all projects)
197 def custom_fields_for_issues(tracker)
197 def custom_fields_for_issues(tracker)
198 all_custom_fields.select {|c| tracker.custom_fields.include? c }
198 all_custom_fields.select {|c| tracker.custom_fields.include? c }
199 end
199 end
200
200
201 def all_custom_fields
201 def all_custom_fields
202 @all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq
202 @all_custom_fields ||= (IssueCustomField.for_all + custom_fields).uniq
203 end
203 end
204
204
205 def project
205 def project
206 self
206 self
207 end
207 end
208
208
209 def <=>(project)
209 def <=>(project)
210 name.downcase <=> project.name.downcase
210 name.downcase <=> project.name.downcase
211 end
211 end
212
212
213 def to_s
213 def to_s
214 name
214 name
215 end
215 end
216
216
217 # Returns a short description of the projects (first lines)
217 # Returns a short description of the projects (first lines)
218 def short_description(length = 255)
218 def short_description(length = 255)
219 description.gsub(/^(.{#{length}}[^\n]*).*$/m, '\1').strip if description
219 description.gsub(/^(.{#{length}}[^\n]*).*$/m, '\1').strip if description
220 end
220 end
221
221
222 def allows_to?(action)
222 def allows_to?(action)
223 if action.is_a? Hash
223 if action.is_a? Hash
224 allowed_actions.include? "#{action[:controller]}/#{action[:action]}"
224 allowed_actions.include? "#{action[:controller]}/#{action[:action]}"
225 else
225 else
226 allowed_permissions.include? action
226 allowed_permissions.include? action
227 end
227 end
228 end
228 end
229
229
230 def module_enabled?(module_name)
230 def module_enabled?(module_name)
231 module_name = module_name.to_s
231 module_name = module_name.to_s
232 enabled_modules.detect {|m| m.name == module_name}
232 enabled_modules.detect {|m| m.name == module_name}
233 end
233 end
234
234
235 def enabled_module_names=(module_names)
235 def enabled_module_names=(module_names)
236 enabled_modules.clear
236 enabled_modules.clear
237 module_names = [] unless module_names && module_names.is_a?(Array)
237 module_names = [] unless module_names && module_names.is_a?(Array)
238 module_names.each do |name|
238 module_names.each do |name|
239 enabled_modules << EnabledModule.new(:name => name.to_s)
239 enabled_modules << EnabledModule.new(:name => name.to_s)
240 end
240 end
241 end
241 end
242
242
243 protected
243 protected
244 def validate
244 def validate
245 errors.add(parent_id, " must be a root project") if parent and parent.parent
245 errors.add(parent_id, " must be a root project") if parent and parent.parent
246 errors.add_to_base("A project with subprojects can't be a subproject") if parent and children.size > 0
246 errors.add_to_base("A project with subprojects can't be a subproject") if parent and children.size > 0
247 errors.add(:identifier, :activerecord_error_invalid) if !identifier.blank? && identifier.match(/^\d*$/)
247 errors.add(:identifier, :activerecord_error_invalid) if !identifier.blank? && identifier.match(/^\d*$/)
248 end
248 end
249
249
250 private
250 private
251 def allowed_permissions
251 def allowed_permissions
252 @allowed_permissions ||= begin
252 @allowed_permissions ||= begin
253 module_names = enabled_modules.collect {|m| m.name}
253 module_names = enabled_modules.collect {|m| m.name}
254 Redmine::AccessControl.modules_permissions(module_names).collect {|p| p.name}
254 Redmine::AccessControl.modules_permissions(module_names).collect {|p| p.name}
255 end
255 end
256 end
256 end
257
257
258 def allowed_actions
258 def allowed_actions
259 @actions_allowed ||= allowed_permissions.inject([]) { |actions, permission| actions += Redmine::AccessControl.allowed_actions(permission) }.flatten
259 @actions_allowed ||= allowed_permissions.inject([]) { |actions, permission| actions += Redmine::AccessControl.allowed_actions(permission) }.flatten
260 end
260 end
261 end
261 end
@@ -1,48 +1,48
1 <%= error_messages_for 'project' %>
1 <%= error_messages_for 'project' %>
2
2
3 <div class="box">
3 <div class="box">
4 <!--[form:project]-->
4 <!--[form:project]-->
5 <p><%= f.text_field :name, :required => true %><br /><em><%= l(:text_caracters_maximum, 30) %></em></p>
5 <p><%= f.text_field :name, :required => true %><br /><em><%= l(:text_caracters_maximum, 30) %></em></p>
6
6
7 <% if User.current.admin? and !@root_projects.empty? %>
7 <% if User.current.admin? and !@root_projects.empty? %>
8 <p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
8 <p><%= f.select :parent_id, (@root_projects.collect {|p| [p.name, p.id]}), { :include_blank => true } %></p>
9 <% end %>
9 <% end %>
10
10
11 <p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p>
11 <p><%= f.text_area :description, :rows => 5, :class => 'wiki-edit' %></p>
12 <p><%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen? %>
12 <p><%= f.text_field :identifier, :required => true, :disabled => @project.identifier_frozen? %>
13 <% unless @project.identifier_frozen? %>
13 <% unless @project.identifier_frozen? %>
14 <br /><em><%= l(:text_length_between, 3, 20) %> <%= l(:text_project_identifier_info) %></em>
14 <br /><em><%= l(:text_length_between, 3, 20) %> <%= l(:text_project_identifier_info) %></em>
15 <% end %></p>
15 <% end %></p>
16 <p><%= f.text_field :homepage, :size => 40 %></p>
16 <p><%= f.text_field :homepage, :size => 60 %></p>
17 <p><%= f.check_box :is_public %></p>
17 <p><%= f.check_box :is_public %></p>
18 <%= wikitoolbar_for 'project_description' %>
18 <%= wikitoolbar_for 'project_description' %>
19
19
20 <% for @custom_value in @custom_values %>
20 <% for @custom_value in @custom_values %>
21 <p><%= custom_field_tag_with_label @custom_value %></p>
21 <p><%= custom_field_tag_with_label @custom_value %></p>
22 <% end %>
22 <% end %>
23 </div>
23 </div>
24
24
25 <% unless @trackers.empty? %>
25 <% unless @trackers.empty? %>
26 <fieldset class="box"><legend><%=l(:label_tracker_plural)%></legend>
26 <fieldset class="box"><legend><%=l(:label_tracker_plural)%></legend>
27 <% @trackers.each do |tracker| %>
27 <% @trackers.each do |tracker| %>
28 <label class="floating">
28 <label class="floating">
29 <%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker) %>
29 <%= check_box_tag 'project[tracker_ids][]', tracker.id, @project.trackers.include?(tracker) %>
30 <%= tracker %>
30 <%= tracker %>
31 </label>
31 </label>
32 <% end %>
32 <% end %>
33 <%= hidden_field_tag 'project[tracker_ids][]', '' %>
33 <%= hidden_field_tag 'project[tracker_ids][]', '' %>
34 </fieldset>
34 </fieldset>
35 <% end %>
35 <% end %>
36
36
37 <% unless @custom_fields.empty? %>
37 <% unless @custom_fields.empty? %>
38 <fieldset class="box"><legend><%=l(:label_custom_field_plural)%></legend>
38 <fieldset class="box"><legend><%=l(:label_custom_field_plural)%></legend>
39 <% for custom_field in @custom_fields %>
39 <% for custom_field in @custom_fields %>
40 <label class="floating">
40 <label class="floating">
41 <%= check_box_tag 'project[custom_field_ids][]', custom_field.id, ((@project.custom_fields.include? custom_field) or custom_field.is_for_all?), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %>
41 <%= check_box_tag 'project[custom_field_ids][]', custom_field.id, ((@project.custom_fields.include? custom_field) or custom_field.is_for_all?), (custom_field.is_for_all? ? {:disabled => "disabled"} : {}) %>
42 <%= custom_field.name %>
42 <%= custom_field.name %>
43 </label>
43 </label>
44 <% end %>
44 <% end %>
45 <%= hidden_field_tag 'project[custom_field_ids][]', '' %>
45 <%= hidden_field_tag 'project[custom_field_ids][]', '' %>
46 </fieldset>
46 </fieldset>
47 <% end %>
47 <% end %>
48 <!--[eoform:project]-->
48 <!--[eoform:project]-->
General Comments 0
You need to be logged in to leave comments. Login now