diff --git a/app/views/admin/p_documents/send_by_mail.html.haml b/app/views/admin/p_documents/send_by_mail.html.haml index a8a8e52..1e459ba 100644 --- a/app/views/admin/p_documents/send_by_mail.html.haml +++ b/app/views/admin/p_documents/send_by_mail.html.haml @@ -17,6 +17,10 @@ %table.table.table-striped + + -emails = [] + + -p_contacts = @p_customer.p_contacts -@p_customer.particulars.each do |p| -p_contacts = p_contacts + p.p_contacts @@ -30,6 +34,7 @@ %td =p_c.email + -emails << p_c.email %td =p_c.civilite @@ -42,10 +47,24 @@ %td =p_c.p_contact_types.map { |pct| pct.name}.join(" | ") + + -if !emails.include?(@p_customer.email) + %tr + %td + = check_box_tag :"emails[]", @p_customer.email, (true if params[:emails].include?(@p_customer.email.to_s)), {:id => "emails_#{@p_customer.email}"} + + %td + =@p_customer.email + + %td{:colspan => 4} + Email général de la fiche client + -if p_contacts.uniq.size > 0 - =submit_tag "Envoyer le document par mail", :class => "btn btn-primary" \ No newline at end of file + =submit_tag "Envoyer le document par mail", :class => "btn btn-primary" + -else + Aucun contact pour ce client. \ No newline at end of file