@@ -0,0 +1,9 | |||
|
1 | class AddRolesAssignable < ActiveRecord::Migration | |
|
2 | def self.up | |
|
3 | add_column :roles, :assignable, :boolean, :default => true | |
|
4 | end | |
|
5 | ||
|
6 | def self.down | |
|
7 | remove_column :roles, :assignable | |
|
8 | end | |
|
9 | end |
@@ -59,6 +59,11 class Issue < ActiveRecord::Base | |||
|
59 | 59 | if start_date && soonest_start && start_date < soonest_start |
|
60 | 60 | errors.add :start_date, :activerecord_error_invalid |
|
61 | 61 | end |
|
62 | ||
|
63 | # validate assignment | |
|
64 | if assigned_to && !assignable_users.include?(assigned_to) | |
|
65 | errors.add :assigned_to_id, :activerecord_error_invalid | |
|
66 | end | |
|
62 | 67 | end |
|
63 | 68 | |
|
64 | 69 | def before_create |
@@ -105,6 +110,11 class Issue < ActiveRecord::Base | |||
|
105 | 110 | @current_journal |
|
106 | 111 | end |
|
107 | 112 | |
|
113 | # Users the issue can be assigned to | |
|
114 | def assignable_users | |
|
115 | project.members.select {|m| m.role.assignable?}.collect {|m| m.user} | |
|
116 | end | |
|
117 | ||
|
108 | 118 | def spent_hours |
|
109 | 119 | @spent_hours ||= time_entries.sum(:hours) || 0 |
|
110 | 120 | end |
@@ -10,7 +10,7 | |||
|
10 | 10 | <div class="box"> |
|
11 | 11 | <div class="splitcontentleft"> |
|
12 | 12 | <p><label><%=l(:label_issue_status_new)%></label> <%= @new_status.name %></p> |
|
13 |
<p><%= f.select :assigned_to_id, (@issue. |
|
|
13 | <p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p> | |
|
14 | 14 | <p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }) %></p> |
|
15 | 15 | <p><%= f.select :fixed_version_id, (@project.versions.sort.collect {|v| [v.name, v.id]}), { :include_blank => true } %></p> |
|
16 | 16 | </div> |
@@ -7,7 +7,7 | |||
|
7 | 7 | <div class="splitcontentleft"> |
|
8 | 8 | <p><label><%=l(:field_status)%></label> <%= @issue.status.name %></p> |
|
9 | 9 | <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p> |
|
10 |
<p><%= f.select :assigned_to_id, (@issue. |
|
|
10 | <p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p> | |
|
11 | 11 | <p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %> |
|
12 | 12 | <%= prompt_to_remote(l(:label_issue_category_new), |
|
13 | 13 | l(:label_issue_category_new), 'category[name]', |
@@ -9,7 +9,7 | |||
|
9 | 9 | <div class="splitcontentleft"> |
|
10 | 10 | <p><%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), :required => true %></p> |
|
11 | 11 | <p><%= f.select :priority_id, (@priorities.collect {|p| [p.name, p.id]}), :required => true %></p> |
|
12 |
<p><%= f.select :assigned_to_id, (@issue. |
|
|
12 | <p><%= f.select :assigned_to_id, (@issue.assignable_users.collect {|m| [m.name, m.id]}), :include_blank => true %></p> | |
|
13 | 13 | <p><%= f.select :category_id, (@project.issue_categories.collect {|c| [c.name, c.id]}), :include_blank => true %> |
|
14 | 14 | <%= prompt_to_remote(l(:label_issue_category_new), |
|
15 | 15 | l(:label_issue_category_new), 'category[name]', |
@@ -2,6 +2,8 | |||
|
2 | 2 | <div class="box"> |
|
3 | 3 | <!--[form:role]--> |
|
4 | 4 | <p><%= f.text_field :name, :required => true %></p> |
|
5 | <p><%= f.check_box :assignable %></p> | |
|
6 | <div class="clear"></div> | |
|
5 | 7 | |
|
6 | 8 | <h3><%=l(:label_permissions)%></h3> |
|
7 | 9 | <% permissions = @permissions.group_by {|p| p.group_id } %> |
@@ -155,6 +155,7 field_identifier: Идентификатор | |||
|
155 | 155 | field_is_filter: Използва се за филтър |
|
156 | 156 | field_issue_to_id: Related issue |
|
157 | 157 | field_delay: Delay |
|
158 | field_assignable: Issues can be assigned to this role | |
|
158 | 159 | |
|
159 | 160 | setting_app_title: Заглавие |
|
160 | 161 | setting_app_subtitle: Описание |
@@ -155,6 +155,7 field_identifier: Identifier | |||
|
155 | 155 | field_is_filter: Used as a filter |
|
156 | 156 | field_issue_to_id: Related issue |
|
157 | 157 | field_delay: Delay |
|
158 | field_assignable: Issues can be assigned to this role | |
|
158 | 159 | |
|
159 | 160 | setting_app_title: Applikation Titel |
|
160 | 161 | setting_app_subtitle: Applikation Untertitel |
@@ -155,6 +155,7 field_identifier: Identifier | |||
|
155 | 155 | field_is_filter: Used as a filter |
|
156 | 156 | field_issue_to_id: Related issue |
|
157 | 157 | field_delay: Delay |
|
158 | field_assignable: Issues can be assigned to this role | |
|
158 | 159 | |
|
159 | 160 | setting_app_title: Application title |
|
160 | 161 | setting_app_subtitle: Application subtitle |
@@ -155,6 +155,7 field_identifier: Identifier | |||
|
155 | 155 | field_is_filter: Used as a filter |
|
156 | 156 | field_issue_to_id: Related issue |
|
157 | 157 | field_delay: Delay |
|
158 | field_assignable: Issues can be assigned to this role | |
|
158 | 159 | |
|
159 | 160 | setting_app_title: Título del aplicación |
|
160 | 161 | setting_app_subtitle: Subtítulo del aplicación |
@@ -155,6 +155,7 field_identifier: Identifiant | |||
|
155 | 155 | field_is_filter: Utilisé comme filtre |
|
156 | 156 | field_issue_to_id: Demande liée |
|
157 | 157 | field_delay: Retard |
|
158 | field_assignable: Demandes assignables à ce rôle | |
|
158 | 159 | |
|
159 | 160 | setting_app_title: Titre de l'application |
|
160 | 161 | setting_app_subtitle: Sous-titre de l'application |
@@ -155,6 +155,7 field_identifier: Identifier | |||
|
155 | 155 | field_is_filter: Used as a filter |
|
156 | 156 | field_issue_to_id: Related issue |
|
157 | 157 | field_delay: Delay |
|
158 | field_assignable: Issues can be assigned to this role | |
|
158 | 159 | |
|
159 | 160 | setting_app_title: Titolo applicazione |
|
160 | 161 | setting_app_subtitle: Sottotitolo applicazione |
@@ -156,6 +156,7 field_identifier: 識別子 | |||
|
156 | 156 | field_is_filter: フィルタとして使う |
|
157 | 157 | field_issue_to_id: 関連する問題 |
|
158 | 158 | field_delay: 遅延 |
|
159 | field_assignable: Issues can be assigned to this role | |
|
159 | 160 | |
|
160 | 161 | setting_app_title: アプリケーションのタイトル |
|
161 | 162 | setting_app_subtitle: アプリケーションのサブタイトル |
@@ -155,6 +155,7 field_identifier: Identificatiecode | |||
|
155 | 155 | field_is_filter: Gebruikt als een filter |
|
156 | 156 | field_issue_to_id: Gerelateerd issue |
|
157 | 157 | field_delay: Vertraging |
|
158 | field_assignable: Issues can be assigned to this role | |
|
158 | 159 | |
|
159 | 160 | setting_app_title: Applicatie titel |
|
160 | 161 | setting_app_subtitle: Applicatie ondertitel |
@@ -155,6 +155,7 field_identifier: Identificador | |||
|
155 | 155 | field_is_filter: Used as a filter |
|
156 | 156 | field_issue_to_id: Related issue |
|
157 | 157 | field_delay: Delay |
|
158 | field_assignable: Issues can be assigned to this role | |
|
158 | 159 | |
|
159 | 160 | setting_app_title: Titulo da aplicacao |
|
160 | 161 | setting_app_subtitle: Sub-titulo da aplicacao |
@@ -155,6 +155,7 field_identifier: Identificador | |||
|
155 | 155 | field_is_filter: Usado como filtro |
|
156 | 156 | field_issue_to_id: Tarefa relacionada |
|
157 | 157 | field_delay: Atraso |
|
158 | field_assignable: Issues can be assigned to this role | |
|
158 | 159 | |
|
159 | 160 | setting_app_title: Título da aplicação |
|
160 | 161 | setting_app_subtitle: Sub-título da aplicação |
@@ -155,6 +155,7 field_identifier: Identifierare | |||
|
155 | 155 | field_is_filter: Used as a filter |
|
156 | 156 | field_issue_to_id: Related issue |
|
157 | 157 | field_delay: Delay |
|
158 | field_assignable: Issues can be assigned to this role | |
|
158 | 159 | |
|
159 | 160 | setting_app_title: Applikationstitel |
|
160 | 161 | setting_app_subtitle: Applicationsunderrubrik |
General Comments 0
You need to be logged in to leave comments.
Login now