mirror of
https://github.com/meineerde/redmine.git
synced 2025-12-20 15:31:12 +00:00
Redirect to the parent issue after adding a subtask.
git-svn-id: http://svn.redmine.org/redmine/trunk@16317 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
be6199add3
commit
252804f7da
@ -578,15 +578,18 @@ class IssuesController < ApplicationController
|
|||||||
# Redirects user after a successful issue creation
|
# Redirects user after a successful issue creation
|
||||||
def redirect_after_create
|
def redirect_after_create
|
||||||
if params[:continue]
|
if params[:continue]
|
||||||
attrs = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?}
|
url_params = {}
|
||||||
|
url_params[:issue] = {:tracker_id => @issue.tracker, :parent_issue_id => @issue.parent_issue_id}.reject {|k,v| v.nil?}
|
||||||
|
url_params[:back_url] = params[:back_url].presence
|
||||||
|
|
||||||
if params[:project_id]
|
if params[:project_id]
|
||||||
redirect_to new_project_issue_path(@issue.project, :issue => attrs)
|
redirect_to new_project_issue_path(@issue.project, url_params)
|
||||||
else
|
else
|
||||||
attrs.merge! :project_id => @issue.project_id
|
url_params[:issue].merge! :project_id => @issue.project_id
|
||||||
redirect_to new_issue_path(:issue => attrs)
|
redirect_to new_issue_path(url_params)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
redirect_to issue_path(@issue)
|
redirect_back_or_default issue_path(@issue)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -184,7 +184,7 @@ module IssuesHelper
|
|||||||
:parent_issue_id => issue
|
:parent_issue_id => issue
|
||||||
}
|
}
|
||||||
attrs[:tracker_id] = issue.tracker unless issue.tracker.disabled_core_fields.include?('parent_issue_id')
|
attrs[:tracker_id] = issue.tracker unless issue.tracker.disabled_core_fields.include?('parent_issue_id')
|
||||||
link_to(l(:button_add), new_project_issue_path(issue.project, :issue => attrs))
|
link_to(l(:button_add), new_project_issue_path(issue.project, :issue => attrs, :back_url => issue_path(issue)))
|
||||||
end
|
end
|
||||||
|
|
||||||
def trackers_options_for_select(issue)
|
def trackers_options_for_select(issue)
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
<%= labelled_fields_for :issue, @issue do |f| %>
|
<%= labelled_fields_for :issue, @issue do |f| %>
|
||||||
<%= call_hook(:view_issues_form_details_top, { :issue => @issue, :form => f }) %>
|
<%= call_hook(:view_issues_form_details_top, { :issue => @issue, :form => f }) %>
|
||||||
<%= hidden_field_tag 'form_update_triggered_by', '' %>
|
<%= hidden_field_tag 'form_update_triggered_by', '' %>
|
||||||
|
<%= hidden_field_tag 'back_url', params[:back_url], :id => nil if params[:back_url].present? %>
|
||||||
|
|
||||||
<% if @issue.safe_attribute? 'is_private' %>
|
<% if @issue.safe_attribute? 'is_private' %>
|
||||||
<p id="issue_is_private_wrap">
|
<p id="issue_is_private_wrap">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user