]> wagnertech.de Git - mfinanz.git/blob - templates/webpages/email_journal/show.html
date error in mapping
[mfinanz.git] / templates / webpages / email_journal / show.html
1 [% USE HTML %][% USE L %][% USE LxERP %][%- USE P -%] [% USE T8 %]
2
3  <h1>[% FORM.title %]</h1>
4
5 [%- INCLUDE 'common/flash.html' %]
6
7 <div class="tabwidget" id="email_tabs">
8   <ul>
9     <li><a href="#ui-tabs-basic-data">[% 'Basic Data' | $T8 %]</a></li>
10     <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=EmailJournal&object_id=[% HTML.url(SELF.entry.id) %]">[% 'Linked Records' | $T8 %]</a></li>
11   </ul>
12
13 [% PROCESS "email_journal/tabs/basic_data.html" %]
14 </div> <!-- /.tabwidget -->
15
16  [% SET attachments = SELF.entry.attachments_sorted %]
17   <h2>[% LxERP.t8("Attachments") %]</h2>
18  [% IF attachments.size %]
19
20   <table id="email_journal_details" class="email_journal_details">
21    <thead>
22     <tr>
23      <th>[% LxERP.t8("Attachment name") %]</th>
24      <th>[% LxERP.t8("MIME type") %]</th>
25      <th>[% LxERP.t8("Size") %]</th>
26     </tr>
27    </thead>
28
29    <tbody>
30     [% FOREACH attachment = attachments %]
31      <tr class="listrow">
32       <td>[% L.link(SELF.url_for(action="download_attachment", id=attachment.id), attachment.name) %]</td>
33       <td>[% HTML.escape(attachment.mime_type) %]</td>
34       <td>[% HTML.escape(LxERP.format_amount(attachment.content.length, 0)) %]</td>
35      </tr>
36     [% END %]
37    </tbody>
38   </table>
39  [% END %]
40
41 [% IF SELF.entry.status == 'imported' %]
42 <form method="post" action="controller.pl" id="record_action_form">
43   [% L.hidden_tag('email_journal_id', SELF.entry.id) %]
44   [% L.hidden_tag('back_to', back_to) %]
45   <h2>[% LxERP.t8("Email Journal Workflow") %]</h2>
46
47   <table> <tr>
48     <div style="display:flex">
49       <div>
50       [% L.select_tag('attachment_id',
51            attachments, value_key='id', title_key='name',
52            default = attachments.0.id,
53            with_empty=1, empty_value='', empty_title=LxERP.t8("No attachment"),
54            'data-title'=LxERP.t8("Attachment"), class="wi-normal",
55            onchange='kivi.EmailJournal.update_attachment_preview();'
56            )
57         %]
58       </div>
59
60       <div>
61       [% L.select_tag('action_selection',
62          [
63            {value => "workflow_record", name => LxERP.t8("Create from Workflow")},
64            {value => "linking_record",  name => LxERP.t8("Linking to Record")},
65            {value => "new_record",      name => LxERP.t8("Create new")},
66            {value => "template_record", name => LxERP.t8("Create from Record Template")},
67          ],
68          value_key='value', title_key='name',
69          class="wi-normal",
70          onchange='kivi.EmailJournal.update_email_workflow_options();'
71          ) %]
72       </div>
73
74       <div>
75       [% L.select_tag('customer_vendor_selection',
76          [
77            {value => "customer", name => LxERP.t8("Sales")},
78            {value => "vendor",   name => LxERP.t8("Purchase")},
79          ],
80          default = CV_TYPE_FOUND,
81          value_key='value', title_key='name',
82          class="wi-verysmall",
83          onchange='kivi.EmailJournal.update_email_workflow_options();'
84          ) %]
85       </div>
86
87       <div>
88       [% FOREACH customer_vendor = ['customer', 'vendor'] %]
89       <div id="[% customer_vendor _ "_workflow_record_types_div" %]"
90         style=[% IF customer_vendor == CV_TYPE_FOUND %] "display:block" [% ELSE %] "display:none" [% END %]
91         >
92
93         [%
94           SET options = [];
95           FOREACH record_info = RECORD_TYPES_WITH_INFO;
96             IF (record_info.customervendor == customer_vendor && record_info.can_workflow && !record_info.is_template);
97               options.push({value => record_info.record_type, name => record_info.text});
98             END;
99           END;
100         %]
101       [% L.select_tag(customer_vendor _ '_workflow_record_type_selection',
102          options,
103          value_key='value', title_key='name',
104          with_empty=1, empty_value='', empty_title=LxERP.t8("Select record type"),
105          onchange='kivi.EmailJournal.update_record_list();'
106          ) %]
107       </div>
108       <div id="[% customer_vendor _ "_new_record_types_div" %]"
109         style="display:none"
110         >
111         [%
112           SET options = [];
113           FOREACH record_info = RECORD_TYPES_WITH_INFO;
114             IF (record_info.customervendor == customer_vendor && !record_info.workflow_needed && !record_info.is_template);
115               options.push({value => record_info.record_type, name => record_info.text});
116             END;
117           END;
118         %]
119       [% L.select_tag(customer_vendor _ '_new_record_type_selection',
120          options,
121          value_key='value', title_key='name',
122          with_empty=1, empty_value='', empty_title=LxERP.t8("Select record type"),
123          onchange='kivi.EmailJournal.update_record_list();'
124          ) %]
125       </div>
126       <div id="[% customer_vendor _ "_linking_record_types_div" %]"
127         style="display:none"
128         >
129         [%
130           SET options = [];
131           FOREACH record_info = RECORD_TYPES_WITH_INFO;
132             IF (record_info.customervendor == customer_vendor && !record_info.is_template);
133               options.push({value => record_info.record_type, name => record_info.text});
134             END;
135           END;
136         %]
137       [% L.select_tag(customer_vendor _ '_linking_record_type_selection',
138          options,
139          value_key='value', title_key='name',
140          with_empty=1, empty_value='', empty_title=LxERP.t8("Select record type"),
141          onchange='kivi.EmailJournal.update_record_list();'
142          ) %]
143       </div>
144
145
146       <div id="[% customer_vendor _ "_template_record_types_div" %]"
147         style="display:none"
148         >
149         [%
150           SET options = [];
151           FOREACH record_info = RECORD_TYPES_WITH_INFO;
152             IF (record_info.customervendor == customer_vendor && record_info.is_template);
153               options.push({value => record_info.record_type, name => record_info.text});
154             END;
155           END;
156         %]
157       [% L.select_tag(customer_vendor _ '_template_record_type_selection',
158          options,
159          value_key='value', title_key='name',
160          with_empty=1, empty_value='', empty_title=LxERP.t8("Select record type"),
161          onchange='kivi.EmailJournal.update_record_list();'
162          ) %]
163       </div>
164       [% END %]
165       </div>
166     </div>
167
168   </tr> <tr>
169     <td>
170     <div id="record_selection_div">
171       <div style="display:flex">
172         [% FOREACH cv_option = [
173              ['customer', 'Customer'],
174              ['vendor',   'Vendor'  ],
175              ] %]
176         [% SET cv_type        = cv_option.0 %]
177         [% SET cv_name        = cv_option.1 %]
178         <div
179           id="[% cv_type _ "_div" %]"
180           style=[% IF cv_type == CV_TYPE_FOUND %] "display:block" [% ELSE %] "display:none" [% END %]
181           >
182           [% P.customer_vendor.picker(
183                cv_type _ "_id",
184                cv_type == 'customer' ? CUSTOMER : VENDOR,
185                type=cv_type, class="wi-normal", placeholder=LxERP.t8(cv_name)
186                onchange='kivi.EmailJournal.update_record_list();'
187                ) %]
188         </div>
189         [% END %]
190
191         <div id="record_number_div">
192           [% L.input_tag('record_number', '',
193              class="wi-normal", placeholder=LxERP.t8("Record number")
194              onchange='kivi.EmailJournal.update_record_list();'
195              ) %]
196         </div>
197
198         <div id="with_closed_div">
199           [% L.select_tag('with_closed',
200              [
201                {value => "1", name => LxERP.t8("With closed")},
202                {value => "0", name => LxERP.t8("Only open")},
203              ],
204              default = 0, value_key='value', title_key='name',
205              onchange='kivi.EmailJournal.update_record_list();'
206              ) %]
207         </div>
208       </div>
209       <!-- gets updated on $(document).ready -->
210       <div id="record_div">
211         <div id="record_toggle_closed"
212           class="record_toggle toggle_panel control-panel" style="display:block;">
213           <a href="#" onClick='javascript:$(".record_toggle").toggle()'
214              class="button toggle off neutral">
215             [% LxERP.t8('Show Records') %]
216           </a>
217         </div><!-- /.record_toggle -->
218         <div id="record_toggle_open"
219           class="record_toggle toggle_panel control-panel" style="display:none;">
220           <a href="#" onClick='javascript:$(".record_toggle").toggle()'
221              class="button toggle on neutral with-panel">
222             [% LxERP.t8('Hide Records') %]
223           </a>
224           <div class="toggle_panel_block">
225             <div id="record_list">[% LxERP.t8("Loading...") %]</div>
226           </div>
227         </div><!-- /.record_toggle -->
228       </div><!-- record_div -->
229     </div><!-- record_selection_div -->
230     <div id="new_record_div" class="input-panel" style="display:none;min-width:0;margin:0">
231         [% L.button_tag('kivi.EmailJournal.apply_action_with_attachment();',
232           LxERP.t8('Apply with Attachment')) %]
233     </div>
234     </td>
235
236   </tr> </table>
237 </form>
238
239 <!-- kivi.EmailJournal.update_attachment_preview -->
240 <div id="attachment_preview"></div>
241 [% END %]
242
243 <script type="text/javascript">
244   $(document).ready(function() {
245     kivi.EmailJournal.update_email_workflow_options();
246     kivi.EmailJournal.update_attachment_preview();
247   });
248 </script>