Generische Unterstützung für CTI: Click-to-dial
[kivitendo-erp.git] / templates / webpages / customer_vendor / form.html
1 [%- USE T8 %]
2 [%- USE LxERP %]
3 [%- USE L %]
4
5 [% L.hidden_tag('_cti_enabled', !!LXCONFIG.cti.dial_command) %]
6
7 [% cv_cvars = SELF.cv.cvars_by_config %]
8
9 <form method="post" action="controller.pl">
10   <div class="listtop">[% FORM.title %]</div>
11
12   [% L.hidden_tag('db', FORM.db) %]
13   [% L.hidden_tag('callback', FORM.callback) %]
14   [% L.hidden_tag('cv.id', SELF.cv.id) %]
15
16   [%- INCLUDE 'common/flash.html' %]
17
18   <div class="tabwidget" id="customer_vendor_tabs">
19     <ul>
20       <li><a href="#billing">[% 'Billing Address' | $T8 %]</a></li>
21       <li><a href="#bank">[% 'Bank account' | $T8 %]</a></li>
22       <li><a href="#shipto">[% 'Shipping Address' | $T8 %]</a></li>
23       <li><a href="#contacts">[% 'Contacts' | $T8 %]</a></li>
24       [% IF ( SELF.cv.id && AUTH.assert('sales_all_edit', 1) ) %]
25         <li><a href="#deliveries">[% 'Supplies' | $T8 %]</a></li>
26       [% END %]
27       <li><a href="#vcnotes">[% 'Notes' | $T8 %]</a></li>
28
29       [% IF ( cv_cvars.size ) %]
30         <li><a href="#custom_variables">[% 'Custom Variables' | $T8 %]</a></li>
31       [% END %]
32     </ul>
33
34     [% PROCESS "customer_vendor/tabs/billing.html" %]
35     [% PROCESS "customer_vendor/tabs/bank.html" %]
36     [% PROCESS "customer_vendor/tabs/shipto.html" %]
37     [% PROCESS "customer_vendor/tabs/contacts.html" %]
38     [% IF ( SELF.cv.id && AUTH.assert('sales_all_edit', 1) ) %]
39       [% PROCESS "customer_vendor/tabs/deliveries.html" %]
40     [% END %]
41     [% PROCESS "customer_vendor/tabs/vcnotes.html" %]
42     [% IF ( cv_cvars.size ) %]
43       [% PROCESS "customer_vendor/tabs/custom_variables.html" %]
44     [% END %]
45   </div>
46
47   <br>
48
49   [% L.hidden_tag('action', 'CustomerVendor/dispatch') %]
50
51   [% L.submit_tag('action_save', LxERP.t8('Save'), onclick = "return check_taxzone_and_ustid()", accesskey = "s") %]
52   [% L.submit_tag('action_save_and_close', LxERP.t8('Save and Close'), onclick = "return check_taxzone_and_ustid()") %]
53
54   [%- IF ( SELF.is_vendor ) %]
55     [% L.submit_tag('action_save_and_ap_transaction', LxERP.t8('Save and AP Transaction'), onclick = "return check_taxzone_and_ustid()") %]
56   [%- ELSE %]
57     [% L.submit_tag('action_save_and_ar_transaction', LxERP.t8('Save and AR Transaction'), onclick = "return check_taxzone_and_ustid()") %]
58   [%- END %]
59
60   [% L.submit_tag('action_save_and_invoice', LxERP.t8('Save and Invoice'), onclick = "return check_taxzone_and_ustid()") %]
61   [% L.submit_tag('action_save_and_order', LxERP.t8('Save and Order'), onclick = "return check_taxzone_and_ustid()") %]
62
63   [%- IF ( SELF.is_vendor ) %]
64     [% L.submit_tag('action_save_and_rfq', LxERP.t8('Save and RFQ'), onclick = "return check_taxzone_and_ustid()") %]
65   [%- ELSE %]
66     [% L.submit_tag('action_save_and_quotation', LxERP.t8('Save and Quotation'), onclick = "return check_taxzone_and_ustid()") %]
67   [%- END %]
68
69   [%- IF ( SELF.cv.id && SELF.is_orphaned ) %]
70     [% L.submit_tag('action_delete', LxERP.t8('Delete'), confirm => LxERP.t8('Do you really want to delete this object?')) %]
71   [%- END %]
72
73   [%- IF ( SELF.cv.id ) %]
74     <input type="button" class="submit" onclick="kivi.CustomerVendor.showHistoryWindow([% SELF.cv.id %]);" name="history" id="history" value="[% 'history' | $T8 %]">
75   [%- END %]
76
77 </form>
78
79 <script type="text/javascript">
80 <!--
81   function submitInputButton(button)
82   {
83     var hidden = document.createElement("input");
84     hidden.setAttribute("type", "hidden");
85
86     if ( button.hasAttribute("name") )
87       hidden.setAttribute("name", button.getAttribute("name"));
88
89     if ( button.hasAttribute("value") )
90       hidden.setAttribute("value", button.getAttribute("value"));
91
92
93     button.form.appendChild(hidden);
94
95     button.disabled = true;
96
97     button.form.submit();
98   }
99
100   function check_taxzone_and_ustid() {
101     if ( ($('#cv_taxzone_id').val() == '1') && ($('#cv_ustid').val() == '') ) {
102       alert('[% LxERP.t8('Please enter the sales tax identification number.') %]');
103       return false;
104     }
105     return true;
106   }
107 -->
108 </script>