JavaScript und Umlaute in UTF-8-Codierung funktioniert nicht mit der JavaScript-Funkt...
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 11 Jul 2008 11:12:08 +0000 (11:12 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 11 Jul 2008 11:12:08 +0000 (11:12 +0000)
15 files changed:
SL/Form.pm
js/calculate_qty.js
js/common.js
js/customer_or_vendor_selection.js
js/delivery_customer_selection.js
js/dunning.js
js/follow_up.js
js/part_selection.js
js/parts_language_selection.js
js/show_history.js
js/show_vc_details.js
js/stock_in_out.js
js/vendor_selection.js
templates/webpages/admin/edit_user_de.html
templates/webpages/admin/edit_user_master.html

index d155a0d..58614c4 100644 (file)
@@ -599,11 +599,11 @@ sub header {
                                       'charset'      => $db_charset,);
     print qq|${doctype}<html>
 <head>
+  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=${db_charset}">
   <title>$self->{titlebar}</title>
   $stylesheet
   $pagelayout
   $favicon
-  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=${db_charset}">
   $jsscript
   $ajax
 
@@ -691,6 +691,7 @@ sub _prepare_html_template {
     $additional_params->{"myconfig_jsc_dateformat"} = $jsc_dateformat;
   }
 
+  $additional_params->{"conf_dbcharset"}              = $main::dbcharset;
   $additional_params->{"conf_webdav"}                 = $main::webdav;
   $additional_params->{"conf_lizenzen"}               = $main::lizenzen;
   $additional_params->{"conf_latex_templates"}        = $main::latex;
index fb04cd7..4a7f91b 100644 (file)
@@ -8,12 +8,12 @@ function calculate_qty_selection_window(input_name, alu, formel, row) {
   }  else var action = "calculate_qty";
   url = "common.pl?" +
     "action=" + action + "&" +
-    "name=" + escape(name) + "&" +
-    "input_name=" + escape(input_name) + "&" +
-    "description=" + escape(description) + "&" +
-    "qty=" + escape(qty) + "&" +
-    "row=" + escape(row) + "&" +
-   "formel=" + escape(document.getElementsByName(formel)[0].value)
+    "name=" + encodeURIComponent(name) + "&" +
+    "input_name=" + encodeURIComponent(input_name) + "&" +
+    "description=" + encodeURIComponent(description) + "&" +
+    "qty=" + encodeURIComponent(qty) + "&" +
+    "row=" + encodeURIComponent(row) + "&" +
+   "formel=" + encodeURIComponent(document.getElementsByName(formel)[0].value)
   //alert(url);
   window.open(url, "_new_generic", parm);
 }
index e1037d7..6d818f3 100644 (file)
@@ -38,18 +38,13 @@ function centerParms(width,height,extra) {
   return string;
 }
 
-function escape_more(s) {
-  s = escape(s);
-  return s.replace(/\+/g, '%2b');
-}
-
 function set_longdescription_window(input_name) {
   var parm = centerParms(600,500) + ",width=600,height=500,status=yes,scrollbars=yes";
   var name = document.getElementsByName(input_name)[0].value;
   url = "common.pl?" +
     "action=set_longdescription&" +
-    "longdescription=" + escape_more(document.getElementsByName(input_name)[0].value) + "&" +
-    "input_name=" + escape_more(input_name) + "&"
+    "longdescription=" + encodeURIComponent(document.getElementsByName(input_name)[0].value) + "&" +
+    "input_name=" + encodeURIComponent(input_name) + "&"
   window.open(url, "_new_generic", parm);
   }
 
index 1be1c71..2e16980 100644 (file)
@@ -3,12 +3,12 @@ function customer_or_vendor_selection_window(input_name, input_id, is_vendor, al
   var name = document.getElementsByName(input_name)[0].value;
   url = "common.pl?" +
     "action=cov_selection_internal&" +
-    "name=" + escape_more(name) + "&" +
-    "input_name=" + escape(input_name) + "&" +
-    "input_id=" + escape(input_id) + "&" +
+    "name=" + encodeURIComponent(name) + "&" +
+    "input_name=" + encodeURIComponent(input_name) + "&" +
+    "input_id=" + encodeURIComponent(input_id) + "&" +
     "is_vendor=" + (is_vendor ? "1" : "0") + "&" +
     "allow_both=" + (allow_both ? "1" : "0") + "&" +
-    "action_on_cov_selected=" + (action_on_cov_selected ? escape(action_on_cov_selected) : "")
+    "action_on_cov_selected=" + (action_on_cov_selected ? encodeURIComponent(action_on_cov_selected) : "")
   //alert(url);
   window.open(url, "_new_cov_selection", parm);
 }
