Project

General

Profile

Actions

Patch #5894

closed

Allow bulk status change

Added by Peter Höpfl over 14 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Category:
Issues
Target version:
-
Start date:
2010-07-16
Due date:
% Done:

0%

Estimated time:

Description

We run a big Redmine installation with more than 20000 tickets. What we are missing is the ability to change the status of several issues (especially closing issues) at once.

For Redmine version 0.9.4 I made a patch that makes this possible and now I would like to contribute this patch to all Redmine users.
Unfortunately I have no svn access to provide an official patch file. Also I don't know if my code (first Ruby code) is ok.

Here is what i did:

File app/controllers/issues_controller.rb, Line 412ff:

Old:
  def context_menu
    @issues = Issue.find_all_by_id(params[:ids], :include => :project)
    if (@issues.size == 1)
      @issue = @issues.first
      @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
    end
    projects = @issues.collect(&:project).compact.uniq
    @project = projects.first if projects.size == 1

    @can = {:edit => (@project && User.current.allowed_to?(:edit_issues, @project)),

New:

  def context_menu
    @issues = Issue.find_all_by_id(params[:ids], :include => :project)
    if (@issues.size == 1)
      @issue = @issues.first
      @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
    end
    projects = @issues.collect(&:project).compact.uniq
    @project = projects.first if projects.size == 1

#Patch HOE for context menue
    if (projects.size == 1)
      @issue = @issues.first
      @allowed_statuses = @issue.new_statuses_allowed_to(User.current)
    end
#End Patch HOE for context menue

    @can = {:edit => (@project && User.current.allowed_to?(:edit_issues, @project)),


File app/views/issues/context_menu.rhtml, Line 10ff:

Old:
                <% @statuses.each do |s| -%>
                    <li><%= context_menu_link s.name, {:controller => 'issues', :action => 'edit', :id => @issue, :issue => {:status_id => s}, :back_url => @back}, :method => :post,
                                              :selected => (s == @issue.status), :disabled => !(@can[:update] && @allowed_statuses.include?(s)) %></li>
                <% end -%>

New:

                <% @statuses.each do |s| -%>
                    <li><%= context_menu_link s.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'status_id' => s, :back_url => @back}, :method => :post,
                                              :selected => (s == @issue.status), :disabled => !(@can[:update] && @allowed_statuses.include?(s)) %></li>
                <% end -%>

It would be great if you would integrate this code into Redmine.

Thanks,

Peter


Related issues

Related to Redmine - Defect #5892: Changing status from contextual menu opens the ticket insteadClosed2010-07-16

Actions
Actions

Also available in: Atom PDF