X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=js%2Fcalculate_qty.js;h=ee36cf0f60675bcb4a6dd38f90fb291ebe395d64;hb=991369b17d679e2855f4d5086d0b9769dc2ae1aa;hp=01fa5bfe51fe20be8c299090464f0c2791976a5a;hpb=1ccc89c81f95c77ec583c973dec38b56177c81ab;p=kivitendo-erp.git diff --git a/js/calculate_qty.js b/js/calculate_qty.js index 01fa5bfe5..ee36cf0f6 100644 --- a/js/calculate_qty.js +++ b/js/calculate_qty.js @@ -1,17 +1,27 @@ -function calculate_qty_selection_window(input_name, input_id, formel_name, formel_id) { - var parm = centerParms(600,500) + ",width=600,height=500,status=yes,scrollbars=yes"; - var action = "calculate_qty"; +function calculate_qty_selection_dialog(input_name, input_id, formel_name, formel_id) { + // The target input element is determined by it's dom id or by it's name. + // The formula input element (the one containing the formula) is determined by it's dom id or by it's name. + // If the id is not provided the name is used. if (formel_id) { var formel = $('#' + formel_id).val(); } else { var formel = $('[name="' + formel_name + '"]').val(); } - url = "common.pl?" + - "INPUT_ENCODING=UTF-8&" + - "action=" + action + "&" + - "input_name=" + encodeURIComponent(input_name) + "&" + - "input_id=" + encodeURIComponent(input_id) + "&" + - "formel=" + encodeURIComponent(formel); - //alert(url); - window.open(url, "_new_generic", parm); + var url = "common.pl"; + var data = { + action: "calculate_qty", + input_name: input_name, + input_id: input_id, + formel: formel + }; + kivi.popup_dialog({ + id: 'calc_qty_dialog', + url: url, + data: data, + dialog: { + width: 500, + height: 400, + title: kivi.t8('Please enter values'), + } + }); }