summaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-09 19:07:19 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-10-09 19:07:19 +0000
commit2c4647f8c6d23c999ae959a047104eef49d00993 (patch)
treefa1241406a68d951ded62d04269d85dfb6883a2c /app/controllers
parentdf631e8c06d755fd673e4bbf072a7e15766d1e0c (diff)
downloadredmine-2c4647f8c6d23c999ae959a047104eef49d00993.tar.gz
redmine-2c4647f8c6d23c999ae959a047104eef49d00993.zip
Added 'Bulk edit' functionality.
This can be done by clicking on the edit link (little pen icon) at the upper-left corner of the issue list. Most properties can be set (priority, assignee, category, fixed version, start and due dates, done ratio) and a note can be entered. Only issues of the current project can be selected for bulk edit (subproject issues can't). git-svn-id: http://redmine.rubyforge.org/svn/trunk@817 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects_controller.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb
index cf1325518..13253939a 100644
--- a/app/controllers/projects_controller.rb
+++ b/app/controllers/projects_controller.rb
@@ -336,6 +336,36 @@ class ProjectsController < ApplicationController
@options_for_rfpdf[:file_name] = "export.pdf"
render :layout => false
end
+
+ # Bulk edit issues
+ def bulk_edit_issues
+ if request.post?
+ priority = Enumeration.find_by_id(params[:priority_id])
+ assigned_to = User.find_by_id(params[:assigned_to_id])
+ issues = @project.issues.find_all_by_id(params[:issue_ids])
+ unsaved_issue_ids = []
+ issues.each do |issue|
+ issue.init_journal(User.current, params[:notes])
+ issue.priority = priority if priority
+ issue.assigned_to = assigned_to if assigned_to
+ issue.start_date = params[:start_date] unless params[:start_date].blank?
+ issue.due_date = params[:due_date] unless params[:due_date].blank?
+ issue.done_ratio = params[:done_ratio] unless params[:done_ratio].blank?
+ unsaved_issue_ids << issue.id unless issue.save
+ end
+ if unsaved_issue_ids.empty?
+ flash[:notice] = l(:notice_successful_update) unless issues.empty?
+ else
+ flash[:error] = l(:notice_failed_to_save_issues, unsaved_issue_ids.size, issues.size, '#' + unsaved_issue_ids.join(', #'))
+ end
+ redirect_to :action => 'list_issues', :id => @project
+ return
+ end
+ render :update do |page|
+ page.hide 'query_form'
+ page.replace_html 'bulk-edit', :partial => 'issues/bulk_edit_form'
+ end
+ end
def move_issues
@issues = @project.issues.find(params[:issue_ids]) if params[:issue_ids]