Rechnungsversand per E-Mail
[kivitendo-erp.git] / templates / webpages / common / _send_email_dialog.html
1 [%- USE HTML %][%- USE LxERP -%][%- USE L -%][%- USE P -%]
2 [%- SET have_files = 0 %]
3
4 [% BLOCK attach_file_list %]
5   [% IF files.as_list.size %]
6    [% SET have_files = 1 ;
7       FOREACH file = files.as_list %]
8     <tr>
9      <th align="right" nowrap>
10       [% IF loop.first %]
11        [% label %]
12       [% END %]
13      </th>
14      <td>
15       [% P.checkbox_tag("email_form.attach_file_ids[]", label=file.db_file.file_name, value=file.db_file.id, checked="1") %]
16      </td>
17     </tr>
18    [% END %]
19   [% END %]
20 [% END %]
21
22 <table>
23  <tbody>
24   <tr>
25    <th align="right" nowrap>
26     [% IF is_invoice_mail  %]
27       [% LxERP.t8("Invoice to:") %]
28     [% ELSE %]
29       [% LxERP.t8("Recipients") %]
30     [% END %]
31    </th>
32    <td>
33     [% L.input_tag("email_form.to", email_form.to, size="80",readonly=is_invoice_mail ) %]
34     <span class="interactive cursor-pointer"        onclick="$('[data-toggle-recipients=1]').toggle()" data-toggle-recipients="1">[+]</span>
35     <span class="interactive cursor-pointer hidden" onclick="$('[data-toggle-recipients=1]').toggle()" data-toggle-recipients="1">[-]</span>
36    </td>
37   </tr>
38
39   <tr class="hidden" data-toggle-recipients="1">
40    <th align="right" nowrap>[% LxERP.t8("Cc") %]</th>
41    <td>[% L.input_tag("email_form.cc", email_form.cc, size="80") %]</td>
42   </tr>
43
44  [%- IF show_bcc %]
45   <tr class="hidden" data-toggle-recipients="1">
46    <th align="right" nowrap>[% LxERP.t8("Bcc") %]</th>
47    <td>[% L.input_tag("email_form.bcc", email_form.bcc, size="80") %]</td>
48   </tr>
49  [%- END %]
50
51   <tr>
52    <th align="right" nowrap>[% LxERP.t8("Subject") %]</th>
53    <td>[% L.input_tag("email_form.subject", email_form.subject, size="80") %]</td>
54   </tr>
55
56   <tr valign="top">
57    <th align="right" nowrap>[% LxERP.t8("Message") %]
58     <sup> [% L.link("generictranslations.pl?action=edit_email_strings", "1)", title=LxERP.t8('Tired of copying always nice phrases for this message? Click here to use the new preset message option!'), target="_blank") %]</sup>
59   </th>
60    <td>[% L.textarea_tag("email_form.message", email_form.message, rows="15" cols="80" wrap="soft") %]</td>
61   </tr>
62
63 [% IF INSTANCE_CONF.get_doc_storage %]
64   <tr>
65    <th align="right" nowrap>[% LxERP.t8("Send printout of record") %]</th>
66    <td>
67     [% SET no_file_label = have_files ? LxERP.t8("Don't include a printout of the record with the email, only selected files") : LxERP.t8("Don't include a printout of the record with the email") ;
68            options       = [
69              [ "normal",   LxERP.t8("Create and send a new printout for this record") ],
70              [ "old_file", LxERP.t8("Send the last printout created for this record") ],
71              [ "no_file",  no_file_label ],
72            ] ;
73        L.select_tag("email_form.attachment_policy", options, onchange="kivi.SalesPurchase.activate_send_email_actions_regarding_printout()") %]
74    </td>
75   </tr>
76 [% END %]
77
78   <tr>
79    <th align="right" nowrap>
80 [% IF !INSTANCE_CONF.get_doc_storage %]
81     [% LxERP.t8("Attachment name") %]
82 [% END %]
83    </th>
84    <td>[% L.input_tag("email_form.attachment_filename", email_form.attachment_filename, size="80") %]</td>
85   </tr>
86
87 [% IF INSTANCE_CONF.get_doc_storage %]
88   [% PROCESS attach_file_list
89              files = FILES.files
90              label = LxERP.t8("Record's files") %]
91
92   [% PROCESS attach_file_list
93              files = FILES.vc_files
94              label = is_customer ? LxERP.t8("Files from customer") : LxERP.t8("Files from vendor") %]
95
96   [% PROCESS attach_file_list
97              files = FILES.part_files
98              label = LxERP.t8("Files from parts") %]
99 [% END %]
100  </tbody>
101 </table>
102
103 <div id="email_form_print_options"></div>
104
105 <p>
106  [% L.button_tag(email_form.js_send_function, LxERP.t8("Send email")) %]
107  [% L.button_tag("\$('#send_email_dialog').dialog('close');", LxERP.t8("Abort")) %]
108 </p>