From: Moritz Bunkus Date: Wed, 13 Sep 2017 14:08:33 +0000 (+0200) Subject: Historien-Popup: nur definierte Parameter an URL übergeben X-Git-Tag: release-3.5.4~824 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=b0ad9e13bf93135f3cc00c5573dfba4eea9b3c39;p=kivitendo-erp.git Historien-Popup: nur definierte Parameter an URL übergeben Nicht definierte Werte werden von `encodeURIComponent` stringifiziert, sodass z.B. `what_done=undefined&…` in der URL steht, wonach Perl-seitig dann gefiltert wird und keine Ergebnisse mehr liefert. --- diff --git a/js/show_history.js b/js/show_history.js index 6985c6941..a61e21dab 100644 --- a/js/show_history.js +++ b/js/show_history.js @@ -10,14 +10,18 @@ function centerParms(width,height,extra) { return string; } -function set_history_window(id,trans_id_type) { - var parm = centerParms(800,500) + ",width=800,height=500,status=yes,scrollbars=yes"; - var name = "History"; - url = "common.pl?" + - "INPUT_ENCODING=UTF-8&" + - "action=show_history&" + - "longdescription=" + "&" + - "trans_id_type=" + encodeURIComponent(trans_id_type) + "&" + - "input_name=" + encodeURIComponent(id) + "&" +function set_history_window(id,trans_id_type, snumbers, what_done) { + var parm = centerParms(1100,500) + ",width=1100,height=500,status=yes,scrollbars=yes"; + var url = "common.pl?action=show_history&INPUT_ENCODING=UTF-8&"; + + if (trans_id_type) + url += "&trans_id_type=" + encodeURIComponent(trans_id_type); + if (snumbers) + url += "&s_numbers=" + encodeURIComponent(snumbers); + if (what_done) + url += "&what_done=" + encodeURIComponent(what_done); + if (id) + url += "&input_name=" + encodeURIComponent(id); + window.open(url, "_new_generic", parm); }