Confirm bei geƤnderter/m Kontonummer/-namen
[kivitendo-erp.git] / templates / webpages / am / edit_accounts.html
index d3e4fe7..297b2b8 100644 (file)
@@ -41,7 +41,7 @@ $(function() {
         <label>
           [% 'Account Number' | $T8 %]
         </label></td>
-        <td><input name="accno" size="20" value="[% HTML.escape(accno) %]"></td>
+        <td><input id="accno" name="accno" size="20" value="[% HTML.escape(accno) %]"></td>
     </tr>
     <tr>
       <td>
@@ -49,7 +49,7 @@ $(function() {
           [% 'Description' | $T8 %]
         </label>
       </td>
-      <td><input name="description" size="40" value="[% HTML.escape(description) %]"></td>
+      <td><input id="description" name="description" size="40" value="[% HTML.escape(description) %]"></td>
     </tr>
     <tr>
       <td>
@@ -275,3 +275,17 @@ $(function() {
 [% END %]
 </fieldset>
 <hr size="3" noshade>
+
+<script type="text/javascript">
+function callback_save() {
+  var prev_desc = "[% description | html %]";
+  var prev_accno = "[% accno | html %]";
+  var cur_desc = $("#description").val();
+  var cur_accno = $("#accno").val();
+
+  if ( prev_desc != cur_desc || prev_accno != cur_accno )
+    return confirm(kivi.t8("Do you want to set the account number \"#1\" to \"#2\" and the name \"#3\" to \"#4\"?", [prev_accno, cur_accno, prev_desc, cur_desc]));
+  else
+    return true;
+}
+</script>