-
+ <% page.attributes.each do |attribute| %>
+
- + <%= t( + "helpers.label.#{resource_name}.#{attribute.name}", + default: attribute.name.titleize, + ) %> + + +
- <%= render_field attribute %> + <% end %> +
diff --git a/app/controllers/manager/dossiers_controller.rb b/app/controllers/manager/dossiers_controller.rb index d42d335ce..23068d4c4 100644 --- a/app/controllers/manager/dossiers_controller.rb +++ b/app/controllers/manager/dossiers_controller.rb @@ -1,4 +1,12 @@ module Manager class DossiersController < Manager::ApplicationController + def change_state_to_instruction + dossier = Dossier.find(params[:id]) + dossier.update(state: 'en_instruction', processed_at: nil, motivation: nil) + dossier.attestation&.destroy + logger.info("Le dossier #{dossier.id} est repassé en instruction par #{current_administration.email}") + flash[:notice] = "Le dossier #{dossier.id} est repassé en instruction" + redirect_to manager_dossier_path(dossier) + end end end diff --git a/app/lib/pipedrive/deal_adapter.rb b/app/lib/pipedrive/deal_adapter.rb index 68f9725c9..b86654771 100644 --- a/app/lib/pipedrive/deal_adapter.rb +++ b/app/lib/pipedrive/deal_adapter.rb @@ -22,8 +22,8 @@ class Pipedrive::DealAdapter end def self.get_deals_ids_for_person(person_id) - Pipedrive::API.get_deals_for_person(person_id) - .map { |datum| datum['id'] } + deals = Pipedrive::API.get_deals_for_person(person_id) || [] + deals.map { |datum| datum['id'] } end def self.update_deal_owner_and_stage(deal_id, owner_id, stage_id) diff --git a/app/views/dossiers/_messagerie.html.haml b/app/views/dossiers/_messagerie.html.haml index ca223136d..4c1c22da6 100644 --- a/app/views/dossiers/_messagerie.html.haml +++ b/app/views/dossiers/_messagerie.html.haml @@ -20,7 +20,7 @@ = render partial: 'dossiers/commentaires/form', locals: { dossier_facade: @facade } .last-commentaire.clearfix.hidden-print - - if last_comment = dossier_facade.commentaires.first + - if last_comment = dossier_facade.commentaires.last %div DERNIER MESSAGE = render partial: 'dossiers/commentaires/commentaire', object: last_comment diff --git a/app/views/manager/application/_navigation.html.erb b/app/views/manager/application/_navigation.html.erb index 60c28e051..bb217b350 100644 --- a/app/views/manager/application/_navigation.html.erb +++ b/app/views/manager/application/_navigation.html.erb @@ -12,7 +12,7 @@ as defined by the routes in the `admin/` namespace