index 89a9a89..c44b338 100644 (file)
@@ -3,9 +3,9 @@ function delivery_customer_selection_window(input_name, input_id) {
   var name = document.getElementsByName(input_name)[0].value;
   url = "common.pl?" +
     "action=delivery_customer_selection&" +
-    "name=" + escape(name) + "&" +
-    "input_name=" + escape(input_name) + "&" +
-    "input_id=" + escape(input_id)
+    "name=" + encodeURIComponent(name) + "&" +
+    "input_name=" + encodeURIComponent(input_name) + "&" +
+    "input_id=" + encodeURIComponent(input_id)
   //alert(url);
   window.open(url, "_new_generic", parm);
 }
index a98722e..ccf80c6 100644 (file)
@@ -2,11 +2,11 @@ function set_email_window(input_subject, input_body, input_attachment) {
   var parm = centerParms(800,600) + ",width=800,height=600,status=yes,scrollbars=yes";
   var url = "dn.pl?" +
     "action=set_email&" +
-    "email_subject=" + escape_more(document.getElementsByName(input_subject)[0].value) + "&" +
-    "email_body=" + escape_more(document.getElementsByName(input_body)[0].value) + "&" +
-    "email_attachment=" + escape_more(document.getElementsByName(input_attachment)[0].value) + "&" +
-    "input_subject=" + escape_more(input_subject)  + "&" +
-    "input_body=" + escape_more(input_body)  + "&" +
-    "input_attachment=" + escape_more(input_attachment);
+    "email_subject=" + encodeURIComponent(document.getElementsByName(input_subject)[0].value) + "&" +
+    "email_body=" + encodeURIComponent(document.getElementsByName(input_body)[0].value) + "&" +
+    "email_attachment=" + encodeURIComponent(document.getElementsByName(input_attachment)[0].value) + "&" +
+    "input_subject=" + encodeURIComponent(input_subject)  + "&" +
+    "input_body=" + encodeURIComponent(input_body)  + "&" +
+    "input_attachment=" + encodeURIComponent(input_attachment);
   window.open(url, "_new_generic", parm);
 }
index 407341e..379c716 100644 (file)
@@ -16,12 +16,12 @@ function follow_up_window() {
       var trans_info = document.getElementsByName("follow_up_trans_info_" + i);
 
       url += "&" +
-        "trans_id_"   + i + "=" + escape_more(typeof trans_id   != "undefined" ? trans_id[0].value   : "") + "&" +
-        "trans_type_" + i + "=" + escape_more(typeof trans_type != "undefined" ? trans_type[0].value : "") + "&" +
-        "trans_info_" + i + "=" + escape_more(typeof trans_info != "undefined" ? trans_info[0].value : "");
+        "trans_id_"   + i + "=" + encodeURIComponent(typeof trans_id   != "undefined" ? trans_id[0].value   : "") + "&" +
+        "trans_type_" + i + "=" + encodeURIComponent(typeof trans_type != "undefined" ? trans_type[0].value : "") + "&" +
+        "trans_info_" + i + "=" + encodeURIComponent(typeof trans_info != "undefined" ? trans_info[0].value : "");
     }
 
-    url += "&trans_rowcount=" + escape_more(trans_rowcount[0].value);
+    url += "&trans_rowcount=" + encodeURIComponent(trans_rowcount[0].value);
   }
 
   //alert(url);
