kivitendo/js/part_selection.js @ 3ef69a72
83914eeb | Moritz Bunkus | function part_selection_window(input_partnumber, input_description, input_partsid, allow_creation, formname, options) {
|
||
var width = allow_creation ? 1000 : 800;
|
||||
var parm = centerParms(width,500) + ",width=" + width + ",height=500,status=yes,scrollbars=yes";
|
||||
var partnumber = document.getElementsByName(input_partnumber)[0].value;
|
||||
var description = document.getElementsByName(input_description)[0].value;
|
||||
var action_on_part_selected = document.getElementsByName("action_on_part_selected")[0];
|
||||
var form = (formname == undefined) ? document.forms[0] : document.getElementsByName(formname)[0];
|
||||
var filter = document.getElementsByName(input_partnumber + "_filter")[0];
|
||||
var input_partnotes = "";
|
||||
if (input_partnumber.match(/_\d+$/)) {
|
||||
input_partnotes = input_partnumber;
|
||||
input_partnotes = input_partnotes.replace(/partnumber/, "partnotes");
|
||||
if (input_partnotes == input_partnumber)
|
||||
input_partnoes = "";
|
||||
}
|
||||
if (filter)
|
||||
filter = filter.value;
|
||||
else
|
||||
filter = "";
|
||||
if (!options)
|
||||
options = "";
|
||||
url = "common.pl?" +
|
||||
5d557254 | Moritz Bunkus | "INPUT_ENCODING=UTF-8&" +
|
||
83914eeb | Moritz Bunkus | "action=part_selection_internal&" +
|
||
6b063f3c | Moritz Bunkus | "partnumber=" + encodeURIComponent(partnumber) + "&" +
|
||
"description=" + encodeURIComponent(description) + "&" +
|
||||
"input_partnumber=" + encodeURIComponent(input_partnumber) + "&" +
|
||||
"input_description=" + encodeURIComponent(input_description) + "&" +
|
||||
"input_partsid=" + encodeURIComponent(input_partsid) + "&" +
|
||||
"input_partnotes=" + encodeURIComponent(input_partnotes) + "&" +
|
||||
"filter=" + encodeURIComponent(filter) + "&" +
|
||||
"options=" + encodeURIComponent(options) + "&" +
|
||||
"formname=" + encodeURIComponent(formname) + "&" +
|
||||
83914eeb | Moritz Bunkus | "allow_creation=" + (allow_creation ? "1" : "0") + "&" +
|
||
"action_on_part_selected=" + (null == action_on_part_selected ? "" : action_on_part_selected.value);
|
||||
//alert(url);
|
||||
window.open(url, "_new_part_selection", parm);
|
||||
}
|