Telefonnotizen Angebot/Auftrag
[kivitendo-erp.git] / templates / webpages / order / form.html
index eb40e3e..82bc2f1 100644 (file)
@@ -2,22 +2,26 @@
 [%- USE LxERP %]
 [%- USE L %]
 [%- USE HTML %]
+<h1>[% FORM.title %] <span id='nr_in_title'>[%- SELF.order.number -%]</span></h1>
 
 <div id="print_options" style="display:none">
   <form method="post" action="controller.pl" id="print_options_form">
     [% SELF.print_options %]
     <br>
-    [% L.button_tag('print()', LxERP.t8('Print')) %]
+    [% L.button_tag('kivi.Order.print()', LxERP.t8('Print')) %]
     <a href="#" onclick="$('#print_options').dialog('close');">[% LxERP.t8("Cancel") %]</a>
   </form>
 </div>
 
-<form method="post" action="controller.pl" id="order_form">
-  <div class="listtop">[% FORM.title %]</div>
+<div id="shipto_dialog" class="hidden"></div>
 
-  [% L.hidden_tag('callback', FORM.callback) %]
-  [% L.hidden_tag('type',     FORM.type) %]
-  [% L.hidden_tag('id',       SELF.order.id) %]
+<form method="post" action="controller.pl" id="order_form"
+      data-transport-cost-reminder-article-id="[% HTML.escape(transport_cost_reminder_article.id) %]"
+      data-transport-cost-reminder-article-description="[% HTML.escape(transport_cost_reminder_article.displayable_name) %]">
+  [% L.hidden_tag('callback',             FORM.callback) %]
+  [% L.hidden_tag('type',                 FORM.type) %]
+  [% L.hidden_tag('id',                   SELF.order.id) %]
+  [% L.hidden_tag('converted_from_oe_id', SELF.converted_from_oe_id) %]
 
   [%- INCLUDE 'common/flash.html' %]
 
 [%- IF INSTANCE_CONF.get_webdav %]
       <li><a href="#ui-tabs-webdav">[% 'WebDAV' | $T8 %]</a></li>
 [%- END %]
+[%- IF SELF.order.id AND INSTANCE_CONF.get_doc_storage %]
+      <li><a href="controller.pl?action=File/list&file_type=document&object_type=[% HTML.escape(FORM.type) %]&object_id=[% HTML.url(SELF.order.id) %]">[% 'Documents' | $T8 %]</a></li>
+      <li><a href="controller.pl?action=File/list&file_type=attachment&object_type=[% HTML.escape(FORM.type) %]&object_id=[% HTML.url(SELF.order.id) %]">[% 'Attachments' | $T8 %]</a></li>
+[%- END %]
 [%- IF SELF.order.id %]
       <li><a href="controller.pl?action=RecordLinks/ajax_list&object_model=Order&object_id=[% HTML.url(SELF.order.id) %]">[% 'Linked Records' | $T8 %]</a></li>
 [%- END %]
+[% IF SELF.order.id %]
+      <li><a href="#ui-tabs-phone-notes">[% 'Phone Notes' | $T8 %]<span id="num_phone_notes">[%- num_phone_notes ? ' (' _ num_phone_notes _ ')' : '' -%]</span></a></li>
+[% END %]
     </ul>
 
     [% PROCESS "order/tabs/basic_data.html" %]
     <div id="ui-tabs-1">
       [%- LxERP.t8("Loading...") %]
     </div>
-  </div>
-
-  <br>
-
-  [% L.hidden_tag('action', 'Order/dispatch') %]
+[% IF SELF.order.id %]
+    <div id="ui-tabs-phone-notes">
+      [% PROCESS "order/tabs/phone_notes.html" %]
+    </div>
+[% END %]
+    <div id="shipto_inputs" class="hidden">
+      [%- PROCESS 'common/_ship_to_dialog.html'
+        vc_obj=SELF.order.customervendor
+        cs_obj=SELF.order.custom_shipto
+        cvars=SELF.order.custom_shipto.cvars_by_config
+        id_selector='#order_shipto_id' %]
+    </div>
 
-  [% L.button_tag('save()', LxERP.t8('Save')) %]
-  [% L.button_tag('show_print_options()', LxERP.t8('Print')) %]
-  [% L.button_tag('email()', LxERP.t8('E-mail')) %]
-  [% L.button_tag('save_and_delivery_order()', LxERP.t8('Save and Delivery Order')) %]
-[%- IF SELF.order.id && ( (SELF.cv == 'customer' && INSTANCE_CONF.get_sales_order_show_delete) || (SELF.cv == 'vendor' && INSTANCE_CONF.get_purchase_order_show_delete) ) %]
-  [% L.button_tag('delete_order()', LxERP.t8('Delete'), confirm=LxERP.t8("Are you sure?")) %]
-[%- END %]
+  </div>
 
 </form>
-
-
-<script type='text/javascript'>
-
-function delete_order() {
-  var data = $('#order_form').serializeArray();
-  data.push({ name: 'action', value: 'Order/delete' });
-
-  $.post("controller.pl", data, kivi.eval_json_result);
-}
-
-function save() {
-  if (!check_cv()) return;
-  var data = $('#order_form').serializeArray();
-  data.push({ name: 'action', value: 'Order/save' });
-
-  $.post("controller.pl", data, kivi.eval_json_result);
-}
-
-function show_print_options() {
-  if (!check_cv()) return;
-
-  kivi.popup_dialog({
-    id: 'print_options',
-    dialog: {
-      title: kivi.t8('Print options'),
-      width:  800,
-      height: 300
-    }
-  });
-}
-
-function print() {
-  $('#print_options').dialog('close');
-
-  var data = $('#order_form').serializeArray();
-  data = data.concat($('#print_options_form').serializeArray());
-  data.push({ name: 'action', value: 'Order/print' });
-
-  $.post("controller.pl", data, kivi.eval_json_result);
-}
-
-function download_pdf(pdf_filename, key) {
-  var data = [];
-  data.push({ name: 'action', value: 'Order/download_pdf' });
-  data.push({ name: 'type', value: $('#type').val() });
-  data.push({ name: 'pdf_filename', value: pdf_filename });
-  data.push({ name: 'key', value: key });
-  $.download("controller.pl", data);
-}
-
-function email() {
-  if (!check_cv()) return;
-  var data = $('#order_form').serializeArray();
-  data.push({ name: 'action', value: 'Order/show_email_dialog' });
-
-  $.post("controller.pl", data, kivi.eval_json_result);
-}
-
-function save_and_delivery_order() {
-  if (!check_cv()) return;
-  var data = $('#order_form').serializeArray();
-  data.push({ name: 'action', value: 'Order/save_and_delivery_order' });
-
-  $.post("controller.pl", data, kivi.eval_json_result);
-}
-
-function check_cv() {
-  if ($('#order_[%- cv_id %]').val() == '') {
-    [%- IF SELF.cv == 'customer' %]
-      alert(kivi.t8('Please select a customer.'));
-    [%- ELSE %]
-      alert(kivi.t8('Please select a vendor.'));
-    [%- END %]
-    return false;
-  }
-  return true;
-}
-</script>