From be21a7a504f759836aac3260b1b5d180c1496444 Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Fri, 4 Dec 2015 10:57:53 +0100 Subject: [PATCH] update error message for bulk operations across multiple projects --- app/controllers/application_controller.rb | 9 --------- app/controllers/work_packages/moves_controller.rb | 9 +++++++++ config/locales/en.yml | 3 +++ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index c1fe5c9671..3b4cff1f18 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -396,15 +396,6 @@ class ApplicationController < ActionController::Base render_404 end - # Check if project is unique before bulk operations - def check_project_uniqueness - unless @project - # TODO: let users bulk edit/move/destroy issues from different projects - render_error 'Can not bulk edit/move/destroy issues from different projects' - return false - end - end - # Make sure that the user is a member of the project (or admin) if project is private # used as a before_filter for actions that do not require any particular permission # on the project. diff --git a/app/controllers/work_packages/moves_controller.rb b/app/controllers/work_packages/moves_controller.rb index a435943c3c..460c67a470 100644 --- a/app/controllers/work_packages/moves_controller.rb +++ b/app/controllers/work_packages/moves_controller.rb @@ -99,6 +99,15 @@ class WorkPackages::MovesController < ApplicationController private + # Check if project is unique before bulk operations + def check_project_uniqueness + unless @project + # TODO: let users bulk move/copy work packages from different projects + render_error I18n.t('work_packages.move.unsupported_for_multiple_projects') + return false + end + end + def prepare_for_work_package_move @work_packages = @work_packages.sort @copy = params.has_key? :copy diff --git a/config/locales/en.yml b/config/locales/en.yml index 7ed0bee8b2..79389fda0c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -142,6 +142,9 @@ en: no_results_title_text: There are currently no workflows. work_packages: + move: + unsupported_for_multiple_projects: 'Bulk move/copy is not supported for work packages from multiple projects' + list_simple: assigned: no_results_title_text: There are currently no work packages assigned to me.