if request.post?
new_tracker = params[:new_tracker_id].blank? ? nil : @target_project.trackers.find_by_id(params[:new_tracker_id])
unsaved_issue_ids = []
+ moved_issues = []
@issues.each do |issue|
issue.init_journal(User.current)
- unsaved_issue_ids << issue.id unless issue.move_to(@target_project, new_tracker, params[:copy_options])
+ if r = issue.move_to(@target_project, new_tracker, params[:copy_options])
+ moved_issues << r
+ else
+ unsaved_issue_ids << issue.id
+ end
end
if unsaved_issue_ids.empty?
flash[:notice] = l(:notice_successful_update) unless @issues.empty?
:total => @issues.size,
:ids => '#' + unsaved_issue_ids.join(', #'))
end
- redirect_to :controller => 'issues', :action => 'index', :project_id => @project
+ if params[:follow]
+ if @issues.size == 1 && moved_issues.size == 1
+ redirect_to :controller => 'issues', :action => 'show', :id => moved_issues.first
+ else
+ redirect_to :controller => 'issues', :action => 'index', :project_id => (@target_project || @project)
+ end
+ else
+ redirect_to :controller => 'issues', :action => 'index', :project_id => @project
+ end
return
end
render :layout => false if request.xhr?
<%= check_box_tag "copy_options[copy]", "1" %></p>
</div>
-<%= submit_tag l(:button_move) %>
+<%= submit_tag l(:button_move) %>
+<%= submit_tag l(:button_move_and_follow), :name => 'follow' %>
<% end %>
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
button_list: List
button_view: View
button_move: Move
+ button_move_and_follow: Move and follow
button_back: Back
button_cancel: Cancel
button_activate: Activate
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
button_list: Lister
button_view: Voir
button_move: Déplacer
+ button_move_and_follow: Déplacer et suivre
button_back: Retour
button_cancel: Annuler
button_activate: Activer
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: aberto
error_can_not_reopen_issue_on_closed_version: Uma tarefa atribuída a uma versão fechada não pode ser reaberta
label_user_anonymous: Anônimo
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: открыт
error_can_not_reopen_issue_on_closed_version: Задача, назначенная к закрытой версии, не сможет быть открыта снова
label_user_anonymous: Аноним
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
version_status_open: open
error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened
label_user_anonymous: Anonymous
+ button_move_and_follow: Move and follow
enumeration_doc_categories: 文件分類
enumeration_activities: 活動 (時間追蹤)
enumeration_system_activity: 系統活動
+ button_move_and_follow: Move and follow
enumeration_doc_categories: 文档类别
enumeration_activities: 活动(时间跟踪)
enumeration_system_activity: 系统活动
+ button_move_and_follow: Move and follow
assert_equal 2, Issue.find(1).project_id
end
+ def test_move_one_issue_to_another_project_should_follow_when_needed
+ @request.session[:user_id] = 2
+ post :move, :id => 1, :new_project_id => 2, :follow => '1'
+ assert_redirected_to '/issues/1'
+ end
+
def test_bulk_move_to_another_project
@request.session[:user_id] = 2
post :move, :ids => [1, 2], :new_project_id => 2
end
assert_redirected_to 'projects/ecookbook/issues'
end
+
+ def test_copy_to_another_project_should_follow_when_needed
+ @request.session[:user_id] = 2
+ post :move, :ids => [1], :new_project_id => 2, :copy_options => {:copy => '1'}, :follow => '1'
+ issue = Issue.first(:order => 'id DESC')
+ assert_redirected_to :controller => 'issues', :action => 'show', :id => issue
+ end
def test_context_menu_one_issue
@request.session[:user_id] = 2