38 |
38 |
</table>
|
39 |
39 |
[% END %]
|
40 |
40 |
|
41 |
|
[% IF SELF.entry.status == 'imported' || SELF.entry.status == 'record_imported' %]
|
|
41 |
[% IF SELF.entry.status == 'imported' %]
|
42 |
42 |
<form method="post" action="controller.pl" id="record_action_form">
|
43 |
43 |
[% L.hidden_tag('email_journal_id', SELF.entry.id) %]
|
|
44 |
<h2>[% LxERP.t8("Email Journal Workflow") %]</h2>
|
44 |
45 |
|
45 |
46 |
<table> <tr>
|
46 |
|
<td>
|
|
47 |
<div style="display:flex">
|
|
48 |
<div>
|
47 |
49 |
[% L.select_tag('attachment_id',
|
48 |
50 |
attachments, value_key='id', title_key='name',
|
49 |
51 |
default = attachments.0.id,
|
... | ... | |
52 |
54 |
onchange='kivi.EmailJournal.update_attachment_preview();'
|
53 |
55 |
)
|
54 |
56 |
%]
|
55 |
|
</td>
|
|
57 |
</div>
|
56 |
58 |
|
57 |
|
<td>
|
|
59 |
<div>
|
|
60 |
[% L.select_tag('action_selection',
|
|
61 |
[
|
|
62 |
{value => "workflow_record", name => LxERP.t8("Create from Workflow")},
|
|
63 |
{value => "linking_record", name => LxERP.t8("Linking to Record")},
|
|
64 |
{value => "new_record", name => LxERP.t8("Create new")},
|
|
65 |
{value => "template_record", name => LxERP.t8("Create from Record Template")},
|
|
66 |
],
|
|
67 |
value_key='value', title_key='name',
|
|
68 |
class="wi-normal",
|
|
69 |
onchange='kivi.EmailJournal.update_email_workflow_options();'
|
|
70 |
) %]
|
|
71 |
</div>
|
|
72 |
|
|
73 |
<div>
|
58 |
74 |
[% L.select_tag('customer_vendor_selection',
|
59 |
75 |
[
|
60 |
76 |
{value => "customer", name => LxERP.t8("Sales")},
|
... | ... | |
63 |
79 |
default = CV_TYPE_FOUND,
|
64 |
80 |
value_key='value', title_key='name',
|
65 |
81 |
class="wi-verysmall",
|
66 |
|
onchange='kivi.EmailJournal.update_customer_vendor_selection();'
|
|
82 |
onchange='kivi.EmailJournal.update_email_workflow_options();'
|
67 |
83 |
) %]
|
68 |
|
</td>
|
|
84 |
</div>
|
69 |
85 |
|
70 |
|
<td>
|
71 |
|
[% FOREACH cv_option = [
|
72 |
|
['customer', 'Customer', 1],
|
73 |
|
['vendor', 'Vendor', 0],
|
74 |
|
] %]
|
75 |
|
[% SET cv_type = cv_option.0 %]
|
76 |
|
[% SET cv_name = cv_option.1 %]
|
77 |
|
[% SET cv_is_cusotmer = cv_option.2 %]
|
78 |
|
<div
|
79 |
|
id="[% cv_type _ "_div" %]" class="col"
|
80 |
|
style=[% IF cv_type == CV_TYPE_FOUND %] "display:block" [% ELSE %] "display:none" [% END %]
|
|
86 |
<div>
|
|
87 |
[% FOREACH customer_vendor = ['customer', 'vendor'] %]
|
|
88 |
<div id="[% customer_vendor _ "_workflow_record_types_div" %]"
|
|
89 |
style=[% IF customer_vendor == CV_TYPE_FOUND %] "display:block" [% ELSE %] "display:none" [% END %]
|
81 |
90 |
>
|
82 |
|
[% P.customer_vendor.picker(
|
83 |
|
cv_type _ "_id",
|
84 |
|
CUSTOMER_VENDOR.is_customer == cv_is_cusotmer ? CUSTOMER_VENDOR : undef,
|
85 |
|
type=cv_type, class="wi-normal", placeholder=LxERP.t8(cv_name)
|
86 |
|
) %]
|
87 |
|
</div>
|
88 |
|
[% END %]
|
89 |
|
</td>
|
90 |
91 |
|
91 |
|
<td>
|
92 |
|
[% L.select_tag('action_selection',
|
93 |
|
[
|
94 |
|
{value => "workflow", name => LxERP.t8("Create from Workflow")},
|
95 |
|
{value => "linking", name => LxERP.t8("Linking to Record")},
|
96 |
|
{value => "create_new", name => LxERP.t8("Create new")},
|
97 |
|
],
|
|
92 |
[%
|
|
93 |
SET options = [];
|
|
94 |
FOREACH record_info = RECORD_TYPES_WITH_INFO;
|
|
95 |
IF (record_info.customervendor == customer_vendor && record_info.can_workflow);
|
|
96 |
options.push({value => record_info.record_type, name => record_info.text});
|
|
97 |
END;
|
|
98 |
END;
|
|
99 |
%]
|
|
100 |
[% L.select_tag(customer_vendor _ '_workflow_record_type_selection',
|
|
101 |
options,
|
98 |
102 |
value_key='value', title_key='name',
|
99 |
|
class="wi-normal",
|
100 |
|
onchange='kivi.EmailJournal.update_action_selection();'
|
|
103 |
with_empty=1, empty_value='', empty_title=LxERP.t8("Select record type"),
|
|
104 |
onchange='kivi.EmailJournal.update_record_list();'
|
101 |
105 |
) %]
|
102 |
|
</td>
|
103 |
|
|
104 |
|
<td>
|
105 |
|
[% FOREACH customer_vendor = ['customer', 'vendor'] %]
|
106 |
|
<div id="[% customer_vendor _ "_record_types_div" %]" class="col"
|
107 |
|
style=[% IF customer_vendor == CV_TYPE_FOUND %] "display:block" [% ELSE %] "display:none" [% END %]
|
|
106 |
</div>
|
|
107 |
<div id="[% customer_vendor _ "_new_record_types_div" %]"
|
|
108 |
style="display:none"
|
|
109 |
>
|
|
110 |
[%
|
|
111 |
SET options = [];
|
|
112 |
FOREACH record_info = RECORD_TYPES_WITH_INFO;
|
|
113 |
IF (record_info.customervendor == customer_vendor && !record_info.workflow_needed);
|
|
114 |
options.push({value => record_info.record_type, name => record_info.text});
|
|
115 |
END;
|
|
116 |
END;
|
|
117 |
%]
|
|
118 |
[% L.select_tag(customer_vendor _ '_new_record_type_selection',
|
|
119 |
options,
|
|
120 |
value_key='value', title_key='name',
|
|
121 |
with_empty=1, empty_value='', empty_title=LxERP.t8("Select record type"),
|
|
122 |
onchange='kivi.EmailJournal.update_record_list();'
|
|
123 |
) %]
|
|
124 |
</div>
|
|
125 |
<div id="[% customer_vendor _ "_linking_record_types_div" %]"
|
|
126 |
style="display:none"
|
108 |
127 |
>
|
|
128 |
[%
|
|
129 |
SET options = [];
|
|
130 |
FOREACH record_info = RECORD_TYPES_WITH_INFO;
|
|
131 |
IF (record_info.customervendor == customer_vendor && !record_info.is_template);
|
|
132 |
options.push({value => record_info.record_type, name => record_info.text});
|
|
133 |
END;
|
|
134 |
END;
|
|
135 |
%]
|
|
136 |
[% L.select_tag(customer_vendor _ '_linking_record_type_selection',
|
|
137 |
options,
|
|
138 |
value_key='value', title_key='name',
|
|
139 |
with_empty=1, empty_value='', empty_title=LxERP.t8("Select record type"),
|
|
140 |
onchange='kivi.EmailJournal.update_record_list();'
|
|
141 |
) %]
|
|
142 |
</div>
|
109 |
143 |
|
|
144 |
|
|
145 |
<div id="[% customer_vendor _ "_template_record_types_div" %]"
|
|
146 |
style="display:none"
|
|
147 |
>
|
110 |
148 |
[%
|
111 |
149 |
SET options = [];
|
112 |
150 |
FOREACH record_info = RECORD_TYPES_WITH_INFO;
|
113 |
|
IF (record_info.customervendor == customer_vendor);
|
|
151 |
IF (record_info.customervendor == customer_vendor && record_info.is_template);
|
114 |
152 |
options.push({value => record_info.record_type, name => record_info.text});
|
115 |
153 |
END;
|
116 |
154 |
END;
|
117 |
155 |
%]
|
118 |
|
[% L.select_tag(customer_vendor _ '_record_type_selection',
|
|
156 |
[% L.select_tag(customer_vendor _ '_template_record_type_selection',
|
119 |
157 |
options,
|
120 |
158 |
value_key='value', title_key='name',
|
121 |
159 |
with_empty=1, empty_value='', empty_title=LxERP.t8("Select record type"),
|
122 |
|
class="wi-normal",
|
123 |
|
onchange='kivi.EmailJournal.update_record_type_selection("' _ customer_vendor _ '");'
|
|
160 |
onchange='kivi.EmailJournal.update_record_list();'
|
124 |
161 |
) %]
|
125 |
162 |
</div>
|
126 |
163 |
[% END %]
|
127 |
|
</td>
|
128 |
|
|
|
164 |
</div>
|
|
165 |
</div>
|
|
166 |
</tr> <tr>
|
129 |
167 |
<td>
|
130 |
|
<div id="record_type_div" class="col" style="display:block">
|
131 |
|
[% FOREACH record_info = RECORD_TYPES_WITH_INFO %]
|
132 |
|
<div id="[% record_info.record_type _ "_div" %]" class="col record_type" style="display:none">
|
133 |
|
[% L.input_tag(record_info.record_type _ "_id", '',
|
134 |
|
style="color:black", class="wi-normal",
|
135 |
|
placeholder=record_info.record_type _ " id") %]
|
|
168 |
<div id="record_selection_div">
|
|
169 |
<div style="display:flex">
|
|
170 |
[% FOREACH cv_option = [
|
|
171 |
['customer', 'Customer', 1],
|
|
172 |
['vendor', 'Vendor', 0],
|
|
173 |
] %]
|
|
174 |
[% SET cv_type = cv_option.0 %]
|
|
175 |
[% SET cv_name = cv_option.1 %]
|
|
176 |
[% SET cv_is_cusotmer = cv_option.2 %]
|
|
177 |
<div
|
|
178 |
id="[% cv_type _ "_div" %]"
|
|
179 |
style=[% IF cv_type == CV_TYPE_FOUND %] "display:block" [% ELSE %] "display:none" [% END %]
|
|
180 |
>
|
|
181 |
[% P.customer_vendor.picker(
|
|
182 |
cv_type _ "_id",
|
|
183 |
CUSTOMER_VENDOR.is_customer == cv_is_cusotmer ? CUSTOMER_VENDOR : undef,
|
|
184 |
type=cv_type, class="wi-normal", placeholder=LxERP.t8(cv_name)
|
|
185 |
onchange='kivi.EmailJournal.update_record_list();'
|
|
186 |
) %]
|
136 |
187 |
</div>
|
137 |
188 |
[% END %]
|
138 |
|
<div id="record_type_placeholder_div" class="col record_type" style="display:block">
|
139 |
|
[% L.input_tag('cv_placeholder', '',
|
140 |
|
style="color:black", class="wi-normal", disabled=1,
|
141 |
|
) %]
|
|
189 |
|
|
190 |
<div id="record_number_div">
|
|
191 |
[% L.input_tag('record_number', '',
|
|
192 |
class="wi-normal", placeholder=LxERP.t8("Record number")
|
|
193 |
onchange='kivi.EmailJournal.update_record_list();'
|
|
194 |
) %]
|
142 |
195 |
</div>
|
143 |
|
</div>
|
144 |
|
<div id="no_record_type_div" class="col" style="display:none">
|
145 |
|
[% L.input_tag('cv_placeholder', '',
|
146 |
|
style="color:black", class="wi-normal", disabled=1,
|
|
196 |
|
|
197 |
<div id="with_closed_div">
|
|
198 |
[% L.select_tag('with_closed',
|
|
199 |
[
|
|
200 |
{value => "1", name => LxERP.t8("With closed")},
|
|
201 |
{value => "0", name => LxERP.t8("Only open")},
|
|
202 |
],
|
|
203 |
default = 0, value_key='value', title_key='name',
|
|
204 |
onchange='kivi.EmailJournal.update_record_list();'
|
147 |
205 |
) %]
|
|
206 |
</div>
|
148 |
207 |
</div>
|
149 |
|
</td>
|
|
208 |
<div id="record_div">
|
|
209 |
[% SET show_records = (RECORDS.size < 20);
|
|
210 |
IF show_records;
|
|
211 |
SET display_toggle_off = 'style="display:none;"' ;
|
|
212 |
SET display_toggle_on = 'style="display:block;"' ;
|
|
213 |
ELSE ;
|
|
214 |
SET display_toggle_off = 'style="display:block;"' ;
|
|
215 |
SET display_toggle_on = 'style="display:none;"' ;
|
|
216 |
END ;
|
|
217 |
%]
|
|
218 |
<div id="record_toggle_closed"
|
|
219 |
class="record_toggle toggle_panel control-panel" [% display_toggle_off %]>
|
|
220 |
<a href="#" onClick='javascript:$(".record_toggle").toggle()'
|
|
221 |
class="button toggle off neutral">
|
|
222 |
[% LxERP.t8('Show Records') %]
|
|
223 |
</a>
|
|
224 |
</div><!-- /.record_toggle -->
|
150 |
225 |
|
151 |
|
<td>
|
152 |
|
[% L.button_tag('kivi.EmailJournal.apply_action_with_attachment();', LxERP.t8('Apply with Attachment')) %]
|
|
226 |
<div id="record_toggle_open"
|
|
227 |
class="record_toggle toggle_panel control-panel" [% display_toggle_on %]>
|
|
228 |
<a href="#" onClick='javascript:$(".record_toggle").toggle()'
|
|
229 |
class="button toggle on neutral with-panel">
|
|
230 |
[% LxERP.t8('Hide Records') %]
|
|
231 |
</a>
|
|
232 |
<div class="toggle_panel_block">
|
|
233 |
<div id="record_list">
|
|
234 |
[% FOREACH record = RECORDS %]
|
|
235 |
[% L.button_tag(
|
|
236 |
'kivi.EmailJournal.apply_action_with_attachment("'
|
|
237 |
_ record.id _ '", "' _ record.record_type
|
|
238 |
_ '");',
|
|
239 |
record.displayable_name,
|
|
240 |
class="record_button"
|
|
241 |
) %]
|
|
242 |
[% END %]
|
|
243 |
[% IF RECORDS.size == 0 %]
|
|
244 |
<h3> [% LxERP.t8("No records found.") %] </h3>
|
|
245 |
[% END %]
|
|
246 |
</div>
|
|
247 |
</div>
|
|
248 |
</div><!-- /.record_toggle -->
|
|
249 |
</div><!-- record_div -->
|
|
250 |
</div><!-- record_selection_div -->
|
|
251 |
<div id="new_record_div" class="input-panel" style="display:none;min-width:0;margin:0">
|
|
252 |
[% L.button_tag('kivi.EmailJournal.apply_action_with_attachment();',
|
|
253 |
LxERP.t8('Apply with Attachment')) %]
|
|
254 |
</div>
|
153 |
255 |
</td>
|
|
256 |
|
154 |
257 |
</tr> </table>
|
155 |
258 |
</form>
|
156 |
259 |
|
157 |
260 |
<!-- kivi.EmailJournal.update_attachment_preview -->
|
158 |
261 |
<div id="attachment_preview"></div>
|
159 |
262 |
[% END %]
|
|
263 |
|
|
264 |
<script type="text/javascript">
|
|
265 |
$(document).ready(function() {
|
|
266 |
kivi.EmailJournal.update_email_workflow_options();
|
|
267 |
kivi.EmailJournal.update_record_list();
|
|
268 |
kivi.EmailJournal.update_attachment_preview();
|
|
269 |
});
|
|
270 |
</script>
|
EmailJournal: altes Design für neuen Workflow und Felder angepasst