From 8464aa96b2eb83e84dc823ebb67dd8e5f783ee32 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Thu, 25 Jul 2013 10:14:50 +0200 Subject: [PATCH 1/2] no longer overwrites first type_attribute work_package helper method --- app/helpers/work_packages_helper.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/helpers/work_packages_helper.rb b/app/helpers/work_packages_helper.rb index bccf190768..7a2bb8033d 100644 --- a/app/helpers/work_packages_helper.rb +++ b/app/helpers/work_packages_helper.rb @@ -81,7 +81,7 @@ module WorkPackagesHelper def work_package_form_top_attributes(form, work_package, locals = {}) [ work_package_form_type_attribute(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) @@ -205,15 +205,15 @@ module WorkPackagesHelper field = form.select :type_id, locals[:project].types.collect {|t| [t.name, t.id]}, :required => true field += observe_field :work_package_type_id, :url => new_type_project_work_packages_path(locals[:project]), - :update => :attributes, - :method => :get, - :with => "Form.serialize('work_package-form')" + :update => :attributes, + :method => :get, + :with => "Form.serialize('work_package-form')" WorkPackageAttribute.new(:type, field) end end - def work_package_form_type_attribute(form, work_package, locals = {}) + 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].planning_element_types.collect { |m| [m.name, m.id] }), From f781bab04dc21076555eec2fdcb0e7bedefde5fa Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Thu, 25 Jul 2013 10:15:48 +0200 Subject: [PATCH 2/2] uses sti_type param in issue#new menu as that is what is queried for --- lib/redmine.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/redmine.rb b/lib/redmine.rb index 03efb939f9..d31ebaa8b3 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -284,7 +284,7 @@ Redmine::MenuManager.map :project_menu do |menu| :if => Proc.new { |p| p.shared_versions.any? } menu.push :issues, { :controller => '/issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural - menu.push :new_issue, { :controller => '/work_packages', :action => 'new', :type => 'Issue' }, :param => :project_id, :caption => :label_issue_new, :parent => :issues, + menu.push :new_issue, { :controller => '/work_packages', :action => 'new', :sti_type => 'Issue' }, :param => :project_id, :caption => :label_issue_new, :parent => :issues, :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) } menu.push :view_all_issues, { :controller => '/issues', :action => 'all' }, :param => :project_id, :caption => :label_issue_view_all, :parent => :issues menu.push :summary_field, {:controller => '/issues/reports', :action => 'report'}, :param => :project_id, :caption => :label_workflow_summary, :parent => :issues