##// END OF EJS Templates
Prevent parent issue from being closed if a child issue is open (#10989)....
Jean-Philippe Lang -
r15726:f3627e2a3d1a
parent child
Show More
@@ -723,6 +723,9 class Issue < ActiveRecord::Base
723 @parent_issue.self_and_ancestors.any? {|a| a.relations_from.any? {|r| r.relation_type == IssueRelation::TYPE_PRECEDES && r.issue_to.would_reschedule?(self)}}
723 @parent_issue.self_and_ancestors.any? {|a| a.relations_from.any? {|r| r.relation_type == IssueRelation::TYPE_PRECEDES && r.issue_to.would_reschedule?(self)}}
724 )
724 )
725 errors.add :parent_issue_id, :invalid
725 errors.add :parent_issue_id, :invalid
726 elsif !closed? && @parent_issue.closed?
727 # cannot attach an open issue to a closed parent
728 errors.add :base, :open_issue_with_closed_parent
726 elsif !new_record?
729 elsif !new_record?
727 # moving an existing issue
730 # moving an existing issue
728 if move_possible?(@parent_issue)
731 if move_possible?(@parent_issue)
@@ -945,9 +948,14 class Issue < ActiveRecord::Base
945 end
948 end
946
949
947 statuses = statuses.compact.uniq.sort
950 statuses = statuses.compact.uniq.sort
948 if blocked?
951 if blocked? || descendants.open.any?
952 # cannot close a blocked issue or a parent with open subtasks
949 statuses.reject!(&:is_closed?)
953 statuses.reject!(&:is_closed?)
950 end
954 end
955 if ancestors.open(false).any?
956 # cannot reopen a subtask of a closed parent
957 statuses.select!(&:is_closed?)
958 end
951 statuses
959 statuses
952 end
960 end
953
961
@@ -130,6 +130,7 ar:
130 cant_link_an_issue_with_a_descendant: "لا يمكن ان تكون المشكلة مرتبطة بواحدة من المهام الفرعية"
130 cant_link_an_issue_with_a_descendant: "لا يمكن ان تكون المشكلة مرتبطة بواحدة من المهام الفرعية"
131 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
131 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
132 not_a_regexp: "is not a valid regular expression"
132 not_a_regexp: "is not a valid regular expression"
133 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
133
134
134 actionview_instancetag_blank_option: الرجاء التحديد
135 actionview_instancetag_blank_option: الرجاء التحديد
135
136
@@ -198,6 +198,7 az:
198 cant_link_an_issue_with_a_descendant: "Tapşırıq özünün alt tapşırığı ilə əlaqəli ola bilməz"
198 cant_link_an_issue_with_a_descendant: "Tapşırıq özünün alt tapşırığı ilə əlaqəli ola bilməz"
199 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
199 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
200 not_a_regexp: "is not a valid regular expression"
200 not_a_regexp: "is not a valid regular expression"
201 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
201
202
202 support:
203 support:
203 array:
204 array:
@@ -132,6 +132,7 bg:
132 cant_link_an_issue_with_a_descendant: "Една задача не може да бъде свързвана към своя подзадача"
132 cant_link_an_issue_with_a_descendant: "Една задача не може да бъде свързвана към своя подзадача"
133 earlier_than_minimum_start_date: "не може да бъде по-рано от %{date} поради предхождащи задачи"
133 earlier_than_minimum_start_date: "не може да бъде по-рано от %{date} поради предхождащи задачи"
134 not_a_regexp: "is not a valid regular expression"
134 not_a_regexp: "is not a valid regular expression"
135 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
135
136
136 actionview_instancetag_blank_option: Изберете
137 actionview_instancetag_blank_option: Изберете
137
138
@@ -142,6 +142,7 bs:
142 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
142 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
143 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
143 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
144 not_a_regexp: "is not a valid regular expression"
144 not_a_regexp: "is not a valid regular expression"
145 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
145
146
146 actionview_instancetag_blank_option: Molimo odaberite
147 actionview_instancetag_blank_option: Molimo odaberite
147
148
@@ -135,6 +135,7 ca:
135 cant_link_an_issue_with_a_descendant: "Un assumpte no es pot enllaçar a una de les seves subtasques"
135 cant_link_an_issue_with_a_descendant: "Un assumpte no es pot enllaçar a una de les seves subtasques"
136 earlier_than_minimum_start_date: "no pot ser anterior a %{date} derivat a les peticions precedents"
136 earlier_than_minimum_start_date: "no pot ser anterior a %{date} derivat a les peticions precedents"
137 not_a_regexp: "is not a valid regular expression"
137 not_a_regexp: "is not a valid regular expression"
138 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
138
139
139 actionview_instancetag_blank_option: "Seleccionar"
140 actionview_instancetag_blank_option: "Seleccionar"
140
141
@@ -136,6 +136,7 cs:
136 cant_link_an_issue_with_a_descendant: "Úkol nemůže být spojen s jedním z jeho dílčích úkolů"
136 cant_link_an_issue_with_a_descendant: "Úkol nemůže být spojen s jedním z jeho dílčích úkolů"
137 earlier_than_minimum_start_date: "nemůže být dříve než %{date} kvůli předřazeným úkolům"
137 earlier_than_minimum_start_date: "nemůže být dříve než %{date} kvůli předřazeným úkolům"
138 not_a_regexp: "is not a valid regular expression"
138 not_a_regexp: "is not a valid regular expression"
139 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
139
140
140 actionview_instancetag_blank_option: Prosím vyberte
141 actionview_instancetag_blank_option: Prosím vyberte
141
142
@@ -143,6 +143,7 da:
143 cant_link_an_issue_with_a_descendant: "En sag kan ikke relateres til en af dens underopgaver"
143 cant_link_an_issue_with_a_descendant: "En sag kan ikke relateres til en af dens underopgaver"
144 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
144 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
145 not_a_regexp: "is not a valid regular expression"
145 not_a_regexp: "is not a valid regular expression"
146 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
146
147
147 template:
148 template:
148 header:
149 header:
@@ -147,6 +147,7 de:
147 cant_link_an_issue_with_a_descendant: "Ein Ticket kann nicht mit einer Ihrer Unteraufgaben verlinkt werden"
147 cant_link_an_issue_with_a_descendant: "Ein Ticket kann nicht mit einer Ihrer Unteraufgaben verlinkt werden"
148 earlier_than_minimum_start_date: "kann wegen eines Vorgängertickets nicht vor %{date} liegen"
148 earlier_than_minimum_start_date: "kann wegen eines Vorgängertickets nicht vor %{date} liegen"
149 not_a_regexp: "is not a valid regular expression"
149 not_a_regexp: "is not a valid regular expression"
150 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
150
151
151 actionview_instancetag_blank_option: Bitte auswählen
152 actionview_instancetag_blank_option: Bitte auswählen
152
153
@@ -132,6 +132,7 el:
132 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
132 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
133 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
133 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
134 not_a_regexp: "is not a valid regular expression"
134 not_a_regexp: "is not a valid regular expression"
135 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
135
136
136 actionview_instancetag_blank_option: Παρακαλώ επιλέξτε
137 actionview_instancetag_blank_option: Παρακαλώ επιλέξτε
137
138
@@ -135,6 +135,7 en-GB:
135 cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks"
135 cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks"
136 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
136 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
137 not_a_regexp: "is not a valid regular expression"
137 not_a_regexp: "is not a valid regular expression"
138 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
138
139
139 actionview_instancetag_blank_option: Please select
140 actionview_instancetag_blank_option: Please select
140
141
@@ -131,6 +131,7 en:
131 cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks"
131 cant_link_an_issue_with_a_descendant: "An issue cannot be linked to one of its subtasks"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
133 not_a_regexp: "is not a valid regular expression"
133 not_a_regexp: "is not a valid regular expression"
134 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
134
135
135 actionview_instancetag_blank_option: Please select
136 actionview_instancetag_blank_option: Please select
136
137
@@ -141,6 +141,7 es-PA:
141 cant_link_an_issue_with_a_descendant: "Esta incidencia no puede ser ligada a una de estas tareas"
141 cant_link_an_issue_with_a_descendant: "Esta incidencia no puede ser ligada a una de estas tareas"
142 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
142 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
143 not_a_regexp: "is not a valid regular expression"
143 not_a_regexp: "is not a valid regular expression"
144 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
144
145
145 # Append your own errors here or at the model/attributes scope.
146 # Append your own errors here or at the model/attributes scope.
146
147
@@ -139,6 +139,7 es:
139 cant_link_an_issue_with_a_descendant: "Esta petición no puede ser ligada a una de estas tareas"
139 cant_link_an_issue_with_a_descendant: "Esta petición no puede ser ligada a una de estas tareas"
140 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
140 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
141 not_a_regexp: "is not a valid regular expression"
141 not_a_regexp: "is not a valid regular expression"
142 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
142
143
143 # Append your own errors here or at the model/attributes scope.
144 # Append your own errors here or at the model/attributes scope.
144
145
@@ -148,6 +148,7 et:
148 cant_link_an_issue_with_a_descendant: "Teemat ei saa sidustada tema enda alamteemaga"
148 cant_link_an_issue_with_a_descendant: "Teemat ei saa sidustada tema enda alamteemaga"
149 earlier_than_minimum_start_date: "Tähtpäev ei saa olla varasem kui %{date} eelnevate teemade tähtpäevade tõttu"
149 earlier_than_minimum_start_date: "Tähtpäev ei saa olla varasem kui %{date} eelnevate teemade tähtpäevade tõttu"
150 not_a_regexp: "is not a valid regular expression"
150 not_a_regexp: "is not a valid regular expression"
151 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
151
152
152 actionview_instancetag_blank_option: "Palun vali"
153 actionview_instancetag_blank_option: "Palun vali"
153
154
@@ -133,6 +133,7 eu:
133 cant_link_an_issue_with_a_descendant: "Zeregin bat ezin da bere azpiataza batekin estekatu."
133 cant_link_an_issue_with_a_descendant: "Zeregin bat ezin da bere azpiataza batekin estekatu."
134 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
134 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
135 not_a_regexp: "is not a valid regular expression"
135 not_a_regexp: "is not a valid regular expression"
136 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
136
137
137 actionview_instancetag_blank_option: Hautatu mesedez
138 actionview_instancetag_blank_option: Hautatu mesedez
138
139
@@ -131,6 +131,7 fa:
131 cant_link_an_issue_with_a_descendant: "یک مورد نمی‌تواند به یکی از زیر کارهایش پیوند بخورد"
131 cant_link_an_issue_with_a_descendant: "یک مورد نمی‌تواند به یکی از زیر کارهایش پیوند بخورد"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
133 not_a_regexp: "is not a valid regular expression"
133 not_a_regexp: "is not a valid regular expression"
134 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
134
135
135 actionview_instancetag_blank_option: گزینش کنید
136 actionview_instancetag_blank_option: گزینش کنید
136
137
@@ -156,6 +156,7 fi:
156 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
156 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
157 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
157 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
158 not_a_regexp: "is not a valid regular expression"
158 not_a_regexp: "is not a valid regular expression"
159 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
159
160
160 actionview_instancetag_blank_option: Valitse, ole hyvä
161 actionview_instancetag_blank_option: Valitse, ole hyvä
161
162
@@ -151,6 +151,7 fr:
151 cant_link_an_issue_with_a_descendant: "Une demande ne peut pas être liée à l'une de ses sous-tâches"
151 cant_link_an_issue_with_a_descendant: "Une demande ne peut pas être liée à l'une de ses sous-tâches"
152 earlier_than_minimum_start_date: "ne peut pas être antérieure au %{date} à cause des demandes qui précèdent"
152 earlier_than_minimum_start_date: "ne peut pas être antérieure au %{date} à cause des demandes qui précèdent"
153 not_a_regexp: "n'est pas une expression regulière valide"
153 not_a_regexp: "n'est pas une expression regulière valide"
154 open_issue_with_closed_parent: "Une demande ouverte ne peut pas être rattachée à une demande fermée"
154
155
155 actionview_instancetag_blank_option: Choisir
156 actionview_instancetag_blank_option: Choisir
156
157
@@ -160,6 +160,7 gl:
160 cant_link_an_issue_with_a_descendant: "As peticións non poden estar ligadas coas súas subtarefas"
160 cant_link_an_issue_with_a_descendant: "As peticións non poden estar ligadas coas súas subtarefas"
161 earlier_than_minimum_start_date: "Non pode ser antes de %{date} por mor de peticións anteriores"
161 earlier_than_minimum_start_date: "Non pode ser antes de %{date} por mor de peticións anteriores"
162 not_a_regexp: "is not a valid regular expression"
162 not_a_regexp: "is not a valid regular expression"
163 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
163
164
164 actionview_instancetag_blank_option: Por favor seleccione
165 actionview_instancetag_blank_option: Por favor seleccione
165
166
@@ -136,6 +136,7 he:
136 cant_link_an_issue_with_a_descendant: "לא ניתן לקשר נושא לתת־משימה שלו"
136 cant_link_an_issue_with_a_descendant: "לא ניתן לקשר נושא לתת־משימה שלו"
137 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
137 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
138 not_a_regexp: "is not a valid regular expression"
138 not_a_regexp: "is not a valid regular expression"
139 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
139
140
140 actionview_instancetag_blank_option: בחר בבקשה
141 actionview_instancetag_blank_option: בחר בבקשה
141
142
@@ -126,6 +126,7 hr:
126 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
126 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
127 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
127 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
128 not_a_regexp: "is not a valid regular expression"
128 not_a_regexp: "is not a valid regular expression"
129 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
129
130
130 actionview_instancetag_blank_option: Molimo odaberite
131 actionview_instancetag_blank_option: Molimo odaberite
131
132
@@ -152,6 +152,7
152 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
152 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
153 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
153 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
154 not_a_regexp: "is not a valid regular expression"
154 not_a_regexp: "is not a valid regular expression"
155 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
155
156
156 actionview_instancetag_blank_option: Kérem válasszon
157 actionview_instancetag_blank_option: Kérem válasszon
157
158
@@ -131,6 +131,7 id:
131 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
131 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
133 not_a_regexp: "is not a valid regular expression"
133 not_a_regexp: "is not a valid regular expression"
134 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
134
135
135 actionview_instancetag_blank_option: Silakan pilih
136 actionview_instancetag_blank_option: Silakan pilih
136
137
@@ -136,6 +136,7 it:
136 cant_link_an_issue_with_a_descendant: "Una segnalazione non può essere collegata a una delle sue discendenti"
136 cant_link_an_issue_with_a_descendant: "Una segnalazione non può essere collegata a una delle sue discendenti"
137 earlier_than_minimum_start_date: "non può essere precedente a %{date} a causa di una precedente segnalazione"
137 earlier_than_minimum_start_date: "non può essere precedente a %{date} a causa di una precedente segnalazione"
138 not_a_regexp: "is not a valid regular expression"
138 not_a_regexp: "is not a valid regular expression"
139 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
139
140
140 actionview_instancetag_blank_option: Scegli
141 actionview_instancetag_blank_option: Scegli
141
142
@@ -152,6 +152,7 ja:
152 cant_link_an_issue_with_a_descendant: "親子関係にあるチケット間での関連の設定はできません"
152 cant_link_an_issue_with_a_descendant: "親子関係にあるチケット間での関連の設定はできません"
153 earlier_than_minimum_start_date: "を%{date}より前にすることはできません。先行するチケットがあります"
153 earlier_than_minimum_start_date: "を%{date}より前にすることはできません。先行するチケットがあります"
154 not_a_regexp: "is not a valid regular expression"
154 not_a_regexp: "is not a valid regular expression"
155 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
155
156
156 actionview_instancetag_blank_option: 選んでください
157 actionview_instancetag_blank_option: 選んでください
157
158
@@ -178,6 +178,7 ko:
178 cant_link_an_issue_with_a_descendant: "일감은 하위 일감과 연결할 없습니다."
178 cant_link_an_issue_with_a_descendant: "일감은 하위 일감과 연결할 없습니다."
179 earlier_than_minimum_start_date: "시작날짜 %{date}보다 앞선 시간으로 설정할 없습니다."
179 earlier_than_minimum_start_date: "시작날짜 %{date}보다 앞선 시간으로 설정할 없습니다."
180 not_a_regexp: "is not a valid regular expression"
180 not_a_regexp: "is not a valid regular expression"
181 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
181
182
182 actionview_instancetag_blank_option: 선택하세요
183 actionview_instancetag_blank_option: 선택하세요
183
184
@@ -135,6 +135,7 lt:
135 cant_link_an_issue_with_a_descendant: "Darbas negali būti susietas su viena savo darbo dalių"
135 cant_link_an_issue_with_a_descendant: "Darbas negali būti susietas su viena savo darbo dalių"
136 earlier_than_minimum_start_date: "negali būti anksčiau %{date} dėl ankstesnių darbų"
136 earlier_than_minimum_start_date: "negali būti anksčiau %{date} dėl ankstesnių darbų"
137 not_a_regexp: "is not a valid regular expression"
137 not_a_regexp: "is not a valid regular expression"
138 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
138
139
139 actionview_instancetag_blank_option: Prašom parinkti
140 actionview_instancetag_blank_option: Prašom parinkti
140
141
@@ -125,6 +125,7 lv:
125 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
125 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
126 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
126 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
127 not_a_regexp: "is not a valid regular expression"
127 not_a_regexp: "is not a valid regular expression"
128 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
128
129
129 actionview_instancetag_blank_option: Izvēlieties
130 actionview_instancetag_blank_option: Izvēlieties
130
131
@@ -132,6 +132,7 mk:
132 cant_link_an_issue_with_a_descendant: "Задача неможе да се поврзе со една од нејзините подзадачи"
132 cant_link_an_issue_with_a_descendant: "Задача неможе да се поврзе со една од нејзините подзадачи"
133 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
133 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
134 not_a_regexp: "is not a valid regular expression"
134 not_a_regexp: "is not a valid regular expression"
135 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
135
136
136 actionview_instancetag_blank_option: Изберете
137 actionview_instancetag_blank_option: Изберете
137
138
@@ -131,6 +131,7 mn:
131 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
131 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
133 not_a_regexp: "is not a valid regular expression"
133 not_a_regexp: "is not a valid regular expression"
134 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
134
135
135 actionview_instancetag_blank_option: Сонгоно уу
136 actionview_instancetag_blank_option: Сонгоно уу
136
137
@@ -129,6 +129,7 nl:
129 cant_link_an_issue_with_a_descendant: "Een issue kan niet gelinked worden met een subtask"
129 cant_link_an_issue_with_a_descendant: "Een issue kan niet gelinked worden met een subtask"
130 earlier_than_minimum_start_date: "kan niet eerder zijn dan %{date} wegens voorafgaande issues"
130 earlier_than_minimum_start_date: "kan niet eerder zijn dan %{date} wegens voorafgaande issues"
131 not_a_regexp: "is not a valid regular expression"
131 not_a_regexp: "is not a valid regular expression"
132 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
132
133
133 actionview_instancetag_blank_option: Selecteren
134 actionview_instancetag_blank_option: Selecteren
134
135
@@ -120,6 +120,7
120 cant_link_an_issue_with_a_descendant: "En sak kan ikke kobles mot en av sine undersaker"
120 cant_link_an_issue_with_a_descendant: "En sak kan ikke kobles mot en av sine undersaker"
121 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
121 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
122 not_a_regexp: "is not a valid regular expression"
122 not_a_regexp: "is not a valid regular expression"
123 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
123
124
124
125
125 actionview_instancetag_blank_option: Vennligst velg
126 actionview_instancetag_blank_option: Vennligst velg
@@ -139,6 +139,7 pl:
139 cant_link_an_issue_with_a_descendant: "Zagadnienie nie może zostać powiązane z jednym z własnych podzagadnień"
139 cant_link_an_issue_with_a_descendant: "Zagadnienie nie może zostać powiązane z jednym z własnych podzagadnień"
140 earlier_than_minimum_start_date: "nie może być wcześniej niż %{date} z powodu poprzedających zagadnień"
140 earlier_than_minimum_start_date: "nie może być wcześniej niż %{date} z powodu poprzedających zagadnień"
141 not_a_regexp: "is not a valid regular expression"
141 not_a_regexp: "is not a valid regular expression"
142 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
142
143
143 support:
144 support:
144 array:
145 array:
@@ -151,6 +151,7 pt-BR:
151 cant_link_an_issue_with_a_descendant: "Uma tarefa não pode ser relaciona a uma de suas subtarefas"
151 cant_link_an_issue_with_a_descendant: "Uma tarefa não pode ser relaciona a uma de suas subtarefas"
152 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
152 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
153 not_a_regexp: "is not a valid regular expression"
153 not_a_regexp: "is not a valid regular expression"
154 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
154
155
155 actionview_instancetag_blank_option: Selecione
156 actionview_instancetag_blank_option: Selecione
156
157
@@ -140,6 +140,7 pt:
140 cant_link_an_issue_with_a_descendant: "Não é possível ligar uma tarefa a uma sub-tarefa que lhe é pertencente"
140 cant_link_an_issue_with_a_descendant: "Não é possível ligar uma tarefa a uma sub-tarefa que lhe é pertencente"
141 earlier_than_minimum_start_date: "não pode ser antes de %{date} devido a tarefas precedentes"
141 earlier_than_minimum_start_date: "não pode ser antes de %{date} devido a tarefas precedentes"
142 not_a_regexp: "is not a valid regular expression"
142 not_a_regexp: "is not a valid regular expression"
143 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
143
144
144
145
145 actionview_instancetag_blank_option: Selecione
146 actionview_instancetag_blank_option: Selecione
@@ -126,6 +126,7 ro:
126 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
126 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
127 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
127 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
128 not_a_regexp: "is not a valid regular expression"
128 not_a_regexp: "is not a valid regular expression"
129 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
129
130
130 actionview_instancetag_blank_option: Selectați
131 actionview_instancetag_blank_option: Selectați
131
132
@@ -208,6 +208,7 ru:
208 cant_link_an_issue_with_a_descendant: "Задача не может быть связана со своей подзадачей"
208 cant_link_an_issue_with_a_descendant: "Задача не может быть связана со своей подзадачей"
209 earlier_than_minimum_start_date: "не может быть раньше %{date} из-за предыдущих задач"
209 earlier_than_minimum_start_date: "не может быть раньше %{date} из-за предыдущих задач"
210 not_a_regexp: "is not a valid regular expression"
210 not_a_regexp: "is not a valid regular expression"
211 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
211
212
212 support:
213 support:
213 array:
214 array:
@@ -130,6 +130,7 sk:
130 cant_link_an_issue_with_a_descendant: "Nemožno prepojiť úlohu s niektorou z podúloh"
130 cant_link_an_issue_with_a_descendant: "Nemožno prepojiť úlohu s niektorou z podúloh"
131 earlier_than_minimum_start_date: "nemôže byť skorší ako %{date} z dôvodu nadväznosti na predchádzajúce úlohy"
131 earlier_than_minimum_start_date: "nemôže byť skorší ako %{date} z dôvodu nadväznosti na predchádzajúce úlohy"
132 not_a_regexp: "is not a valid regular expression"
132 not_a_regexp: "is not a valid regular expression"
133 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
133
134
134 actionview_instancetag_blank_option: Vyberte
135 actionview_instancetag_blank_option: Vyberte
135
136
@@ -130,6 +130,7 sl:
130 cant_link_an_issue_with_a_descendant: "Zahtevek ne more biti povezan s svojo podnalogo"
130 cant_link_an_issue_with_a_descendant: "Zahtevek ne more biti povezan s svojo podnalogo"
131 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
131 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
132 not_a_regexp: "is not a valid regular expression"
132 not_a_regexp: "is not a valid regular expression"
133 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
133
134
134 actionview_instancetag_blank_option: Prosimo izberite
135 actionview_instancetag_blank_option: Prosimo izberite
135
136
@@ -131,6 +131,7 sq:
131 cant_link_an_issue_with_a_descendant: "Nje ceshtje nuk mund te lidhet me nenceshtje"
131 cant_link_an_issue_with_a_descendant: "Nje ceshtje nuk mund te lidhet me nenceshtje"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
132 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
133 not_a_regexp: "is not a valid regular expression"
133 not_a_regexp: "is not a valid regular expression"
134 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
134
135
135 actionview_instancetag_blank_option: Zgjidhni
136 actionview_instancetag_blank_option: Zgjidhni
136
137
@@ -134,6 +134,7 sr-YU:
134 cant_link_an_issue_with_a_descendant: "Problem ne može biti povezan sa jednim od svojih podzadataka"
134 cant_link_an_issue_with_a_descendant: "Problem ne može biti povezan sa jednim od svojih podzadataka"
135 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
135 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
136 not_a_regexp: "is not a valid regular expression"
136 not_a_regexp: "is not a valid regular expression"
137 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
137
138
138 actionview_instancetag_blank_option: Molim odaberite
139 actionview_instancetag_blank_option: Molim odaberite
139
140
@@ -132,6 +132,7 sr:
132 cant_link_an_issue_with_a_descendant: "Проблем не може бити повезан са једним од својих подзадатака"
132 cant_link_an_issue_with_a_descendant: "Проблем не може бити повезан са једним од својих подзадатака"
133 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
133 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
134 not_a_regexp: "is not a valid regular expression"
134 not_a_regexp: "is not a valid regular expression"
135 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
135
136
136 actionview_instancetag_blank_option: Молим одаберите
137 actionview_instancetag_blank_option: Молим одаберите
137
138
@@ -136,6 +136,7 sv:
136 cant_link_an_issue_with_a_descendant: "Ett ärende kan inte länkas till ett av dess underärenden"
136 cant_link_an_issue_with_a_descendant: "Ett ärende kan inte länkas till ett av dess underärenden"
137 earlier_than_minimum_start_date: "kan inte vara tidigare än% {datum} grund av föregående ärenden"
137 earlier_than_minimum_start_date: "kan inte vara tidigare än% {datum} grund av föregående ärenden"
138 not_a_regexp: "is not a valid regular expression"
138 not_a_regexp: "is not a valid regular expression"
139 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
139
140
140 direction: ltr
141 direction: ltr
141 date:
142 date:
@@ -129,6 +129,7 th:
129 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
129 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
130 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
130 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
131 not_a_regexp: "is not a valid regular expression"
131 not_a_regexp: "is not a valid regular expression"
132 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
132
133
133 actionview_instancetag_blank_option: กรุณาเลือก
134 actionview_instancetag_blank_option: กรุณาเลือก
134
135
@@ -145,6 +145,7 tr:
145 cant_link_an_issue_with_a_descendant: "Bir iş, alt işlerinden birine bağlanamaz"
145 cant_link_an_issue_with_a_descendant: "Bir iş, alt işlerinden birine bağlanamaz"
146 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
146 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
147 not_a_regexp: "is not a valid regular expression"
147 not_a_regexp: "is not a valid regular expression"
148 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
148 models:
149 models:
149
150
150 actionview_instancetag_blank_option: Lütfen Seçin
151 actionview_instancetag_blank_option: Lütfen Seçin
@@ -129,6 +129,7 uk:
129 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
129 cant_link_an_issue_with_a_descendant: "An issue can not be linked to one of its subtasks"
130 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
130 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
131 not_a_regexp: "is not a valid regular expression"
131 not_a_regexp: "is not a valid regular expression"
132 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
132
133
133 actionview_instancetag_blank_option: Оберіть
134 actionview_instancetag_blank_option: Оберіть
134
135
@@ -146,6 +146,7 vi:
146 cant_link_an_issue_with_a_descendant: "Một vấn đề không thể liên kết tới một trong số những tác vụ con của nó"
146 cant_link_an_issue_with_a_descendant: "Một vấn đề không thể liên kết tới một trong số những tác vụ con của nó"
147 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
147 earlier_than_minimum_start_date: "cannot be earlier than %{date} because of preceding issues"
148 not_a_regexp: "is not a valid regular expression"
148 not_a_regexp: "is not a valid regular expression"
149 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
149
150
150 direction: ltr
151 direction: ltr
151 date:
152 date:
@@ -188,6 +188,7
188 cant_link_an_issue_with_a_descendant: "議題無法被連結至自己的子任務"
188 cant_link_an_issue_with_a_descendant: "議題無法被連結至自己的子任務"
189 earlier_than_minimum_start_date: "不能早於 %{date} 因為有前置議題"
189 earlier_than_minimum_start_date: "不能早於 %{date} 因為有前置議題"
190 not_a_regexp: "is not a valid regular expression"
190 not_a_regexp: "is not a valid regular expression"
191 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
191
192
192 # You can define own errors for models or model attributes.
193 # You can define own errors for models or model attributes.
193 # The values :model, :attribute and :value are always available for interpolation.
194 # The values :model, :attribute and :value are always available for interpolation.
@@ -135,6 +135,7 zh:
135 cant_link_an_issue_with_a_descendant: "问题不能关联到它的子任务"
135 cant_link_an_issue_with_a_descendant: "问题不能关联到它的子任务"
136 earlier_than_minimum_start_date: "不能早于 %{date} 由于有前置问题"
136 earlier_than_minimum_start_date: "不能早于 %{date} 由于有前置问题"
137 not_a_regexp: "is not a valid regular expression"
137 not_a_regexp: "is not a valid regular expression"
138 open_issue_with_closed_parent: "An open issue cannot be attached to a closed parent task"
138
139
139 actionview_instancetag_blank_option: 请选择
140 actionview_instancetag_blank_option: 请选择
140
141
@@ -330,4 +330,13 class IssueSubtaskingTest < ActiveSupport::TestCase
330 parent.generate_child!(:estimated_hours => 7)
330 parent.generate_child!(:estimated_hours => 7)
331 assert_equal 12, parent.reload.total_estimated_hours
331 assert_equal 12, parent.reload.total_estimated_hours
332 end
332 end
333
334 def test_open_issue_with_closed_parent_should_not_validate
335 parent = Issue.generate!(:status_id => 5)
336 child = Issue.generate!
337
338 child.parent_issue_id = parent.id
339 assert !child.save
340 assert_include I18n.t("activerecord.errors.messages.open_issue_with_closed_parent"), child.errors.full_messages
341 end
333 end
342 end
@@ -1941,6 +1941,24 class IssueTest < ActiveSupport::TestCase
1941 assert !closed_statuses.empty?
1941 assert !closed_statuses.empty?
1942 end
1942 end
1943
1943
1944 def test_parent_issues_with_open_subtask_dont_allow_closed_statuses
1945 parent = Issue.generate!
1946 child = Issue.generate!(:parent_issue_id => parent.id)
1947
1948 allowed_statuses = parent.reload.new_statuses_allowed_to(users(:users_002))
1949 assert allowed_statuses.any?
1950 assert_equal [], allowed_statuses.select(&:is_closed?)
1951 end
1952
1953 def test_parent_issues_with_closed_subtask_allow_closed_statuses
1954 parent = Issue.generate!
1955 child = Issue.generate!(:parent_issue_id => parent.id, :status_id => 5)
1956
1957 allowed_statuses = parent.reload.new_statuses_allowed_to(users(:users_002))
1958 assert allowed_statuses.any?
1959 assert allowed_statuses.select(&:is_closed?).any?
1960 end
1961
1944 def test_reschedule_an_issue_without_dates
1962 def test_reschedule_an_issue_without_dates
1945 with_settings :non_working_week_days => [] do
1963 with_settings :non_working_week_days => [] do
1946 issue = Issue.new(:start_date => nil, :due_date => nil)
1964 issue = Issue.new(:start_date => nil, :due_date => nil)
General Comments 0
You need to be logged in to leave comments. Login now