[fix 363] Dossier: remove next_step! role var
This commit is contained in:
parent
201862d450
commit
e78f5b3a2d
1 changed files with 20 additions and 37 deletions
|
@ -144,17 +144,11 @@ class Dossier < ActiveRecord::Base
|
||||||
champs.joins(', types_de_piece_justificative').where("pieces_justificatives.type_de_piece_justificative_id = types_de_piece_justificative.id AND types_de_piece_justificative.procedure_id = #{procedure.id}").order('order_place ASC')
|
champs.joins(', types_de_piece_justificative').where("pieces_justificatives.type_de_piece_justificative_id = types_de_piece_justificative.id AND types_de_piece_justificative.procedure_id = #{procedure.id}").order('order_place ASC')
|
||||||
end
|
end
|
||||||
|
|
||||||
def next_step! role, action, motivation = nil
|
def next_step!(action, motivation = nil)
|
||||||
unless %w(receive refuse without_continuation close).include?(action)
|
unless %w(receive refuse without_continuation close).include?(action)
|
||||||
fail 'action is not valid'
|
fail 'action is not valid'
|
||||||
end
|
end
|
||||||
|
|
||||||
unless %w(gestionnaire).include?(role)
|
|
||||||
fail 'role is not valid'
|
|
||||||
end
|
|
||||||
|
|
||||||
case role
|
|
||||||
when 'gestionnaire'
|
|
||||||
case action
|
case action
|
||||||
when 'close'
|
when 'close'
|
||||||
if en_instruction?
|
if en_instruction?
|
||||||
|
@ -162,32 +156,21 @@ class Dossier < ActiveRecord::Base
|
||||||
save
|
save
|
||||||
|
|
||||||
accepte!
|
accepte!
|
||||||
|
|
||||||
if motivation
|
|
||||||
self.motivation = motivation
|
|
||||||
save
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
when 'refuse'
|
when 'refuse'
|
||||||
if en_instruction?
|
if en_instruction?
|
||||||
refuse!
|
refuse!
|
||||||
|
|
||||||
if motivation
|
|
||||||
self.motivation = motivation
|
|
||||||
save
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
when 'without_continuation'
|
when 'without_continuation'
|
||||||
if en_instruction?
|
if en_instruction?
|
||||||
sans_suite!
|
sans_suite!
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if motivation
|
if motivation
|
||||||
self.motivation = motivation
|
self.motivation = motivation
|
||||||
save
|
save
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
state
|
state
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue