Revision c19e3e76
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
js/kivi.EmailJournal.js | ||
---|---|---|
2 | 2 |
'use strict'; |
3 | 3 |
|
4 | 4 |
ns.update_attachment_preview = function() { |
5 |
let $form = $('#attachment_form');
|
|
5 |
let $form = $('#record_action_form');
|
|
6 | 6 |
if ($form == undefined) { return; } |
7 | 7 |
|
8 | 8 |
let data = $form.serializeArray(); |
... | ... | |
10 | 10 |
|
11 | 11 |
$.post("controller.pl", data, kivi.eval_json_result); |
12 | 12 |
} |
13 |
|
|
14 |
ns.update_extra_div_selection = function() { |
|
15 |
let record_action = $('#record_action').val(); |
|
16 |
if (record_action == undefined) { return; } |
|
17 |
|
|
18 |
$('#customer_div').hide(); |
|
19 |
$('#vendor_div').hide(); |
|
20 |
|
|
21 |
$('#link_sales_quotation_div').hide(); |
|
22 |
$('#link_sales_order_intake_div').hide(); |
|
23 |
$('#link_sales_order_div').hide(); |
|
24 |
$('#link_request_quotation_div').hide(); |
|
25 |
$('#link_purchase_quotation_intake_div').hide(); |
|
26 |
$('#link_purchase_order_div').hide(); |
|
27 |
|
|
28 |
$('#placeholder_div').hide(); |
|
29 |
|
|
30 |
// customer vendor |
|
31 |
if (record_action.match(/^customer/)) { |
|
32 |
$('#customer_div').show(); |
|
33 |
} else if (record_action.match(/^vendor/)) { |
|
34 |
$('#vendor_div').show(); |
|
35 |
// link |
|
36 |
} else if (record_action.match(/^link_/)) { |
|
37 |
$('#'+record_action+'_div').show(); |
|
38 |
// placeholder |
|
39 |
} else { |
|
40 |
$('#placeholder_div').show(); |
|
41 |
} |
|
42 |
} |
|
43 |
|
|
44 |
ns.apply_record_action = function() { |
|
45 |
let record_action = $('#record_action').val(); |
|
46 |
if (record_action == '') { |
|
47 |
alert(kivi.t8('Please select an action.')); |
|
48 |
return; |
|
49 |
} |
|
50 |
|
|
51 |
let data = $('#record_action_form').serializeArray(); |
|
52 |
data.push({ name: 'action', value: 'EmailJournal/apply_record_action' }); |
|
53 |
|
|
54 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
55 |
} |
|
56 |
}); |
|
57 |
|
|
58 |
$(function() { |
|
59 |
kivi.EmailJournal.update_attachment_preview(); |
|
60 |
kivi.EmailJournal.update_extra_div_selection(); |
|
13 | 61 |
}); |
Auch abrufbar als: Unified diff
EmailJournal: Basisfunktionalität fürs Verlinken und Neu erstellen von Belegen