Revision 0935b012
Von Bernd Bleßmann vor etwa 8 Jahren hinzugefügt
templates/webpages/order/form.html | ||
---|---|---|
7 | 7 |
<form method="post" action="controller.pl" id="print_options_form"> |
8 | 8 |
[% SELF.print_options %] |
9 | 9 |
<br> |
10 |
[% L.button_tag('print()', LxERP.t8('Print')) %] |
|
10 |
[% L.button_tag('kivi.Order.print()', LxERP.t8('Print')) %]
|
|
11 | 11 |
<a href="#" onclick="$('#print_options').dialog('close');">[% LxERP.t8("Cancel") %]</a> |
12 | 12 |
</form> |
13 | 13 |
</div> |
... | ... | |
43 | 43 |
|
44 | 44 |
[% L.hidden_tag('action', 'Order/dispatch') %] |
45 | 45 |
|
46 |
[% L.button_tag('save()', LxERP.t8('Save')) %] |
|
47 |
[% L.button_tag('show_print_options()', LxERP.t8('Print')) %] |
|
48 |
[% L.button_tag('email()', LxERP.t8('E-mail')) %] |
|
49 |
[% L.button_tag('save_and_delivery_order()', LxERP.t8('Save and Delivery Order')) %] |
|
46 |
[% L.button_tag('kivi.Order.save()', LxERP.t8('Save')) %]
|
|
47 |
[% L.button_tag('kivi.Order.show_print_options()', LxERP.t8('Print')) %]
|
|
48 |
[% L.button_tag('kivi.Order.email()', LxERP.t8('E-mail')) %]
|
|
49 |
[% L.button_tag('kivi.Order.save_and_delivery_order()', LxERP.t8('Save and Delivery Order')) %]
|
|
50 | 50 |
[%- IF SELF.order.id && ( (SELF.cv == 'customer' && INSTANCE_CONF.get_sales_order_show_delete) || (SELF.cv == 'vendor' && INSTANCE_CONF.get_purchase_order_show_delete) ) %] |
51 |
[% L.button_tag('delete_order()', LxERP.t8('Delete'), confirm=LxERP.t8("Are you sure?")) %] |
|
51 |
[% L.button_tag('kivi.Order.delete_order()', LxERP.t8('Delete'), confirm=LxERP.t8("Are you sure?")) %]
|
|
52 | 52 |
[%- END %] |
53 | 53 |
|
54 | 54 |
</form> |
55 |
|
|
56 |
|
|
57 |
<script type='text/javascript'> |
|
58 |
|
|
59 |
function delete_order() { |
|
60 |
var data = $('#order_form').serializeArray(); |
|
61 |
data.push({ name: 'action', value: 'Order/delete' }); |
|
62 |
|
|
63 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
64 |
} |
|
65 |
|
|
66 |
function save() { |
|
67 |
if (!check_cv()) return; |
|
68 |
var data = $('#order_form').serializeArray(); |
|
69 |
data.push({ name: 'action', value: 'Order/save' }); |
|
70 |
|
|
71 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
72 |
} |
|
73 |
|
|
74 |
function show_print_options() { |
|
75 |
if (!check_cv()) return; |
|
76 |
|
|
77 |
kivi.popup_dialog({ |
|
78 |
id: 'print_options', |
|
79 |
dialog: { |
|
80 |
title: kivi.t8('Print options'), |
|
81 |
width: 800, |
|
82 |
height: 300 |
|
83 |
} |
|
84 |
}); |
|
85 |
} |
|
86 |
|
|
87 |
function print() { |
|
88 |
$('#print_options').dialog('close'); |
|
89 |
|
|
90 |
var data = $('#order_form').serializeArray(); |
|
91 |
data = data.concat($('#print_options_form').serializeArray()); |
|
92 |
data.push({ name: 'action', value: 'Order/print' }); |
|
93 |
|
|
94 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
95 |
} |
|
96 |
|
|
97 |
function download_pdf(pdf_filename, key) { |
|
98 |
var data = []; |
|
99 |
data.push({ name: 'action', value: 'Order/download_pdf' }); |
|
100 |
data.push({ name: 'type', value: $('#type').val() }); |
|
101 |
data.push({ name: 'pdf_filename', value: pdf_filename }); |
|
102 |
data.push({ name: 'key', value: key }); |
|
103 |
$.download("controller.pl", data); |
|
104 |
} |
|
105 |
|
|
106 |
function email() { |
|
107 |
if (!check_cv()) return; |
|
108 |
var data = $('#order_form').serializeArray(); |
|
109 |
data.push({ name: 'action', value: 'Order/show_email_dialog' }); |
|
110 |
|
|
111 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
112 |
} |
|
113 |
|
|
114 |
function save_and_delivery_order() { |
|
115 |
if (!check_cv()) return; |
|
116 |
var data = $('#order_form').serializeArray(); |
|
117 |
data.push({ name: 'action', value: 'Order/save_and_delivery_order' }); |
|
118 |
|
|
119 |
$.post("controller.pl", data, kivi.eval_json_result); |
|
120 |
} |
|
121 |
|
|
122 |
function check_cv() { |
|
123 |
if ($('#order_[%- cv_id %]').val() == '') { |
|
124 |
[%- IF SELF.cv == 'customer' %] |
|
125 |
alert(kivi.t8('Please select a customer.')); |
|
126 |
[%- ELSE %] |
|
127 |
alert(kivi.t8('Please select a vendor.')); |
|
128 |
[%- END %] |
|
129 |
return false; |
|
130 |
} |
|
131 |
return true; |
|
132 |
} |
|
133 |
</script> |
Auch abrufbar als: Unified diff
Auftrags-Controller: javascript-Code in eigene Datei auslagern