Kunden-/Lieferanten: Löschen von Ansprechpersonen, Lieferadressen gefixt
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 15 Dec 2017 11:55:09 +0000 (12:55 +0100)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 15 Dec 2017 11:56:09 +0000 (12:56 +0100)
templates/webpages/customer_vendor/form.html
templates/webpages/customer_vendor/tabs/contacts.html
templates/webpages/customer_vendor/tabs/shipto.html

index 4c473a9..4b6e32e 100644 (file)
 
 <script type="text/javascript">
 <!--
-  function submitInputButton(button)
+  function submitInputButton(action)
   {
-    var hidden = document.createElement("input");
-    hidden.setAttribute("type", "hidden");
+    var $hidden = $("<input type='hidden' name='action' value='CustomerVendor/" + action + "'>"),
+        $form   = $('#form');
 
-    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();
+    $form.append($hidden);
+    $form.submit();
   }
 
   function check_taxzone_and_ustid() {
index 602352c..cc9b0b7 100644 (file)
 
   </table>
 
-  [% L.button_tag('submitInputButton(this);', LxERP.t8('Delete Contact'), name = 'action_delete_contact', class = 'submit') %]
+  [% L.button_tag('submitInputButton("delete_contact");', LxERP.t8('Delete Contact'), class = 'submit') %]
   [% IF ( !SELF.contact.cp_id ) %]
     <script type="text/javascript">
       $('#action_delete_contact').hide();
index 5dd6d85..6e61072 100644 (file)
     [% END %]
   </table>
 
-  [% L.button_tag('submitInputButton(this);', LxERP.t8('Delete Shipto'), name = 'action_delete_shipto', class = 'submit') %]
+  [% L.button_tag('submitInputButton("delete_shipto");', LxERP.t8('Delete Shipto'), class = 'submit') %]
   [% IF ( !SELF.shipto.shipto_id ) %]
     <script type="text/javascript">
       $('#action_delete_shipto').hide();