From a925435b294331079b65e96d2480bb99d1c6f109 Mon Sep 17 00:00:00 2001
From: Jean-Philippe Lang <jp_lang@yahoo.fr>
Date: Tue, 27 Apr 2010 17:54:27 +0000
Subject: [PATCH] Add "Check/Unckeck all" buttons to rows and columns on
 workflow edit screen (#3201).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3694 e93f8b46-1217-0410-a6f0-8f06a7374b81
---
 app/views/workflows/edit.rhtml | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/app/views/workflows/edit.rhtml b/app/views/workflows/edit.rhtml
index e1862a6d7..26f2cf96c 100644
--- a/app/views/workflows/edit.rhtml
+++ b/app/views/workflows/edit.rhtml
@@ -35,18 +35,28 @@
 	<tr>
 		<td></td>
 		<% for new_status in @statuses %>
-		<td width="<%= 75 / @statuses.size %>%" align="center"><%= new_status.name %></td>
+		<td width="<%= 75 / @statuses.size %>%" align="center">
+			<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.new-status-#{new_status.id}')",
+	                                              			:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
+			<%= new_status.name %>
+		</td>
 		<% end %>
 	</tr>
 </thead>
 <tbody>
 	<% for old_status in @statuses %>
 	<tr class="<%= cycle("odd", "even") %>">
-		<td><%= old_status.name %></td>
+		<td>
+			<%= link_to_function(image_tag('toggle_check.png'), "toggleCheckboxesBySelector('input.old-status-#{old_status.id}')",
+			                                              			:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}") %>
+			
+			<%= old_status.name %>
+		</td>
 		<% new_status_ids_allowed = old_status.find_new_statuses_allowed_to([@role], @tracker).collect(&:id) -%>
 		<% for new_status in @statuses -%>
 		<td align="center">
-			<%= check_box_tag "issue_status[#{ old_status.id }][]", new_status.id, new_status_ids_allowed.include?(new_status.id) %>			
+			<%= check_box_tag "issue_status[#{ old_status.id }][]", new_status.id, new_status_ids_allowed.include?(new_status.id),
+						:class => "old-status-#{old_status.id} new-status-#{new_status.id}" %>			
 		</td>
 		<% end -%>
 	</tr>
-- 
GitLab