@@ -0,0 +1,9 | |||||
|
1 | class AddVersionsStatus < ActiveRecord::Migration | |||
|
2 | def self.up | |||
|
3 | add_column :versions, :status, :string, :default => 'open' | |||
|
4 | end | |||
|
5 | ||||
|
6 | def self.down | |||
|
7 | remove_column :versions, :status | |||
|
8 | end | |||
|
9 | end |
@@ -143,6 +143,14 class Issue < ActiveRecord::Base | |||||
143 | if start_date && soonest_start && start_date < soonest_start |
|
143 | if start_date && soonest_start && start_date < soonest_start | |
144 | errors.add :start_date, :invalid |
|
144 | errors.add :start_date, :invalid | |
145 | end |
|
145 | end | |
|
146 | ||||
|
147 | if fixed_version | |||
|
148 | if !assignable_versions.include?(fixed_version) | |||
|
149 | errors.add :fixed_version_id, :inclusion | |||
|
150 | elsif reopened? && fixed_version.closed? | |||
|
151 | errors.add_to_base I18n.t(:error_can_not_reopen_issue_on_closed_version) | |||
|
152 | end | |||
|
153 | end | |||
146 | end |
|
154 | end | |
147 |
|
155 | |||
148 | def validate_on_create |
|
156 | def validate_on_create | |
@@ -193,6 +201,18 class Issue < ActiveRecord::Base | |||||
193 | self.status.is_closed? |
|
201 | self.status.is_closed? | |
194 | end |
|
202 | end | |
195 |
|
203 | |||
|
204 | # Return true if the issue is being reopened | |||
|
205 | def reopened? | |||
|
206 | if !new_record? && status_id_changed? | |||
|
207 | status_was = IssueStatus.find_by_id(status_id_was) | |||
|
208 | status_new = IssueStatus.find_by_id(status_id) | |||
|
209 | if status_was && status_new && status_was.is_closed? && !status_new.is_closed? | |||
|
210 | return true | |||
|
211 | end | |||
|
212 | end | |||
|
213 | false | |||
|
214 | end | |||
|
215 | ||||
196 | # Returns true if the issue is overdue |
|
216 | # Returns true if the issue is overdue | |
197 | def overdue? |
|
217 | def overdue? | |
198 | !due_date.nil? && (due_date < Date.today) && !status.is_closed? |
|
218 | !due_date.nil? && (due_date < Date.today) && !status.is_closed? | |
@@ -203,6 +223,11 class Issue < ActiveRecord::Base | |||||
203 | project.assignable_users |
|
223 | project.assignable_users | |
204 | end |
|
224 | end | |
205 |
|
225 | |||
|
226 | # Versions that the issue can be assigned to | |||
|
227 | def assignable_versions | |||
|
228 | @assignable_versions ||= (project.versions.open + [Version.find_by_id(fixed_version_id_was)]).compact.uniq.sort | |||
|
229 | end | |||
|
230 | ||||
206 | # Returns true if this issue is blocked by another issue that is still open |
|
231 | # Returns true if this issue is blocked by another issue that is still open | |
207 | def blocked? |
|
232 | def blocked? | |
208 | !relations_to.detect {|ir| ir.relation_type == 'blocks' && !ir.issue_from.closed?}.nil? |
|
233 | !relations_to.detect {|ir| ir.relation_type == 'blocks' && !ir.issue_from.closed?}.nil? |
@@ -22,11 +22,16 class Version < ActiveRecord::Base | |||||
22 | acts_as_attachable :view_permission => :view_files, |
|
22 | acts_as_attachable :view_permission => :view_files, | |
23 | :delete_permission => :manage_files |
|
23 | :delete_permission => :manage_files | |
24 |
|
24 | |||
|
25 | VERSION_STATUSES = %w(open locked closed) | |||
|
26 | ||||
25 | validates_presence_of :name |
|
27 | validates_presence_of :name | |
26 | validates_uniqueness_of :name, :scope => [:project_id] |
|
28 | validates_uniqueness_of :name, :scope => [:project_id] | |
27 | validates_length_of :name, :maximum => 60 |
|
29 | validates_length_of :name, :maximum => 60 | |
28 | validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :not_a_date, :allow_nil => true |
|
30 | validates_format_of :effective_date, :with => /^\d{4}-\d{2}-\d{2}$/, :message => :not_a_date, :allow_nil => true | |
29 |
|
31 | validates_inclusion_of :status, :in => VERSION_STATUSES | ||
|
32 | ||||
|
33 | named_scope :open, :conditions => {:status => 'open'} | |||
|
34 | ||||
30 | def start_date |
|
35 | def start_date | |
31 | effective_date |
|
36 | effective_date | |
32 | end |
|
37 | end | |
@@ -45,6 +50,10 class Version < ActiveRecord::Base | |||||
45 | @spent_hours ||= TimeEntry.sum(:hours, :include => :issue, :conditions => ["#{Issue.table_name}.fixed_version_id = ?", id]).to_f |
|
50 | @spent_hours ||= TimeEntry.sum(:hours, :include => :issue, :conditions => ["#{Issue.table_name}.fixed_version_id = ?", id]).to_f | |
46 | end |
|
51 | end | |
47 |
|
52 | |||
|
53 | def closed? | |||
|
54 | status == 'closed' | |||
|
55 | end | |||
|
56 | ||||
48 | # Returns true if the version is completed: due date reached and no open issues |
|
57 | # Returns true if the version is completed: due date reached and no open issues | |
49 | def completed? |
|
58 | def completed? | |
50 | effective_date && (effective_date <= Date.today) && (open_issues_count == 0) |
|
59 | effective_date && (effective_date <= Date.today) && (open_issues_count == 0) |
@@ -32,9 +32,9 | |||||
32 | {:controller => 'projects', :action => 'add_issue_category', :id => @project}, |
|
32 | {:controller => 'projects', :action => 'add_issue_category', :id => @project}, | |
33 | :class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p> |
|
33 | :class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p> | |
34 | <% end %> |
|
34 | <% end %> | |
35 | <%= content_tag('p', f.select(:fixed_version_id, |
|
35 | <% unless @issue.assignable_versions.empty? %> | |
36 | (@project.versions.sort.collect {|v| [v.name, v.id]}), |
|
36 | <p><%= f.select :fixed_version_id, (@issue.assignable_versions.collect {|v| [v.name, v.id]}), :include_blank => true %></p> | |
37 | { :include_blank => true })) unless @project.versions.empty? %> |
|
37 | <% end %> | |
38 | </div> |
|
38 | </div> | |
39 |
|
39 | |||
40 | <div class="splitcontentright"> |
|
40 | <div class="splitcontentright"> |
@@ -5,8 +5,8 | |||||
5 | </div> |
|
5 | </div> | |
6 | <div class="splitcontentright"> |
|
6 | <div class="splitcontentright"> | |
7 | <p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %></p> |
|
7 | <p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %></p> | |
8 | <%= content_tag('p', f.select(:fixed_version_id, |
|
8 | <% unless @issue.assignable_versions.empty? %> | |
9 | (@project.versions.sort.collect {|v| [v.name, v.id]}), |
|
9 | <p><%= f.select :fixed_version_id, (@issue.assignable_versions.collect {|v| [v.name, v.id]}), :include_blank => true %></p> | |
10 | { :include_blank => true })) unless @project.versions.empty? %> |
|
10 | <% end %> | |
11 | </div> |
|
11 | </div> | |
12 | </div> |
|
12 | </div> |
@@ -27,7 +27,7 | |||||
27 | <label><%= l(:field_fixed_version) %>: |
|
27 | <label><%= l(:field_fixed_version) %>: | |
28 | <%= select_tag('fixed_version_id', content_tag('option', l(:label_no_change_option), :value => '') + |
|
28 | <%= select_tag('fixed_version_id', content_tag('option', l(:label_no_change_option), :value => '') + | |
29 | content_tag('option', l(:label_none), :value => 'none') + |
|
29 | content_tag('option', l(:label_none), :value => 'none') + | |
30 | options_from_collection_for_select(@project.versions.sort, :id, :name)) %></label> |
|
30 | options_from_collection_for_select(@project.versions.open.sort, :id, :name)) %></label> | |
31 | </p> |
|
31 | </p> | |
32 |
|
32 | |||
33 | <p> |
|
33 | <p> |
@@ -27,11 +27,11 | |||||
27 | <% end -%> |
|
27 | <% end -%> | |
28 | </ul> |
|
28 | </ul> | |
29 | </li> |
|
29 | </li> | |
30 | <% unless @project.nil? || @project.versions.empty? -%> |
|
30 | <% unless @project.nil? || @project.versions.open.empty? -%> | |
31 | <li class="folder"> |
|
31 | <li class="folder"> | |
32 | <a href="#" class="submenu"><%= l(:field_fixed_version) %></a> |
|
32 | <a href="#" class="submenu"><%= l(:field_fixed_version) %></a> | |
33 | <ul> |
|
33 | <ul> | |
34 | <% @project.versions.sort.each do |v| -%> |
|
34 | <% @project.versions.open.sort.each do |v| -%> | |
35 | <li><%= context_menu_link v.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'fixed_version_id' => v, :back_to => @back}, :method => :post, |
|
35 | <li><%= context_menu_link v.name, {:controller => 'issues', :action => 'bulk_edit', :ids => @issues.collect(&:id), 'fixed_version_id' => v, :back_to => @back}, :method => :post, | |
36 | :selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li> |
|
36 | :selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li> | |
37 | <% end -%> |
|
37 | <% end -%> |
@@ -1,22 +1,25 | |||||
1 | <% if @project.versions.any? %> |
|
1 | <% if @project.versions.any? %> | |
2 | <table class="list"> |
|
2 | <table class="list versions"> | |
3 | <thead> |
|
3 | <thead> | |
4 | <th><%= l(:label_version) %></th> |
|
4 | <th><%= l(:label_version) %></th> | |
5 | <th><%= l(:field_effective_date) %></th> |
|
5 | <th><%= l(:field_effective_date) %></th> | |
6 | <th><%= l(:field_description) %></th> |
|
6 | <th><%= l(:field_description) %></th> | |
|
7 | <th><%= l(:field_status) %></th> | |||
7 | <th><%= l(:label_wiki_page) unless @project.wiki.nil? %></th> |
|
8 | <th><%= l(:label_wiki_page) unless @project.wiki.nil? %></th> | |
8 | <th style="width:15%"></th> |
|
9 | <th style="width:15%"></th> | |
9 | <th style="width:15%"></th> |
|
|||
10 | </thead> |
|
10 | </thead> | |
11 | <tbody> |
|
11 | <tbody> | |
12 | <% for version in @project.versions.sort %> |
|
12 | <% for version in @project.versions.sort %> | |
13 | <tr class="<%= cycle 'odd', 'even' %>"> |
|
13 | <tr class="version <%= cycle 'odd', 'even' %> <%=h version.status %>"> | |
14 | <td><%= link_to h(version.name), :controller => 'versions', :action => 'show', :id => version %></td> |
|
14 | <td><%= link_to h(version.name), :controller => 'versions', :action => 'show', :id => version %></td> | |
15 | <td align="center"><%= format_date(version.effective_date) %></td> |
|
15 | <td align="center"><%= format_date(version.effective_date) %></td> | |
16 | <td><%=h version.description %></td> |
|
16 | <td><%=h version.description %></td> | |
|
17 | <td><%= l("version_status_#{version.status}") %></td> | |||
17 | <td><%= link_to(h(version.wiki_page_title), :controller => 'wiki', :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %></td> |
|
18 | <td><%= link_to(h(version.wiki_page_title), :controller => 'wiki', :page => Wiki.titleize(version.wiki_page_title)) unless version.wiki_page_title.blank? || @project.wiki.nil? %></td> | |
18 | <td align="center"><%= link_to_if_authorized l(:button_edit), { :controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %></td> |
|
19 | <td class="buttons"> | |
19 |
|
|
20 | <%= link_to_if_authorized l(:button_edit), {:controller => 'versions', :action => 'edit', :id => version }, :class => 'icon icon-edit' %> | |
|
21 | <%= link_to_if_authorized l(:button_delete), {:controller => 'versions', :action => 'destroy', :id => version}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> | |||
|
22 | </td> | |||
20 | </tr> |
|
23 | </tr> | |
21 | <% end; reset_cycle %> |
|
24 | <% end; reset_cycle %> | |
22 | </tbody> |
|
25 | </tbody> |
@@ -3,6 +3,7 | |||||
3 | <div class="box"> |
|
3 | <div class="box"> | |
4 | <p><%= f.text_field :name, :size => 60, :required => true %></p> |
|
4 | <p><%= f.text_field :name, :size => 60, :required => true %></p> | |
5 | <p><%= f.text_field :description, :size => 60 %></p> |
|
5 | <p><%= f.text_field :description, :size => 60 %></p> | |
|
6 | <p><%= f.select :status, Version::VERSION_STATUSES.collect {|s| [l("version_status_#{s}"), s]} %></p> | |||
6 | <p><%= f.text_field :wiki_page_title, :label => :label_wiki_page, :size => 60, :disabled => @project.wiki.nil? %></p> |
|
7 | <p><%= f.text_field :wiki_page_title, :label => :label_wiki_page, :size => 60, :disabled => @project.wiki.nil? %></p> | |
7 | <p><%= f.text_field :effective_date, :size => 10 %><%= calendar_for('version_effective_date') %></p> |
|
8 | <p><%= f.text_field :effective_date, :size => 10 %><%= calendar_for('version_effective_date') %></p> | |
8 | </div> |
|
9 | </div> |
@@ -827,3 +827,7 bg: | |||||
827 | field_active: Active |
|
827 | field_active: Active | |
828 | enumeration_system_activity: System Activity |
|
828 | enumeration_system_activity: System Activity | |
829 | permission_delete_issue_watchers: Delete watchers |
|
829 | permission_delete_issue_watchers: Delete watchers | |
|
830 | version_status_closed: closed | |||
|
831 | version_status_locked: locked | |||
|
832 | version_status_open: open | |||
|
833 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -851,3 +851,7 bs: | |||||
851 | field_active: Active |
|
851 | field_active: Active | |
852 | enumeration_system_activity: System Activity |
|
852 | enumeration_system_activity: System Activity | |
853 | permission_delete_issue_watchers: Delete watchers |
|
853 | permission_delete_issue_watchers: Delete watchers | |
|
854 | version_status_closed: closed | |||
|
855 | version_status_locked: locked | |||
|
856 | version_status_open: open | |||
|
857 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -830,3 +830,7 ca: | |||||
830 | field_active: Active |
|
830 | field_active: Active | |
831 | enumeration_system_activity: System Activity |
|
831 | enumeration_system_activity: System Activity | |
832 | permission_delete_issue_watchers: Delete watchers |
|
832 | permission_delete_issue_watchers: Delete watchers | |
|
833 | version_status_closed: closed | |||
|
834 | version_status_locked: locked | |||
|
835 | version_status_open: open | |||
|
836 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -833,3 +833,7 cs: | |||||
833 | field_active: Active |
|
833 | field_active: Active | |
834 | enumeration_system_activity: System Activity |
|
834 | enumeration_system_activity: System Activity | |
835 | permission_delete_issue_watchers: Delete watchers |
|
835 | permission_delete_issue_watchers: Delete watchers | |
|
836 | version_status_closed: closed | |||
|
837 | version_status_locked: locked | |||
|
838 | version_status_open: open | |||
|
839 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -853,3 +853,7 da: | |||||
853 | field_active: Active |
|
853 | field_active: Active | |
854 | enumeration_system_activity: System Activity |
|
854 | enumeration_system_activity: System Activity | |
855 | permission_delete_issue_watchers: Delete watchers |
|
855 | permission_delete_issue_watchers: Delete watchers | |
|
856 | version_status_closed: closed | |||
|
857 | version_status_locked: locked | |||
|
858 | version_status_open: open | |||
|
859 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -853,3 +853,7 de: | |||||
853 | field_active: Active |
|
853 | field_active: Active | |
854 | enumeration_system_activity: System Activity |
|
854 | enumeration_system_activity: System Activity | |
855 | permission_delete_issue_watchers: Delete watchers |
|
855 | permission_delete_issue_watchers: Delete watchers | |
|
856 | version_status_closed: closed | |||
|
857 | version_status_locked: locked | |||
|
858 | version_status_open: open | |||
|
859 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -833,3 +833,7 el: | |||||
833 | field_active: Active |
|
833 | field_active: Active | |
834 | enumeration_system_activity: System Activity |
|
834 | enumeration_system_activity: System Activity | |
835 | permission_delete_issue_watchers: Delete watchers |
|
835 | permission_delete_issue_watchers: Delete watchers | |
|
836 | version_status_closed: closed | |||
|
837 | version_status_locked: locked | |||
|
838 | version_status_open: open | |||
|
839 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -155,6 +155,7 en: | |||||
155 | error_issue_not_found_in_project: 'The issue was not found or does not belong to this project' |
|
155 | error_issue_not_found_in_project: 'The issue was not found or does not belong to this project' | |
156 | error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.' |
|
156 | error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.' | |
157 | error_no_default_issue_status: 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").' |
|
157 | error_no_default_issue_status: 'No default issue status is defined. Please check your configuration (Go to "Administration -> Issue statuses").' | |
|
158 | error_can_not_reopen_issue_on_closed_version: 'An issue assigned to a closed version can not be reopened' | |||
158 |
|
159 | |||
159 | warning_attachments_not_saved: "{{count}} file(s) could not be saved." |
|
160 | warning_attachments_not_saved: "{{count}} file(s) could not be saved." | |
160 |
|
161 | |||
@@ -749,6 +750,10 en: | |||||
749 | status_active: active |
|
750 | status_active: active | |
750 | status_registered: registered |
|
751 | status_registered: registered | |
751 | status_locked: locked |
|
752 | status_locked: locked | |
|
753 | ||||
|
754 | version_status_open: open | |||
|
755 | version_status_locked: locked | |||
|
756 | version_status_closed: closed | |||
752 |
|
757 | |||
753 | field_active: Active |
|
758 | field_active: Active | |
754 |
|
759 |
@@ -874,3 +874,7 es: | |||||
874 | field_active: Active |
|
874 | field_active: Active | |
875 | enumeration_system_activity: System Activity |
|
875 | enumeration_system_activity: System Activity | |
876 | permission_delete_issue_watchers: Delete watchers |
|
876 | permission_delete_issue_watchers: Delete watchers | |
|
877 | version_status_closed: closed | |||
|
878 | version_status_locked: locked | |||
|
879 | version_status_open: open | |||
|
880 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -863,3 +863,7 fi: | |||||
863 | field_active: Active |
|
863 | field_active: Active | |
864 | enumeration_system_activity: System Activity |
|
864 | enumeration_system_activity: System Activity | |
865 | permission_delete_issue_watchers: Delete watchers |
|
865 | permission_delete_issue_watchers: Delete watchers | |
|
866 | version_status_closed: closed | |||
|
867 | version_status_locked: locked | |||
|
868 | version_status_open: open | |||
|
869 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -177,6 +177,7 fr: | |||||
177 | error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt: {{value}}" |
|
177 | error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt: {{value}}" | |
178 | error_scm_annotate: "L'entrΓ©e n'existe pas ou ne peut pas Γͺtre annotΓ©e." |
|
178 | error_scm_annotate: "L'entrΓ©e n'existe pas ou ne peut pas Γͺtre annotΓ©e." | |
179 | error_issue_not_found_in_project: "La demande n'existe pas ou n'appartient pas Γ ce projet" |
|
179 | error_issue_not_found_in_project: "La demande n'existe pas ou n'appartient pas Γ ce projet" | |
|
180 | error_can_not_reopen_issue_on_closed_version: 'Une demande assignΓ©e Γ une version fermΓ©e ne peut pas Γͺtre rΓ©ouverte' | |||
180 |
|
181 | |||
181 | warning_attachments_not_saved: "{{count}} fichier(s) n'ont pas pu Γͺtre sauvegardΓ©s." |
|
182 | warning_attachments_not_saved: "{{count}} fichier(s) n'ont pas pu Γͺtre sauvegardΓ©s." | |
182 |
|
183 | |||
@@ -767,6 +768,10 fr: | |||||
767 | status_registered: enregistrΓ© |
|
768 | status_registered: enregistrΓ© | |
768 | status_locked: vΓ©rouillΓ© |
|
769 | status_locked: vΓ©rouillΓ© | |
769 |
|
770 | |||
|
771 | version_status_open: ouvert | |||
|
772 | version_status_locked: vΓ©rouillΓ© | |||
|
773 | version_status_closed: fermΓ© | |||
|
774 | ||||
770 | text_select_mail_notifications: Actions pour lesquelles une notification par e-mail est envoyΓ©e |
|
775 | text_select_mail_notifications: Actions pour lesquelles une notification par e-mail est envoyΓ©e | |
771 | text_regexp_info: ex. ^[A-Z0-9]+$ |
|
776 | text_regexp_info: ex. ^[A-Z0-9]+$ | |
772 | text_min_max_length_info: 0 pour aucune restriction |
|
777 | text_min_max_length_info: 0 pour aucune restriction |
@@ -853,3 +853,7 gl: | |||||
853 | field_active: Active |
|
853 | field_active: Active | |
854 | enumeration_system_activity: System Activity |
|
854 | enumeration_system_activity: System Activity | |
855 | permission_delete_issue_watchers: Delete watchers |
|
855 | permission_delete_issue_watchers: Delete watchers | |
|
856 | version_status_closed: closed | |||
|
857 | version_status_locked: locked | |||
|
858 | version_status_open: open | |||
|
859 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -837,3 +837,7 he: | |||||
837 | field_active: Active |
|
837 | field_active: Active | |
838 | enumeration_system_activity: System Activity |
|
838 | enumeration_system_activity: System Activity | |
839 | permission_delete_issue_watchers: Delete watchers |
|
839 | permission_delete_issue_watchers: Delete watchers | |
|
840 | version_status_closed: closed | |||
|
841 | version_status_locked: locked | |||
|
842 | version_status_open: open | |||
|
843 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -858,3 +858,7 | |||||
858 | field_active: Active |
|
858 | field_active: Active | |
859 | enumeration_system_activity: System Activity |
|
859 | enumeration_system_activity: System Activity | |
860 | permission_delete_issue_watchers: Delete watchers |
|
860 | permission_delete_issue_watchers: Delete watchers | |
|
861 | version_status_closed: closed | |||
|
862 | version_status_locked: locked | |||
|
863 | version_status_open: open | |||
|
864 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -840,3 +840,7 it: | |||||
840 | field_active: Active |
|
840 | field_active: Active | |
841 | enumeration_system_activity: System Activity |
|
841 | enumeration_system_activity: System Activity | |
842 | permission_delete_issue_watchers: Delete watchers |
|
842 | permission_delete_issue_watchers: Delete watchers | |
|
843 | version_status_closed: closed | |||
|
844 | version_status_locked: locked | |||
|
845 | version_status_open: open | |||
|
846 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -862,3 +862,7 ja: | |||||
862 | field_active: Active |
|
862 | field_active: Active | |
863 | enumeration_system_activity: System Activity |
|
863 | enumeration_system_activity: System Activity | |
864 | permission_delete_issue_watchers: Delete watchers |
|
864 | permission_delete_issue_watchers: Delete watchers | |
|
865 | version_status_closed: closed | |||
|
866 | version_status_locked: locked | |||
|
867 | version_status_open: open | |||
|
868 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -893,3 +893,7 ko: | |||||
893 | field_active: Active |
|
893 | field_active: Active | |
894 | enumeration_system_activity: System Activity |
|
894 | enumeration_system_activity: System Activity | |
895 | permission_delete_issue_watchers: Delete watchers |
|
895 | permission_delete_issue_watchers: Delete watchers | |
|
896 | version_status_closed: closed | |||
|
897 | version_status_locked: locked | |||
|
898 | version_status_open: open | |||
|
899 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -863,3 +863,7 lt: | |||||
863 | field_active: Active |
|
863 | field_active: Active | |
864 | enumeration_system_activity: System Activity |
|
864 | enumeration_system_activity: System Activity | |
865 | permission_delete_issue_watchers: Delete watchers |
|
865 | permission_delete_issue_watchers: Delete watchers | |
|
866 | version_status_closed: closed | |||
|
867 | version_status_locked: locked | |||
|
868 | version_status_open: open | |||
|
869 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -815,3 +815,7 nl: | |||||
815 | field_active: Active |
|
815 | field_active: Active | |
816 | enumeration_system_activity: System Activity |
|
816 | enumeration_system_activity: System Activity | |
817 | permission_delete_issue_watchers: Delete watchers |
|
817 | permission_delete_issue_watchers: Delete watchers | |
|
818 | version_status_closed: closed | |||
|
819 | version_status_locked: locked | |||
|
820 | version_status_open: open | |||
|
821 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -828,3 +828,7 | |||||
828 | field_active: Active |
|
828 | field_active: Active | |
829 | enumeration_system_activity: System Activity |
|
829 | enumeration_system_activity: System Activity | |
830 | permission_delete_issue_watchers: Delete watchers |
|
830 | permission_delete_issue_watchers: Delete watchers | |
|
831 | version_status_closed: closed | |||
|
832 | version_status_locked: locked | |||
|
833 | version_status_open: open | |||
|
834 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -856,3 +856,7 pl: | |||||
856 | field_active: Aktywne |
|
856 | field_active: Aktywne | |
857 | enumeration_system_activity: AktywnoΕΔ Systemowa |
|
857 | enumeration_system_activity: AktywnoΕΔ Systemowa | |
858 | permission_delete_issue_watchers: Delete watchers |
|
858 | permission_delete_issue_watchers: Delete watchers | |
|
859 | version_status_closed: closed | |||
|
860 | version_status_locked: locked | |||
|
861 | version_status_open: open | |||
|
862 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -859,3 +859,7 pt-BR: | |||||
859 | field_active: Ativo |
|
859 | field_active: Ativo | |
860 | enumeration_system_activity: Atividade do sistema |
|
860 | enumeration_system_activity: Atividade do sistema | |
861 | permission_delete_issue_watchers: Deletar observadores |
|
861 | permission_delete_issue_watchers: Deletar observadores | |
|
862 | version_status_closed: closed | |||
|
863 | version_status_locked: locked | |||
|
864 | version_status_open: open | |||
|
865 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -845,3 +845,7 pt: | |||||
845 | field_active: Active |
|
845 | field_active: Active | |
846 | enumeration_system_activity: System Activity |
|
846 | enumeration_system_activity: System Activity | |
847 | permission_delete_issue_watchers: Delete watchers |
|
847 | permission_delete_issue_watchers: Delete watchers | |
|
848 | version_status_closed: closed | |||
|
849 | version_status_locked: locked | |||
|
850 | version_status_open: open | |||
|
851 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -830,3 +830,7 ro: | |||||
830 | field_active: Active |
|
830 | field_active: Active | |
831 | enumeration_system_activity: System Activity |
|
831 | enumeration_system_activity: System Activity | |
832 | permission_delete_issue_watchers: Delete watchers |
|
832 | permission_delete_issue_watchers: Delete watchers | |
|
833 | version_status_closed: closed | |||
|
834 | version_status_locked: locked | |||
|
835 | version_status_open: open | |||
|
836 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -941,3 +941,7 ru: | |||||
941 | field_active: Active |
|
941 | field_active: Active | |
942 | enumeration_system_activity: System Activity |
|
942 | enumeration_system_activity: System Activity | |
943 | permission_delete_issue_watchers: Delete watchers |
|
943 | permission_delete_issue_watchers: Delete watchers | |
|
944 | version_status_closed: closed | |||
|
945 | version_status_locked: locked | |||
|
946 | version_status_open: open | |||
|
947 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -832,3 +832,7 sk: | |||||
832 | field_active: Active |
|
832 | field_active: Active | |
833 | enumeration_system_activity: System Activity |
|
833 | enumeration_system_activity: System Activity | |
834 | permission_delete_issue_watchers: Delete watchers |
|
834 | permission_delete_issue_watchers: Delete watchers | |
|
835 | version_status_closed: closed | |||
|
836 | version_status_locked: locked | |||
|
837 | version_status_open: open | |||
|
838 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -829,3 +829,7 sl: | |||||
829 | field_active: Active |
|
829 | field_active: Active | |
830 | enumeration_system_activity: System Activity |
|
830 | enumeration_system_activity: System Activity | |
831 | permission_delete_issue_watchers: Delete watchers |
|
831 | permission_delete_issue_watchers: Delete watchers | |
|
832 | version_status_closed: closed | |||
|
833 | version_status_locked: locked | |||
|
834 | version_status_open: open | |||
|
835 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -848,3 +848,7 | |||||
848 | field_active: Active |
|
848 | field_active: Active | |
849 | enumeration_system_activity: System Activity |
|
849 | enumeration_system_activity: System Activity | |
850 | permission_delete_issue_watchers: Delete watchers |
|
850 | permission_delete_issue_watchers: Delete watchers | |
|
851 | version_status_closed: closed | |||
|
852 | version_status_locked: locked | |||
|
853 | version_status_open: open | |||
|
854 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -881,3 +881,7 sv: | |||||
881 | enumeration_doc_categories: Dokumentkategorier |
|
881 | enumeration_doc_categories: Dokumentkategorier | |
882 | enumeration_activities: Aktiviteter (tidsuppfΓΆljning) |
|
882 | enumeration_activities: Aktiviteter (tidsuppfΓΆljning) | |
883 | enumeration_system_activity: Systemaktivitet |
|
883 | enumeration_system_activity: Systemaktivitet | |
|
884 | version_status_closed: closed | |||
|
885 | version_status_locked: locked | |||
|
886 | version_status_open: open | |||
|
887 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -830,3 +830,7 th: | |||||
830 | field_active: Active |
|
830 | field_active: Active | |
831 | enumeration_system_activity: System Activity |
|
831 | enumeration_system_activity: System Activity | |
832 | permission_delete_issue_watchers: Delete watchers |
|
832 | permission_delete_issue_watchers: Delete watchers | |
|
833 | version_status_closed: closed | |||
|
834 | version_status_locked: locked | |||
|
835 | version_status_open: open | |||
|
836 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -860,3 +860,7 tr: | |||||
860 | field_active: Active |
|
860 | field_active: Active | |
861 | enumeration_system_activity: System Activity |
|
861 | enumeration_system_activity: System Activity | |
862 | permission_delete_issue_watchers: Delete watchers |
|
862 | permission_delete_issue_watchers: Delete watchers | |
|
863 | version_status_closed: closed | |||
|
864 | version_status_locked: locked | |||
|
865 | version_status_open: open | |||
|
866 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -829,3 +829,7 uk: | |||||
829 | field_active: Active |
|
829 | field_active: Active | |
830 | enumeration_system_activity: System Activity |
|
830 | enumeration_system_activity: System Activity | |
831 | permission_delete_issue_watchers: Delete watchers |
|
831 | permission_delete_issue_watchers: Delete watchers | |
|
832 | version_status_closed: closed | |||
|
833 | version_status_locked: locked | |||
|
834 | version_status_open: open | |||
|
835 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -892,3 +892,7 vi: | |||||
892 | field_active: Active |
|
892 | field_active: Active | |
893 | enumeration_system_activity: System Activity |
|
893 | enumeration_system_activity: System Activity | |
894 | permission_delete_issue_watchers: Delete watchers |
|
894 | permission_delete_issue_watchers: Delete watchers | |
|
895 | version_status_closed: closed | |||
|
896 | version_status_locked: locked | |||
|
897 | version_status_open: open | |||
|
898 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -923,3 +923,7 | |||||
923 | enumeration_doc_categories: ζδ»Άει‘ |
|
923 | enumeration_doc_categories: ζδ»Άει‘ | |
924 | enumeration_activities: ζ΄»ε (ζιθΏ½θΉ€) |
|
924 | enumeration_activities: ζ΄»ε (ζιθΏ½θΉ€) | |
925 | enumeration_system_activity: η³»η΅±ζ΄»ε |
|
925 | enumeration_system_activity: η³»η΅±ζ΄»ε | |
|
926 | version_status_closed: closed | |||
|
927 | version_status_locked: locked | |||
|
928 | version_status_open: open | |||
|
929 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -855,3 +855,7 zh: | |||||
855 | field_active: Active |
|
855 | field_active: Active | |
856 | enumeration_system_activity: System Activity |
|
856 | enumeration_system_activity: System Activity | |
857 | permission_delete_issue_watchers: Delete watchers |
|
857 | permission_delete_issue_watchers: Delete watchers | |
|
858 | version_status_closed: closed | |||
|
859 | version_status_locked: locked | |||
|
860 | version_status_open: open | |||
|
861 | error_can_not_reopen_issue_on_closed_version: An issue assigned to a closed version can not be reopened |
@@ -124,6 +124,8 tr.message td.last_message { font-size: 80%; } | |||||
124 | tr.message.locked td.subject a { background-image: url(../images/locked.png); } |
|
124 | tr.message.locked td.subject a { background-image: url(../images/locked.png); } | |
125 | tr.message.sticky td.subject a { background-image: url(../images/sticky.png); font-weight: bold; } |
|
125 | tr.message.sticky td.subject a { background-image: url(../images/sticky.png); font-weight: bold; } | |
126 |
|
126 | |||
|
127 | tr.version.closed, tr.version.closed a { color: #999; } | |||
|
128 | ||||
127 | tr.user td { width:13%; } |
|
129 | tr.user td { width:13%; } | |
128 | tr.user td.email { width:18%; } |
|
130 | tr.user td.email { width:18%; } | |
129 | tr.user td { white-space: nowrap; } |
|
131 | tr.user td { white-space: nowrap; } |
@@ -157,3 +157,35 issues_010: | |||||
157 | status_id: 1 |
|
157 | status_id: 1 | |
158 | start_date: <%= Date.today.to_s(:db) %> |
|
158 | start_date: <%= Date.today.to_s(:db) %> | |
159 | due_date: <%= 1.days.from_now.to_date.to_s(:db) %> |
|
159 | due_date: <%= 1.days.from_now.to_date.to_s(:db) %> | |
|
160 | issues_011: | |||
|
161 | created_on: <%= 3.days.ago.to_date.to_s(:db) %> | |||
|
162 | project_id: 1 | |||
|
163 | updated_on: <%= 1.day.ago.to_date.to_s(:db) %> | |||
|
164 | priority_id: 5 | |||
|
165 | subject: Closed issue on a closed version | |||
|
166 | id: 11 | |||
|
167 | fixed_version_id: 1 | |||
|
168 | category_id: 1 | |||
|
169 | description: | |||
|
170 | tracker_id: 1 | |||
|
171 | assigned_to_id: | |||
|
172 | author_id: 2 | |||
|
173 | status_id: 5 | |||
|
174 | start_date: <%= 1.day.ago.to_date.to_s(:db) %> | |||
|
175 | due_date: | |||
|
176 | issues_012: | |||
|
177 | created_on: <%= 3.days.ago.to_date.to_s(:db) %> | |||
|
178 | project_id: 1 | |||
|
179 | updated_on: <%= 1.day.ago.to_date.to_s(:db) %> | |||
|
180 | priority_id: 5 | |||
|
181 | subject: Closed issue on a locked version | |||
|
182 | id: 12 | |||
|
183 | fixed_version_id: 2 | |||
|
184 | category_id: 1 | |||
|
185 | description: | |||
|
186 | tracker_id: 1 | |||
|
187 | assigned_to_id: | |||
|
188 | author_id: 2 | |||
|
189 | status_id: 5 | |||
|
190 | start_date: <%= 1.day.ago.to_date.to_s(:db) %> | |||
|
191 | due_date: |
@@ -7,6 +7,7 versions_001: | |||||
7 | id: 1 |
|
7 | id: 1 | |
8 | description: Beta |
|
8 | description: Beta | |
9 | effective_date: 2006-07-01 |
|
9 | effective_date: 2006-07-01 | |
|
10 | status: closed | |||
10 | versions_002: |
|
11 | versions_002: | |
11 | created_on: 2006-07-19 21:00:33 +02:00 |
|
12 | created_on: 2006-07-19 21:00:33 +02:00 | |
12 | name: "1.0" |
|
13 | name: "1.0" | |
@@ -15,6 +16,7 versions_002: | |||||
15 | id: 2 |
|
16 | id: 2 | |
16 | description: Stable release |
|
17 | description: Stable release | |
17 | effective_date: <%= 20.day.from_now.to_date.to_s(:db) %> |
|
18 | effective_date: <%= 20.day.from_now.to_date.to_s(:db) %> | |
|
19 | status: locked | |||
18 | versions_003: |
|
20 | versions_003: | |
19 | created_on: 2006-07-19 21:00:33 +02:00 |
|
21 | created_on: 2006-07-19 21:00:33 +02:00 | |
20 | name: "2.0" |
|
22 | name: "2.0" | |
@@ -23,4 +25,5 versions_003: | |||||
23 | id: 3 |
|
25 | id: 3 | |
24 | description: Future version |
|
26 | description: Future version | |
25 | effective_date: |
|
27 | effective_date: | |
|
28 | status: open | |||
26 | No newline at end of file |
|
29 |
@@ -20,6 +20,7 require File.dirname(__FILE__) + '/../test_helper' | |||||
20 | class IssueTest < ActiveSupport::TestCase |
|
20 | class IssueTest < ActiveSupport::TestCase | |
21 | fixtures :projects, :users, :members, :member_roles, |
|
21 | fixtures :projects, :users, :members, :member_roles, | |
22 | :trackers, :projects_trackers, |
|
22 | :trackers, :projects_trackers, | |
|
23 | :versions, | |||
23 | :issue_statuses, :issue_categories, :issue_relations, :workflows, |
|
24 | :issue_statuses, :issue_categories, :issue_relations, :workflows, | |
24 | :enumerations, |
|
25 | :enumerations, | |
25 | :issues, |
|
26 | :issues, | |
@@ -184,6 +185,56 class IssueTest < ActiveSupport::TestCase | |||||
184 | assert !issue1.reload.closed? |
|
185 | assert !issue1.reload.closed? | |
185 | end |
|
186 | end | |
186 |
|
187 | |||
|
188 | def test_assignable_versions | |||
|
189 | issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 1, :subject => 'New issue') | |||
|
190 | assert_equal ['open'], issue.assignable_versions.collect(&:status).uniq | |||
|
191 | end | |||
|
192 | ||||
|
193 | def test_should_not_be_able_to_assign_a_new_issue_to_a_closed_version | |||
|
194 | issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 1, :subject => 'New issue') | |||
|
195 | assert !issue.save | |||
|
196 | assert_not_nil issue.errors.on(:fixed_version_id) | |||
|
197 | end | |||
|
198 | ||||
|
199 | def test_should_not_be_able_to_assign_a_new_issue_to_a_locked_version | |||
|
200 | issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 2, :subject => 'New issue') | |||
|
201 | assert !issue.save | |||
|
202 | assert_not_nil issue.errors.on(:fixed_version_id) | |||
|
203 | end | |||
|
204 | ||||
|
205 | def test_should_be_able_to_assign_a_new_issue_to_an_open_version | |||
|
206 | issue = Issue.new(:project_id => 1, :tracker_id => 1, :author_id => 1, :status_id => 1, :fixed_version_id => 3, :subject => 'New issue') | |||
|
207 | assert issue.save | |||
|
208 | end | |||
|
209 | ||||
|
210 | def test_should_be_able_to_update_an_issue_assigned_to_a_closed_version | |||
|
211 | issue = Issue.find(11) | |||
|
212 | assert_equal 'closed', issue.fixed_version.status | |||
|
213 | issue.subject = 'Subject changed' | |||
|
214 | assert issue.save | |||
|
215 | end | |||
|
216 | ||||
|
217 | def test_should_not_be_able_to_reopen_an_issue_assigned_to_a_closed_version | |||
|
218 | issue = Issue.find(11) | |||
|
219 | issue.status_id = 1 | |||
|
220 | assert !issue.save | |||
|
221 | assert_not_nil issue.errors.on_base | |||
|
222 | end | |||
|
223 | ||||
|
224 | def test_should_be_able_to_reopen_and_reassign_an_issue_assigned_to_a_closed_version | |||
|
225 | issue = Issue.find(11) | |||
|
226 | issue.status_id = 1 | |||
|
227 | issue.fixed_version_id = 3 | |||
|
228 | assert issue.save | |||
|
229 | end | |||
|
230 | ||||
|
231 | def test_should_be_able_to_reopen_an_issue_assigned_to_a_locked_version | |||
|
232 | issue = Issue.find(12) | |||
|
233 | assert_equal 'locked', issue.fixed_version.status | |||
|
234 | issue.status_id = 1 | |||
|
235 | assert issue.save | |||
|
236 | end | |||
|
237 | ||||
187 | def test_move_to_another_project_with_same_category |
|
238 | def test_move_to_another_project_with_same_category | |
188 | issue = Issue.find(1) |
|
239 | issue = Issue.find(1) | |
189 | assert issue.move_to(Project.find(2)) |
|
240 | assert issue.move_to(Project.find(2)) |
@@ -26,6 +26,7 class VersionTest < ActiveSupport::TestCase | |||||
26 | def test_create |
|
26 | def test_create | |
27 | v = Version.new(:project => Project.find(1), :name => '1.1', :effective_date => '2011-03-25') |
|
27 | v = Version.new(:project => Project.find(1), :name => '1.1', :effective_date => '2011-03-25') | |
28 | assert v.save |
|
28 | assert v.save | |
|
29 | assert_equal 'open', v.status | |||
29 | end |
|
30 | end | |
30 |
|
31 | |||
31 | def test_invalid_effective_date_validation |
|
32 | def test_invalid_effective_date_validation |
General Comments 0
You need to be logged in to leave comments.
Login now