]> wagnertech.de Git - mfinanz.git/blob - templates/webpages/common/_send_email_dialog.html
date error in mapping
[mfinanz.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 [%- IF is_final_version %]
27   <div class="flash_message_warning">[% LxERP.t8('This record is the final version. Changes have not been saved') %]</div>
28 [%- END %]
29
30 <table>
31  <tbody>
32   <tr>
33    <th align="right" nowrap>
34     [% IF is_invoice_mail  %]
35       [% LxERP.t8("Invoice to:") %]
36     [% ELSE %]
37       [% LxERP.t8("Recipients") %]
38     [% END %]
39    </th>
40    <td>
41     [% L.input_tag("email_form.to", email_form.to, size="80",readonly=is_invoice_mail ) %]
42     <span class="interactive cursor-pointer"        onclick="$('[data-toggle-recipients=1]').toggle()" data-toggle-recipients="1">[+]</span>
43     <span class="interactive cursor-pointer hidden" onclick="$('[data-toggle-recipients=1]').toggle()" data-toggle-recipients="1">[-]</span>
44    </td>
45   </tr>
46
47   [%- IF ALL_PARTNER_EMAIL_ADDRESSES.size %]
48    [%- FOREACH email = ALL_PARTNER_EMAIL_ADDRESSES %]
49     <tr class="hidden" data-toggle-recipients="1">
50      <th align="right" nowrap>
51       [%- IF loop.first %]
52        [% LxERP.t8("Other recipients") %]
53       [%- END %]
54      </th>
55      <td>
56        [% P.checkbox_tag("email_form.additional_to[]", label=email, value=email, checked="0") %]
57      </td>
58     </tr>
59    [%- END %]
60   [%- END %]
61
62  [%- IF ALL_EMPLOYEES.size %]
63   <tr class="hidden" data-toggle-recipients="1">
64    <th align="right" nowrap>[% LxERP.t8("CC to Employee") %]</th>
65    <td>[% L.select_tag('email_form.cc_employee', ALL_EMPLOYEES, value_key='login' title_key='safe_name', with_empty=1, style=style) %]</td>
66   </tr>
67  [%- END %]
68
69   <tr class="hidden" data-toggle-recipients="1">
70    <th align="right" nowrap>[% LxERP.t8("Cc") %]</th>
71    <td>[% L.input_tag("email_form.cc", email_form.cc, size="80") %]</td>
72   </tr>
73
74  [%- IF show_bcc %]
75   <tr class="hidden" data-toggle-recipients="1">
76    <th align="right" nowrap>[% LxERP.t8("Bcc") %]</th>
77    <td>[% L.input_tag("email_form.bcc", email_form.bcc, size="80") %]</td>
78   </tr>
79  [%- END %]
80
81   <tr>
82    <th align="right" nowrap>[% LxERP.t8("Subject") %]</th>
83    <td>[% L.input_tag("email_form.subject", email_form.subject, size="80") %]</td>
84   </tr>
85
86   <tr valign="top">
87    <th align="right" nowrap>[% LxERP.t8("Message") %]
88     <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>
89   </th>
90    <td>[% L.textarea_tag("email_form.message", email_form.message, style="height:150px", class="texteditor texteditor-space-for-toolbar") %]</td>
91   </tr>
92
93 [% IF INSTANCE_CONF.get_doc_storage %]
94   <tr>
95    <th align="right" nowrap>[% LxERP.t8("Send printout of record") %]</th>
96    <td>
97     [% 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") %]
98       [%- IF is_final_version %]
99         [% options       = [
100              [ "old_file", LxERP.t8("Send the last version for this record") ],
101              [ "no_file",  no_file_label ],
102            ] %]
103       [%- ELSE %]
104         [% options       = [
105              [ "old_file", LxERP.t8("Send the last or create the first version for this record") ],
106              [ "normal",   LxERP.t8("Create and send a new printout for this record") ],
107              [ "no_file",  no_file_label ],
108            ] %]
109       [%- END %]
110       [% L.select_tag("email_form.attachment_policy", options, onchange="kivi.SalesPurchase.activate_send_email_actions_regarding_printout()") %]
111    </td>
112   </tr>
113 [% END %]
114
115   <tr>
116    <th align="right" nowrap>
117 [% IF !INSTANCE_CONF.get_doc_storage %]
118     [% LxERP.t8("Attachment name") %]
119 [% END %]
120    </th>
121    <td>[% L.input_tag("email_form.attachment_filename", email_form.attachment_filename, size="80") %]</td>
122   </tr>
123
124 [% IF INSTANCE_CONF.get_doc_storage %]
125   [% PROCESS attach_file_list
126              files = FILES.files
127              checked = INSTANCE_CONF.get_email_attachment_record_files_checked
128              label = LxERP.t8("Record's files") %]
129
130   [% PROCESS attach_file_list
131              files = FILES.vc_files
132              checked = INSTANCE_CONF.get_email_attachment_vc_files_checked
133              label = is_customer ? LxERP.t8("Files from customer") : LxERP.t8("Files from vendor") %]
134
135   [% PROCESS attach_file_list
136              files = FILES.part_files
137              checked = INSTANCE_CONF.get_email_attachment_part_files_checked
138              label = LxERP.t8("Files from parts") %]
139
140   [% PROCESS attach_file_list
141              files = FILES.project_files
142              label = LxERP.t8("Files from projects") %]
143 [% END %]
144  </tbody>
145 </table>
146
147 <div id="email_form_print_options"></div>
148
149 <p>
150  [% L.button_tag(email_form.js_send_function, LxERP.t8("Send email"), id='send_email') %]
151  [% L.button_tag("\$('#send_email_dialog').dialog('close');", LxERP.t8("Abort")) %]
152 </p>