summaryrefslogtreecommitdiffstats
path: root/redmine
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2006-10-15 14:33:04 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2006-10-15 14:33:04 +0000
commite4d4a12c6a8a5507600b50e08c96da99789490ec (patch)
tree027fe9af010016faa67d06768f1ca8eb481feb80 /redmine
parent4a1cfb3df94bf378dab357f3f05298038e0075df (diff)
downloadredmine-e4d4a12c6a8a5507600b50e08c96da99789490ec.tar.gz
redmine-e4d4a12c6a8a5507600b50e08c96da99789490ec.zip
git-svn-id: http://redmine.rubyforge.org/svn/trunk@32 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'redmine')
-rw-r--r--redmine/app/controllers/projects_controller.rb24
-rw-r--r--redmine/app/models/issue.rb2
-rw-r--r--redmine/app/views/issues/show.rhtml8
-rw-r--r--redmine/app/views/projects/add_issue.rhtml2
-rw-r--r--redmine/app/views/projects/list_issues.rhtml17
-rw-r--r--redmine/app/views/projects/move_issues.rhtml24
-rw-r--r--redmine/db/migrate/002_issue_move.rb9
-rw-r--r--redmine/lang/de.yml1
-rw-r--r--redmine/lang/en.yml7
-rw-r--r--redmine/lang/es.yml1
-rw-r--r--redmine/lang/fr.yml1
11 files changed, 86 insertions, 10 deletions
diff --git a/redmine/app/controllers/projects_controller.rb b/redmine/app/controllers/projects_controller.rb
index 802573054..8343c7a5f 100644
--- a/redmine/app/controllers/projects_controller.rb
+++ b/redmine/app/controllers/projects_controller.rb
@@ -239,6 +239,30 @@ class ProjectsController < ApplicationController
:filename => 'export.csv')
end
+ def move_issues
+ @issues = @project.issues.find(params[:issue_ids]) if params[:issue_ids]
+ redirect_to :action => 'list_issues', :id => @project and return unless @issues
+ @projects = []
+ # find projects to which the user is allowed to move the issue
+ @logged_in_user.memberships.each {|m| @projects << m.project if Permission.allowed_to_role("projects/move_issues", m.role_id)}
+ # issue can be moved to any tracker
+ @trackers = Tracker.find(:all)
+ if request.post? and params[:new_project_id] and params[:new_tracker_id]
+ new_project = Project.find(params[:new_project_id])
+ new_tracker = Tracker.find(params[:new_tracker_id])
+ @issues.each { |i|
+ # category is project dependent
+ i.category = nil unless i.project_id == new_project.id
+ # move the issue
+ i.project = new_project
+ i.tracker = new_tracker
+ i.save
+ }
+ flash[:notice] = l(:notice_successful_update)
+ redirect_to :action => 'list_issues', :id => @project
+ end
+ end
+
# Add a news to @project
def add_news
@news = News.new(:project => @project)
diff --git a/redmine/app/models/issue.rb b/redmine/app/models/issue.rb
index 7b48182c7..489dad885 100644
--- a/redmine/app/models/issue.rb
+++ b/redmine/app/models/issue.rb
@@ -41,7 +41,7 @@ class Issue < ActiveRecord::Base
end
def validate
- if self.due_date.nil? && !@attributes['due_date'].empty?
+ if self.due_date.nil? && @attributes['due_date'] && !@attributes['due_date'].empty?
errors.add :due_date, :activerecord_error_not_a_date
end
end
diff --git a/redmine/app/views/issues/show.rhtml b/redmine/app/views/issues/show.rhtml
index fc48e47a1..1258a050c 100644
--- a/redmine/app/views/issues/show.rhtml
+++ b/redmine/app/views/issues/show.rhtml
@@ -35,6 +35,14 @@
&nbsp;&nbsp;
<% end %>
+<% if authorize_for('projects', 'move_issues') %>
+ <%= start_form_tag ({:controller => 'projects', :action => 'move_issues', :id => @project} ) %>
+ <%= hidden_field_tag "issue_ids[]", @issue.id %>
+ <%= submit_tag l(:button_move) %>
+ <%= end_form_tag %>
+ &nbsp;&nbsp;
+<% end %>
+
<% if authorize_for('issues', 'destroy') %>
<%= start_form_tag ({:controller => 'issues', :action => 'destroy', :id => @issue} ) %>
<%= submit_tag l(:button_delete) %>
diff --git a/redmine/app/views/projects/add_issue.rhtml b/redmine/app/views/projects/add_issue.rhtml
index f12542b43..11e61d6b3 100644
--- a/redmine/app/views/projects/add_issue.rhtml
+++ b/redmine/app/views/projects/add_issue.rhtml
@@ -8,7 +8,7 @@
<p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p>
<p><%= f.select :assigned_to_id, (@issue.project.members.collect {|m| [m.name, m.user_id]}), :include_blank => true %></p>
-<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}) %></p>
+<p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %></p>
<p><%= f.text_field :subject, :size => 80, :required => true %></p>
<p><%= f.text_area :description, :cols => 60, :rows => 10, :required => true %></p>
<p><%= f.text_field :due_date, :size => 10 %><%= calendar_for('issue_due_date') %></p>
diff --git a/redmine/app/views/projects/list_issues.rhtml b/redmine/app/views/projects/list_issues.rhtml
index d18799acf..7a924b134 100644
--- a/redmine/app/views/projects/list_issues.rhtml
+++ b/redmine/app/views/projects/list_issues.rhtml
@@ -22,11 +22,15 @@
</tr>
</table>
&nbsp;
+
+<%= start_form_tag ({:controller => 'projects', :action => 'move_issues', :id => @project}, :id => 'issues_form' ) %>
<table class="listTableContent">
- <tr><td colspan="7" align="right">
- <small><%= link_to l(:label_export_csv), :action => 'export_issues_csv', :id => @project.id %></small>
- </td></tr>
- <tr class="ListHead">
+ <tr>
+ <td colspan="6" align="left"><small><%= check_all_links 'issues_form' %></small></td>
+ <td colspan="2" align="right"><small><%= link_to l(:label_export_csv), :action => 'export_issues_csv', :id => @project.id %></small></td>
+ </tr>
+ <tr class="ListHead">
+ <td></td>
<%= sort_header_tag('issues.id', :caption => '#') %>
<%= sort_header_tag('issue_statuses.name', :caption => l(:field_status)) %>
<%= sort_header_tag('issues.tracker_id', :caption => l(:field_tracker)) %>
@@ -37,6 +41,7 @@
</tr>
<% for issue in @issues %>
<tr bgcolor="#<%= issue.status.html_color %>">
+ <td width="15"><%= check_box_tag "issue_ids[]", issue.id %></td>
<td align="center"><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %></td>
<td align="center"><%= issue.status.name %></td>
<td align="center"><%= issue.tracker.name %></td>
@@ -50,4 +55,6 @@
<p>
<%= pagination_links_full @issue_pages %>
[ <%= @issue_pages.current.first_item %> - <%= @issue_pages.current.last_item %> / <%= @issue_count %> ]
-</p> \ No newline at end of file
+</p>
+<%= submit_tag l(:button_move) %>
+<%= end_form_tag %> \ No newline at end of file
diff --git a/redmine/app/views/projects/move_issues.rhtml b/redmine/app/views/projects/move_issues.rhtml
new file mode 100644
index 000000000..380d47fd5
--- /dev/null
+++ b/redmine/app/views/projects/move_issues.rhtml
@@ -0,0 +1,24 @@
+<h2><%=l(:button_move)%></h2>
+
+
+<%= start_form_tag({:action => 'move_issues', :id => @project}, :class => "tabular") %>
+
+<div class="box">
+<p><label><%= l(:label_issue_plural) %>:</label>
+<% for issue in @issues %>
+ <b><%= link_to issue.long_id, :controller => 'issues', :action => 'show', :id => issue %></b> - <%= issue.subject %>
+ <%= hidden_field_tag "issue_ids[]", issue.id %><br />
+<% end %>
+<i>(<%= @issues.length%> <%= lwr(:label_issue, @issues.length)%>)</i></p>
+
+&nbsp;
+
+<!--[form:issue]-->
+<p><label for="new_project_id"><%=l(:field_project)%></label>
+<%= select_tag "new_project_id", options_from_collection_for_select(@projects, "id", "name", @project.id) %></p>
+
+<p><label for="new_tracker_id"><%=l(:field_tracker)%></label>
+<%= select_tag "new_tracker_id", options_from_collection_for_select(@trackers, "id", "name") %></p>
+</div>
+<%= submit_tag l(:button_move) %>
+<%= end_form_tag %>
diff --git a/redmine/db/migrate/002_issue_move.rb b/redmine/db/migrate/002_issue_move.rb
new file mode 100644
index 000000000..61b8cd443
--- /dev/null
+++ b/redmine/db/migrate/002_issue_move.rb
@@ -0,0 +1,9 @@
+class IssueMove < ActiveRecord::Migration
+ def self.up
+ Permission.create :controller => "projects", :action => "move_issues", :description => "button_move", :sort => 1061, :mail_option => 1, :mail_enabled => 0
+ end
+
+ def self.down
+ Permission.find(:first, :conditions => ["controller=? and action=?", 'projects', 'move_issues']).destroy
+ end
+end
diff --git a/redmine/lang/de.yml b/redmine/lang/de.yml
index e7f44842d..c39d71035 100644
--- a/redmine/lang/de.yml
+++ b/redmine/lang/de.yml
@@ -259,6 +259,7 @@ button_unlock: Entriegeln
button_download: Fernzuladen
button_list: Aufzulisten
button_view: Siehe
+button_move: Bewegen
text_select_mail_notifications: Aktionen für die Mailbenachrichtigung aktiviert werden soll.
text_regexp_info: eg. ^[A-Z0-9]+$
diff --git a/redmine/lang/en.yml b/redmine/lang/en.yml
index c1dc27243..d4ef52b28 100644
--- a/redmine/lang/en.yml
+++ b/redmine/lang/en.yml
@@ -35,8 +35,8 @@ activerecord_error_not_a_date: is not a valid date
general_fmt_age: %d yr
general_fmt_age_plural: %d yrs
-general_fmt_date: %%b %%d, %%Y (%%a)
-general_fmt_datetime: %%b %%d, %%Y (%%a), %%I:%%M %%p
+general_fmt_date: %%m/%%d/%%Y
+general_fmt_datetime: %%m/%%d/%%Y %%I:%%M %%p
general_fmt_datetime_short: %%b %%d, %%I:%%M %%p
general_fmt_time: %%I:%%M %%p
general_text_No: 'No'
@@ -84,7 +84,7 @@ field_regexp: Regular expression
field_min_length: Minimum length
field_max_length: Maximum length
field_value: Value
-field_category: Catogory
+field_category: Category
field_title: Title
field_project: Project
field_issue: Issue
@@ -259,6 +259,7 @@ button_unlock: Unlock
button_download: Download
button_list: List
button_view: View
+button_move: Move
text_select_mail_notifications: Select actions for which mail notifications should be sent.
text_regexp_info: eg. ^[A-Z0-9]+$
diff --git a/redmine/lang/es.yml b/redmine/lang/es.yml
index d4a9edb84..acc71eca1 100644
--- a/redmine/lang/es.yml
+++ b/redmine/lang/es.yml
@@ -259,6 +259,7 @@ button_unlock: Desbloquear
button_download: Telecargar
button_list: Listar
button_view: Ver
+button_move: Mover
text_select_mail_notifications: Seleccionar las actividades que necesitan la activación de la notificación por mail.
text_regexp_info: eg. ^[A-Z0-9]+$
diff --git a/redmine/lang/fr.yml b/redmine/lang/fr.yml
index 8f04dc5eb..866f79af6 100644
--- a/redmine/lang/fr.yml
+++ b/redmine/lang/fr.yml
@@ -259,6 +259,7 @@ button_unlock: Déverrouiller
button_download: Télécharger
button_list: Lister
button_view: Voir
+button_move: Déplacer
text_select_mail_notifications: Sélectionner les actions pour lesquelles la notification par mail doit être activée.
text_regexp_info: ex. ^[A-Z0-9]+$