Merge branch 'constraints_in_tax_and_taxkeys'
[kivitendo-erp.git] / templates / webpages / ct / form_footer.html
index 4ea8a42..774a50e 100644 (file)
@@ -1,6 +1,7 @@
 [%- USE T8 %]
 [% USE HTML %]
 [% USE LxERP %]
+[% USE L %]
 <input name="id" type="hidden" id="cvid" value="[% HTML.escape(id) %]">
 <input name="business_save" type="hidden" value="[% HTML.escape(selectbusiness) %]">
 <input name="title_save" type="hidden" value="[% HTML.escape(title) %]">
@@ -24,7 +25,7 @@
   <input class="submit" type="submit" name="action" value="[% 'Save and RFQ' | $T8 %]" onclick="return check_taxzone_and_ustid()">
   [%- END %]
 [%- IF id AND is_orphaned %]
-  <input class="submit" type="submit" name="action" value="[% 'Delete' | $T8 %]">
+  [% L.submit_tag('action', LxERP.t8('Delete'), id => 'action_delete', confirm => LxERP.t8('Do you really want to delete this object?')) %]
 [%- END %]
 [%- IF id %]
   <input type="button" class="submit" onclick="set_history_window([% HTML.escape(id) %]);" name="history" id="history" value="[% 'history' | $T8 %]">
 
  <script type="text/javascript">
   <!--
-      Calendar.setup({ inputField : "from",    ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger_from" });
-      Calendar.setup({ inputField : "to",      ifFormat :"[% myconfig_jsc_dateformat %]", align : "BL", button : "trigger_to" });
-      Calendar.setup({ inputField : "FU_date", ifFormat :"[% myconfig_jsc_dateformat %]", align : "BR", button : "FU_date_trigger" });
-
       function enable_delete_shipto(used) { var s=document.getElementById('delete_shipto');  if (s) s.disabled = (used > 0 ? true : false); }
       function enable_delete_contact(used){ var s=document.getElementById('delete_contact'); if (s) s.disabled = (used > 0 ? true : false); }
 
-      var maintab = new ddtabcontent("maintab");
-      maintab.setpersist(true);
-      maintab.setselectedClassTarget("link"); //"link" or "linkparent"
-      maintab.init();
+      function submitInputButton(button)
+      {
+        var hidden = document.createElement("input");
+        hidden.setAttribute("type", "hidden");
+
+        if( button.hasAttribute("name") )
+          hidden.setAttribute("name", button.getAttribute("name"));
+
+        if( button.hasAttribute("value") )
+          hidden.setAttribute("value", button.getAttribute("value"));
+
+
+        button.form.appendChild(hidden);
+
+        button.disabled = true;
+
+        button.form.submit();
+      }
 
       function check_taxzone_and_ustid() {
         if (($('#taxzone_id').attr('value') == '1') && ($('#ustid').attr('value') == '')) {
@@ -56,5 +67,3 @@
 
     -->
  </script>
-</body>
-</html>