index 5e5ff80..3e0c500 100644 (file)
@@ -25,15 +25,15 @@ function part_selection_window(input_partnumber, input_description, input_partsi
 
   url = "common.pl?" +
     "action=part_selection_internal&" +
-    "partnumber="              + escape_more(partnumber)        + "&" +
-    "description="             + escape_more(description)       + "&" +
-    "input_partnumber="        + escape_more(input_partnumber)  + "&" +
-    "input_description="       + escape_more(input_description) + "&" +
-    "input_partsid="           + escape_more(input_partsid)     + "&" +
-    "input_partnotes="         + escape_more(input_partnotes)   + "&" +
-    "filter="                  + escape_more(filter)            + "&" +
-    "options="                 + escape_more(options)           + "&" +
-    "formname="                + escape_more(formname)          + "&" +
+    "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)          + "&" +
     "allow_creation="          + (allow_creation ? "1" : "0")   + "&" +
     "action_on_part_selected=" + (null == action_on_part_selected ? "" : action_on_part_selected.value);
   //alert(url);
index 87f8f10..de5dafd 100644 (file)
@@ -3,9 +3,9 @@ function parts_language_selection_window(input_name) {
   var name = document.getElementsByName(input_name)[0].value;
   url = "ic.pl?" +
     "action=parts_language_selection&" +
-    "id="              + escape_more(document.ic.id.value)              + "&" +
-    "language_values=" + escape_more(document.ic.language_values.value) + "&" +
-    "name="            + escape_more(name)                              + "&" +
-    "input_name="      + escape_more(input_name)                        + "&"
+    "id="              + encodeURIComponent(document.ic.id.value)              + "&" +
+    "language_values=" + encodeURIComponent(document.ic.language_values.value) + "&" +
+    "name="            + encodeURIComponent(name)                              + "&" +
+    "input_name="      + encodeURIComponent(input_name)                        + "&"
   window.open(url, "_new_generic", parm);
 }
index 2aeb7d4..5591259 100644 (file)
@@ -16,6 +16,6 @@ function set_history_window(id) {
   url = "common.pl?" +
     "action=show_history&" +
     "longdescription=" + "&" +
-    "input_name=" + escape(id) + "&"
+    "input_name=" + encodeURIComponent(id) + "&"
   window.open(url, "_new_generic", parm);
 }
index 5595e72..3e5bffc 100644 (file)
@@ -7,8 +7,8 @@ function show_vc_details(vc) {
     vc_id = vc_id[0].value;
   url = "common.pl?" +
     "action=show_vc_details&" +
-    "vc=" + escape(vc) + "&" +
-    "vc_id=" + escape(vc_id)
+    "vc=" + encodeURIComponent(vc) + "&" +
+    "vc_id=" + encodeURIComponent(vc_id)
   //alert(url);
   window.open(url, "_new_generic", parm);
 }
index 5423110..93d120a 100644 (file)
@@ -12,14 +12,14 @@ function open_stock_in_out_window(in_out, row) {
 
   url = "do.pl?" +
     "action=stock_in_out_form&" +
-    "in_out="    + escape_more(in_out)    + "&" +
-    "row="       + escape_more(row)       + "&" +
-    "parts_id="  + escape_more(parts_id)  + "&" +
-    "do_qty="    + escape_more(do_qty)    + "&" +
-    "do_unit="   + escape_more(do_unit)   + "&" +
-    "stock="     + escape_more(stock)     + "&" +
-    "closed="    + escape_more(closed)    + "&" +
-    "delivered=" + escape_more(delivered) + "&" +
+    "in_out="    + encodeURIComponent(in_out)    + "&" +
+    "row="       + encodeURIComponent(row)       + "&" +
+    "parts_id="  + encodeURIComponent(parts_id)  + "&" +
+    "do_qty="    + encodeURIComponent(do_qty)    + "&" +
+    "do_unit="   + encodeURIComponent(do_unit)   + "&" +
+    "stock="     + encodeURIComponent(stock)     + "&" +
+    "closed="    + encodeURIComponent(closed)    + "&" +
+    "delivered=" + encodeURIComponent(delivered) + "&" +
     "";
   //alert(url);
   window.open(url, "_new_generic", parm);
index 41f6e17..2986357 100644 (file)
@@ -3,9 +3,9 @@ function vendor_selection_window(input_name, input_id) {
   var name = document.getElementsByName(input_name)[0].value;
   url = "common.pl?" +
     "action=vendor_selection&" +
-    "name=" + escape(name) + "&" +
-    "input_name=" + escape(input_name) + "&" +
-    "input_id=" + escape(input_id)
+    "name=" + encodeURIComponent(name) + "&" +
+    "input_name=" + encodeURIComponent(input_name) + "&" +
+    "input_id=" + encodeURIComponent(input_id)
   //alert(url);
   window.open(url, "_new_generic", parm);
 }
index 6dd456d..70664c3 100644 (file)
@@ -6,10 +6,10 @@
       function open_connection_test_window() {
         // host name port user passwd
         var url = "admin.pl?action=test_db_connection&" +
-          "dbhost="   + escape_more(get_input_value("dbhost"))   + "&" +
-          "dbname="   + escape_more(get_input_value("dbname"))   + "&" +
-          "dbuser="   + escape_more(get_input_value("dbuser"))   + "&" +
-          "dbpasswd=" + escape_more(get_input_value("dbpasswd")) + "&";
+          "dbhost="   + encodeURIComponent(get_input_value("dbhost"))   + "&" +
+          "dbname="   + encodeURIComponent(get_input_value("dbname"))   + "&" +
+          "dbuser="   + encodeURIComponent(get_input_value("dbuser"))   + "&" +
+          "dbpasswd=" + encodeURIComponent(get_input_value("dbpasswd")) + "&";
 
         var parm = centerParms(400,300) + ",width=400,height=300,status=yes,scrollbars=yes";
 
index 71fd282..d02952c 100644 (file)
@@ -6,10 +6,10 @@
       function open_connection_test_window() {
         // host name port user passwd
         var url = "admin.pl?action=test_db_connection&" +
-          "dbhost="   + escape_more(get_input_value("dbhost"))   + "&" +
-          "dbname="   + escape_more(get_input_value("dbname"))   + "&" +
-          "dbuser="   + escape_more(get_input_value("dbuser"))   + "&" +
-          "dbpasswd=" + escape_more(get_input_value("dbpasswd")) + "&";
+          "dbhost="   + encodeURIComponent(get_input_value("dbhost"))   + "&" +
+          "dbname="   + encodeURIComponent(get_input_value("dbname"))   + "&" +
+          "dbuser="   + encodeURIComponent(get_input_value("dbuser"))   + "&" +
+          "dbpasswd=" + encodeURIComponent(get_input_value("dbpasswd")) + "&";
 
         var parm = centerParms(400,300) + ",width=400,height=300,status=yes,scrollbars=yes";