"alle" E-Mail-Adressen per Anhaken als Empfänger hinzufügen können
[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       [% IF checked %]
16         [% P.checkbox_tag("email_form.attach_file_ids[]", label=file.db_file.file_name, value=file.db_file.id, checked="1") %]
17       [% ELSE %]
18         [% P.checkbox_tag("email_form.attach_file_ids[]", label=file.db_file.file_name, value=file.db_file.id, checked="0") %]
19       [% END %]
20      </td>
21     </tr>
22    [% END %]
23   [% END %]
24 [% END %]
25
26 <table>
27  <tbody>
28   <tr>
29    <th align="right" nowrap>
30     [% IF is_invoice_mail  %]
31       [% LxERP.t8("Invoice to:") %]
32     [% ELSE %]
33       [% LxERP.t8("Recipients") %]
34     [% END %]
35    </th>
36    <td>
37     [% L.input_tag("email_form.to", email_form.to, size="80",readonly=is_invoice_mail ) %]
38     <span class="interactive cursor-pointer"        onclick="$('[data-toggle-recipients=1]').toggle()" data-toggle-recipients="1">[+]</span>
39     <span class="interactive cursor-pointer hidden" onclick="$('[data-toggle-recipients=1]').toggle()" data-toggle-recipients="1">[-]</span>
40    </td>
41   </tr>
42
43   [%- IF ALL_PARTNER_EMAIL_ADDRESSES.size %]
44    [%- FOREACH email = ALL_PARTNER_EMAIL_ADDRESSES %]
45     <tr class="hidden" data-toggle-recipients="1">
46      <th align="right" nowrap>
47       [%- IF loop.first %]
48        [% LxERP.t8("Other recipients") %]
49       [%- END %]
50      </th>
51      <td>
52        [% P.checkbox_tag("email_form.additional_to[]", label=email, value=email, checked="0") %]
53      </td>
54     </tr>
55    [%- END %]
56   [%- END %]
57
58  [%- IF ALL_EMPLOYEES.size %]
59   <tr class="hidden" data-toggle-recipients="1">
60    <th align="right" nowrap>[% LxERP.t8("CC to Employee") %]</th>
61    <td>[% L.select_tag('email_form.cc_employee', ALL_EMPLOYEES, value_key='login' title_key='safe_name', with_empty=1, style=style) %]</td>
62   </tr>
63  [%- END %]
64
65   <tr class="hidden" data-toggle-recipients="1">
66    <th align="right" nowrap>[% LxERP.t8("Cc") %]</th>
67    <td>[% L.input_tag("email_form.cc", email_form.cc, size="80") %]</td>
68   </tr>
69
70  [%- IF show_bcc %]
71   <tr class="hidden" data-toggle-recipients="1">
72    <th align="right" nowrap>[% LxERP.t8("Bcc") %]</th>
73    <td>[% L.input_tag("email_form.bcc", email_form.bcc, size="80") %]</td>
74   </tr>
75  [%- END %]
76
77   <tr>
78    <th align="right" nowrap>[% LxERP.t8("Subject") %]</th>
79    <td>[% L.input_tag("email_form.subject", email_form.subject, size="80") %]</td>
80   </tr>
81
82   <tr valign="top">
83    <th align="right" nowrap>[% LxERP.t8("Message") %]
84     <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>
85   </th>
86    <td>[% L.textarea_tag("email_form.message", email_form.message, rows="15", cols="80", class="texteditor texteditor-space-for-toolbar") %]</td>
87   </tr>
88
89 [% IF INSTANCE_CONF.get_doc_storage %]
90   <tr>
91    <th align="right" nowrap>[% LxERP.t8("Send printout of record") %]</th>
92    <td>
93     [% 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") ;
94            options       = [
95              [ "old_file", LxERP.t8("Send the last or create the first version for this record") ],
96              [ "normal",   LxERP.t8("Create and send a new printout for this record") ],
97              [ "no_file",  no_file_label ],
98            ] ;
99        L.select_tag("email_form.attachment_policy", options, onchange="kivi.SalesPurchase.activate_send_email_actions_regarding_printout()") %]
100    </td>
101   </tr>
102 [% END %]
103
104   <tr>
105    <th align="right" nowrap>
106 [% IF !INSTANCE_CONF.get_doc_storage %]
107     [% LxERP.t8("Attachment name") %]
108 [% END %]
109    </th>
110    <td>[% L.input_tag("email_form.attachment_filename", email_form.attachment_filename, size="80") %]</td>
111   </tr>
112
113 [% IF INSTANCE_CONF.get_doc_storage %]
114   [% PROCESS attach_file_list
115              files = FILES.files
116              checked = INSTANCE_CONF.get_email_attachment_record_files_checked
117              label = LxERP.t8("Record's files") %]
118
119   [% PROCESS attach_file_list
120              files = FILES.vc_files
121              checked = INSTANCE_CONF.get_email_attachment_vc_files_checked
122              label = is_customer ? LxERP.t8("Files from customer") : LxERP.t8("Files from vendor") %]
123
124   [% PROCESS attach_file_list
125              files = FILES.part_files
126              checked = INSTANCE_CONF.get_email_attachment_part_files_checked
127              label = LxERP.t8("Files from parts") %]
128
129   [% PROCESS attach_file_list
130              files = FILES.project_files
131              label = LxERP.t8("Files from projects") %]
132 [% END %]
133  </tbody>
134 </table>
135
136 <div id="email_form_print_options"></div>
137
138 <p>
139  [% L.button_tag(email_form.js_send_function, LxERP.t8("Send email"), id='send_email') %]
140  [% L.button_tag("\$('#send_email_dialog').dialog('close');", LxERP.t8("Abort")) %]
141 </p>