Revision 3020
Added by Jean-Philippe Lang over 15 years ago
trunk/app/models/issue.rb | ||
---|---|---|
143 | 143 |
if start_date && soonest_start && start_date < soonest_start |
144 | 144 |
errors.add :start_date, :invalid |
145 | 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 | 154 |
end |
147 | 155 |
|
148 | 156 |
def validate_on_create |
... | ... | |
193 | 201 |
self.status.is_closed? |
194 | 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 | 216 |
# Returns true if the issue is overdue |
197 | 217 |
def overdue? |
198 | 218 |
!due_date.nil? && (due_date < Date.today) && !status.is_closed? |
... | ... | |
203 | 223 |
project.assignable_users |
204 | 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 | 231 |
# Returns true if this issue is blocked by another issue that is still open |
207 | 232 |
def blocked? |
208 | 233 |
!relations_to.detect {|ir| ir.relation_type == 'blocks' && !ir.issue_from.closed?}.nil? |
trunk/app/models/version.rb | ||
---|---|---|
22 | 22 |
acts_as_attachable :view_permission => :view_files, |
23 | 23 |
:delete_permission => :manage_files |
24 | 24 |
|
25 |
VERSION_STATUSES = %w(open locked closed) |
|
26 |
|
|
25 | 27 |
validates_presence_of :name |
26 | 28 |
validates_uniqueness_of :name, :scope => [:project_id] |
27 | 29 |
validates_length_of :name, :maximum => 60 |
28 | 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 | 35 |
def start_date |
31 | 36 |
effective_date |
32 | 37 |
end |
... | ... | |
45 | 50 |
@spent_hours ||= TimeEntry.sum(:hours, :include => :issue, :conditions => ["#{Issue.table_name}.fixed_version_id = ?", id]).to_f |
46 | 51 |
end |
47 | 52 |
|
53 |
def closed? |
|
54 |
status == 'closed' |
|
55 |
end |
|
56 |
|
|
48 | 57 |
# Returns true if the version is completed: due date reached and no open issues |
49 | 58 |
def completed? |
50 | 59 |
effective_date && (effective_date <= Date.today) && (open_issues_count == 0) |
trunk/app/views/issues/_form.rhtml | ||
---|---|---|
32 | 32 |
{:controller => 'projects', :action => 'add_issue_category', :id => @project}, |
33 | 33 |
:class => 'small', :tabindex => 199) if authorize_for('projects', 'add_issue_category') %></p> |
34 | 34 |
<% end %> |
35 |
<%= content_tag('p', f.select(:fixed_version_id,
|
|
36 |
(@project.versions.sort.collect {|v| [v.name, v.id]}),
|
|
37 |
{ :include_blank => true })) unless @project.versions.empty? %>
|
|
35 |
<% unless @issue.assignable_versions.empty? %>
|
|
36 |
<p><%= f.select :fixed_version_id, (@issue.assignable_versions.collect {|v| [v.name, v.id]}), :include_blank => true %></p>
|
|
37 |
<% end %>
|
|
38 | 38 |
</div> |
39 | 39 |
|
40 | 40 |
<div class="splitcontentright"> |
trunk/app/views/issues/_form_update.rhtml | ||
---|---|---|
5 | 5 |
</div> |
6 | 6 |
<div class="splitcontentright"> |
7 | 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,
|
|
9 |
(@project.versions.sort.collect {|v| [v.name, v.id]}),
|
|
10 |
{ :include_blank => true })) unless @project.versions.empty? %>
|
|
8 |
<% unless @issue.assignable_versions.empty? %>
|
|
9 |
<p><%= f.select :fixed_version_id, (@issue.assignable_versions.collect {|v| [v.name, v.id]}), :include_blank => true %></p>
|
|
10 |
<% end %>
|
|
11 | 11 |
</div> |
12 | 12 |
</div> |
trunk/app/views/issues/bulk_edit.rhtml | ||
---|---|---|
27 | 27 |
<label><%= l(:field_fixed_version) %>: |
28 | 28 |
<%= select_tag('fixed_version_id', content_tag('option', l(:label_no_change_option), :value => '') + |
29 | 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 | 31 |
</p> |
32 | 32 |
|
33 | 33 |
<p> |
trunk/app/views/issues/context_menu.rhtml | ||
---|---|---|
27 | 27 |
<% end -%> |
28 | 28 |
</ul> |
29 | 29 |
</li> |
30 |
<% unless @project.nil? || @project.versions.empty? -%> |
|
30 |
<% unless @project.nil? || @project.versions.open.empty? -%>
|
|
31 | 31 |
<li class="folder"> |
32 | 32 |
<a href="#" class="submenu"><%= l(:field_fixed_version) %></a> |
33 | 33 |
<ul> |
34 |
<% @project.versions.sort.each do |v| -%> |
|
34 |
<% @project.versions.open.sort.each do |v| -%>
|
|
35 | 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 | 36 |
:selected => (@issue && v == @issue.fixed_version), :disabled => !@can[:update] %></li> |
37 | 37 |
<% end -%> |
trunk/app/views/projects/settings/_versions.rhtml | ||
---|---|---|
1 | 1 |
<% if @project.versions.any? %> |
2 |
<table class="list"> |
|
2 |
<table class="list versions">
|
|
3 | 3 |
<thead> |
4 | 4 |
<th><%= l(:label_version) %></th> |
5 | 5 |
<th><%= l(:field_effective_date) %></th> |
6 | 6 |
<th><%= l(:field_description) %></th> |
7 |
<th><%= l(:field_status) %></th> |
|
7 | 8 |
<th><%= l(:label_wiki_page) unless @project.wiki.nil? %></th> |
8 | 9 |
<th style="width:15%"></th> |
9 |
<th style="width:15%"></th> |
|
10 | 10 |
</thead> |
11 | 11 |
<tbody> |
12 | 12 |
<% for version in @project.versions.sort %> |
13 |
<tr class="<%= cycle 'odd', 'even' %>">
|
|
13 |
<tr class="version <%= cycle 'odd', 'even' %> <%=h version.status %>">
|
|
14 | 14 |
<td><%= link_to h(version.name), :controller => 'versions', :action => 'show', :id => version %></td> |
15 | 15 |
<td align="center"><%= format_date(version.effective_date) %></td> |
16 | 16 |
<td><%=h version.description %></td> |
17 |
<td><%= l("version_status_#{version.status}") %></td> |
|
17 | 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 align="center"><%= 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' %></td> |
|
19 |
<td class="buttons"> |
|
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 | 23 |
</tr> |
21 | 24 |
<% end; reset_cycle %> |
22 | 25 |
</tbody> |
trunk/app/views/versions/_form.rhtml | ||
---|---|---|
3 | 3 |
<div class="box"> |
4 | 4 |
<p><%= f.text_field :name, :size => 60, :required => true %></p> |
5 | 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 | 7 |
<p><%= f.text_field :wiki_page_title, :label => :label_wiki_page, :size => 60, :disabled => @project.wiki.nil? %></p> |
7 | 8 |
<p><%= f.text_field :effective_date, :size => 10 %><%= calendar_for('version_effective_date') %></p> |
8 | 9 |
</div> |
trunk/config/locales/bg.yml | ||
---|---|---|
827 | 827 |
field_active: Active |
828 | 828 |
enumeration_system_activity: System Activity |
829 | 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 |
trunk/config/locales/bs.yml | ||
---|---|---|
851 | 851 |
field_active: Active |
852 | 852 |
enumeration_system_activity: System Activity |
853 | 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 |
trunk/config/locales/ca.yml | ||
---|---|---|
830 | 830 |
field_active: Active |
831 | 831 |
enumeration_system_activity: System Activity |
832 | 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 |
trunk/config/locales/cs.yml | ||
---|---|---|
833 | 833 |
field_active: Active |
834 | 834 |
enumeration_system_activity: System Activity |
835 | 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 |
trunk/config/locales/da.yml | ||
---|---|---|
853 | 853 |
field_active: Active |
854 | 854 |
enumeration_system_activity: System Activity |
855 | 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 |
trunk/config/locales/de.yml | ||
---|---|---|
853 | 853 |
field_active: Active |
854 | 854 |
enumeration_system_activity: System Activity |
855 | 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 |
trunk/config/locales/el.yml | ||
---|---|---|
833 | 833 |
field_active: Active |
834 | 834 |
enumeration_system_activity: System Activity |
835 | 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 |
trunk/config/locales/en.yml | ||
---|---|---|
155 | 155 |
error_issue_not_found_in_project: 'The issue was not found or does not belong to this project' |
156 | 156 |
error_no_tracker_in_project: 'No tracker is associated to this project. Please check the Project settings.' |
157 | 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 | 160 |
warning_attachments_not_saved: "{{count}} file(s) could not be saved." |
160 | 161 |
|
... | ... | |
749 | 750 |
status_active: active |
750 | 751 |
status_registered: registered |
751 | 752 |
status_locked: locked |
753 |
|
|
754 |
version_status_open: open |
|
755 |
version_status_locked: locked |
|
756 |
version_status_closed: closed |
|
752 | 757 |
|
753 | 758 |
field_active: Active |
754 | 759 |
|
trunk/config/locales/es.yml | ||
---|---|---|
874 | 874 |
field_active: Active |
875 | 875 |
enumeration_system_activity: System Activity |
876 | 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 |
trunk/config/locales/fi.yml | ||
---|---|---|
863 | 863 |
field_active: Active |
864 | 864 |
enumeration_system_activity: System Activity |
865 | 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 |
trunk/config/locales/fr.yml | ||
---|---|---|
177 | 177 |
error_scm_command_failed: "Une erreur s'est produite lors de l'accès au dépôt: {{value}}" |
178 | 178 |
error_scm_annotate: "L'entrée n'existe pas ou ne peut pas être annotée." |
179 | 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 | 182 |
warning_attachments_not_saved: "{{count}} fichier(s) n'ont pas pu être sauvegardés." |
182 | 183 |
|
... | ... | |
767 | 768 |
status_registered: enregistré |
768 | 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 | 775 |
text_select_mail_notifications: Actions pour lesquelles une notification par e-mail est envoyée |
771 | 776 |
text_regexp_info: ex. ^[A-Z0-9]+$ |
772 | 777 |
text_min_max_length_info: 0 pour aucune restriction |
trunk/config/locales/gl.yml | ||
---|---|---|
853 | 853 |
field_active: Active |
854 | 854 |
enumeration_system_activity: System Activity |
855 | 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 |
trunk/config/locales/he.yml | ||
---|---|---|
837 | 837 |
field_active: Active |
838 | 838 |
enumeration_system_activity: System Activity |
839 | 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 |
trunk/config/locales/hu.yml | ||
---|---|---|
858 | 858 |
field_active: Active |
859 | 859 |
enumeration_system_activity: System Activity |
860 | 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 |
trunk/config/locales/it.yml | ||
---|---|---|
840 | 840 |
field_active: Active |
841 | 841 |
enumeration_system_activity: System Activity |
842 | 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 |
trunk/config/locales/ja.yml | ||
---|---|---|
862 | 862 |
field_active: Active |
863 | 863 |
enumeration_system_activity: System Activity |
864 | 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 |
trunk/config/locales/ko.yml | ||
---|---|---|
893 | 893 |
field_active: Active |
894 | 894 |
enumeration_system_activity: System Activity |
895 | 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 |
trunk/config/locales/lt.yml | ||
---|---|---|
863 | 863 |
field_active: Active |
864 | 864 |
enumeration_system_activity: System Activity |
865 | 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 |
trunk/config/locales/nl.yml | ||
---|---|---|
815 | 815 |
field_active: Active |
816 | 816 |
enumeration_system_activity: System Activity |
817 | 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 |
trunk/config/locales/no.yml | ||
---|---|---|
828 | 828 |
field_active: Active |
829 | 829 |
enumeration_system_activity: System Activity |
830 | 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 |
trunk/config/locales/pl.yml | ||
---|---|---|
856 | 856 |
field_active: Aktywne |
857 | 857 |
enumeration_system_activity: Aktywność Systemowa |
858 | 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 |
trunk/config/locales/pt-BR.yml | ||
---|---|---|
859 | 859 |
field_active: Ativo |
860 | 860 |
enumeration_system_activity: Atividade do sistema |
861 | 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 |
trunk/config/locales/pt.yml | ||
---|---|---|
845 | 845 |
field_active: Active |
846 | 846 |
enumeration_system_activity: System Activity |
847 | 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 |
trunk/config/locales/ro.yml | ||
---|---|---|
830 | 830 |
field_active: Active |
831 | 831 |
enumeration_system_activity: System Activity |
832 | 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 |
trunk/config/locales/ru.yml | ||
---|---|---|
941 | 941 |
field_active: Active |
942 | 942 |
enumeration_system_activity: System Activity |
943 | 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 |
trunk/config/locales/sk.yml | ||
---|---|---|
832 | 832 |
field_active: Active |
833 | 833 |
enumeration_system_activity: System Activity |
834 | 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 |
trunk/config/locales/sl.yml | ||
---|---|---|
829 | 829 |
field_active: Active |
830 | 830 |
enumeration_system_activity: System Activity |
831 | 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 |
trunk/config/locales/sr.yml | ||
---|---|---|
848 | 848 |
field_active: Active |
849 | 849 |
enumeration_system_activity: System Activity |
850 | 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 |
trunk/config/locales/sv.yml | ||
---|---|---|
881 | 881 |
enumeration_doc_categories: Dokumentkategorier |
882 | 882 |
enumeration_activities: Aktiviteter (tidsuppföljning) |
883 | 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 |
trunk/config/locales/th.yml | ||
---|---|---|
830 | 830 |
field_active: Active |
831 | 831 |
enumeration_system_activity: System Activity |
832 | 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 |
trunk/config/locales/tr.yml | ||
---|---|---|
860 | 860 |
field_active: Active |
861 | 861 |
enumeration_system_activity: System Activity |
862 | 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 |
trunk/config/locales/uk.yml | ||
---|---|---|
829 | 829 |
field_active: Active |
830 | 830 |
enumeration_system_activity: System Activity |
831 | 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 |
trunk/config/locales/vi.yml | ||
---|---|---|
892 | 892 |
field_active: Active |
893 | 893 |
enumeration_system_activity: System Activity |
894 | 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 |
trunk/config/locales/zh-TW.yml | ||
---|---|---|
923 | 923 |
enumeration_doc_categories: 文件分類 |
924 | 924 |
enumeration_activities: 活動 (時間追蹤) |
925 | 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 |
trunk/config/locales/zh.yml | ||
---|---|---|
855 | 855 |
field_active: Active |
856 | 856 |
enumeration_system_activity: System Activity |
857 | 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 |
trunk/db/migrate/20091108092559_add_versions_status.rb | ||
---|---|---|
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 |
|
0 | 10 |
trunk/public/stylesheets/application.css | ||
---|---|---|
124 | 124 |
tr.message.locked td.subject a { background-image: url(../images/locked.png); } |
125 | 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 | 129 |
tr.user td { width:13%; } |
128 | 130 |
tr.user td.email { width:18%; } |
129 | 131 |
tr.user td { white-space: nowrap; } |
trunk/test/fixtures/issues.yml | ||
---|---|---|
157 | 157 |
status_id: 1 |
158 | 158 |
start_date: <%= Date.today.to_s(:db) %> |
159 | 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: |
trunk/test/fixtures/versions.yml | ||
---|---|---|
7 | 7 |
id: 1 |
8 | 8 |
description: Beta |
9 | 9 |
effective_date: 2006-07-01 |
10 |
status: closed |
|
10 | 11 |
versions_002: |
11 | 12 |
created_on: 2006-07-19 21:00:33 +02:00 |
12 | 13 |
name: "1.0" |
... | ... | |
15 | 16 |
id: 2 |
16 | 17 |
description: Stable release |
17 | 18 |
effective_date: <%= 20.day.from_now.to_date.to_s(:db) %> |
19 |
status: locked |
|
18 | 20 |
versions_003: |
19 | 21 |
created_on: 2006-07-19 21:00:33 +02:00 |
20 | 22 |
name: "2.0" |
... | ... | |
23 | 25 |
id: 3 |
24 | 26 |
description: Future version |
25 | 27 |
effective_date: |
28 |
status: open |
|
26 | 29 |
|
trunk/test/unit/issue_test.rb | ||
---|---|---|
20 | 20 |
class IssueTest < ActiveSupport::TestCase |
21 | 21 |
fixtures :projects, :users, :members, :member_roles, |
22 | 22 |
:trackers, :projects_trackers, |
23 |
:versions, |
|
23 | 24 |
:issue_statuses, :issue_categories, :issue_relations, :workflows, |
24 | 25 |
:enumerations, |
25 | 26 |
:issues, |
... | ... | |
184 | 185 |
assert !issue1.reload.closed? |
185 | 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 | 238 |
def test_move_to_another_project_with_same_category |
188 | 239 |
issue = Issue.find(1) |
189 | 240 |
assert issue.move_to(Project.find(2)) |
trunk/test/unit/version_test.rb | ||
---|---|---|
26 | 26 |
def test_create |
27 | 27 |
v = Version.new(:project => Project.find(1), :name => '1.1', :effective_date => '2011-03-25') |
28 | 28 |
assert v.save |
29 |
assert_equal 'open', v.status |
|
29 | 30 |
end |
30 | 31 |
|
31 | 32 |
def test_invalid_effective_date_validation |
Also available in: Unified diff
Adds version status to limit issue assignments (#1245).
Available version statuses are: