diff --git a/app/helpers/work_packages_helper.rb b/app/helpers/work_packages_helper.rb index e196468567..cf8896e1e0 100644 --- a/app/helpers/work_packages_helper.rb +++ b/app/helpers/work_packages_helper.rb @@ -6,7 +6,7 @@ module WorkPackagesHelper end def ancestors_links - ancestors = controller.ancestors.map do |parent| + controller.ancestors.map do |parent| link_to '#' + h(parent.id), work_package_path(parent.id) end end @@ -81,7 +81,6 @@ module WorkPackagesHelper def work_package_form_top_attributes(form, work_package, locals = {}) [ work_package_form_type_attribute(form, work_package, locals), - work_package_form_planning_element_type_attribute(form, work_package, locals), work_package_form_subject_attribute(form, work_package, locals), work_package_form_parent_attribute(form, work_package, locals), work_package_form_description_attribute(form, work_package, locals) @@ -213,16 +212,6 @@ module WorkPackagesHelper end end - def work_package_form_planning_element_type_attribute(form, work_package, locals = {}) - if work_package.is_a?(PlanningElement) - field = form.select :planning_element_type_id, - (locals[:project].types.collect { |m| [m.name, m.id] }), - :include_blank => true - - WorkPackageAttribute.new(:type, field) - end - end - def work_package_form_subject_attribute(form, work_package, locals = {}) WorkPackageAttribute.new :subject, form.text_field(:subject, :size => 80, :required => true) end diff --git a/app/models/type.rb b/app/models/type.rb index 60148a91ab..ef45a732ee 100644 --- a/app/models/type.rb +++ b/app/models/type.rb @@ -100,14 +100,7 @@ class Type < ActiveRecord::Base end def enabled_in?(object) - case object - when ProjectType - object.types.include?(self) - when Project - object.types.include?(self) - else - false - end + object.types.include?(self) end def available_colors diff --git a/app/views/planning_elements/_form.html.erb b/app/views/planning_elements/_form.html.erb index c447f51637..588dec17b0 100644 --- a/app/views/planning_elements/_form.html.erb +++ b/app/views/planning_elements/_form.html.erb @@ -62,16 +62,6 @@ See doc/COPYRIGHT.rdoc for more details. <%= wikitoolbar_for 'planning_element_description' %> - - - - - - <%= f.select :planning_element_type_id, (project.types.collect { |m| [m.name, m.id] }), :include_blank => true %> - -