Switch to UTF8 when in JS/AJAX mode
authorJoey Schulze <joey@infodrom.org>
Thu, 24 Sep 2015 18:21:32 +0000 (18:21 +0000)
committerJoey Schulze <joey@infodrom.org>
Thu, 24 Sep 2015 18:21:32 +0000 (18:21 +0000)
src/InfoCon/account/list.wml
src/InfoCon/account/query.wml

index c17a294..f0fc1e8 100644 (file)
@@ -160,7 +160,7 @@ function filter_popup()
 {
     if (!$('#filter_popup form input').length) {
        $.get('query.php',
 {
     if (!$('#filter_popup form input').length) {
        $.get('query.php',
-             window.location.search.substr(1),
+             window.location.search.substr(1)+'&ajax=1',
              function(data) {
                  var text = '<style type="text/css">';
                  text += '#fc { z-index: 10; }';
              function(data) {
                  var text = '<style type="text/css">';
                  text += '#fc { z-index: 10; }';
index dc44b67..8d51f70 100644 (file)
@@ -98,8 +98,10 @@ input.checkbox {
 <select id=category name=category>
 <option>
 <?
 <select id=category name=category>
 <option>
 <?
-  foreach ($accounting->distinctCategories($_GET['blzkto']) as $row)
+  foreach ($accounting->distinctCategories($_GET['blzkto']) as $row) {
+    if (!empty($_GET['ajax'])) $row->category = utf8_encode($row->category);
     printf ("<option value=\"%s\">%s", $row->category, $row->category);
     printf ("<option value=\"%s\">%s", $row->category, $row->category);
+  }
 ?></select>
 
 <br class="none">
 ?></select>
 
 <br class="none">
@@ -107,8 +109,10 @@ input.checkbox {
 <select id=from_to name=from_to>
 <option>
 <?
 <select id=from_to name=from_to>
 <option>
 <?
-  foreach ($accounting->distinctFromTo($_GET['blzkto']) as $row)
+  foreach ($accounting->distinctFromTo($_GET['blzkto']) as $row) {
+    if (!empty($_GET['ajax'])) $row->from_to = utf8_encode($row->from_to);
     printf ("<option value=\"%s\">%s", $row->from_to, $row->from_to);
     printf ("<option value=\"%s\">%s", $row->from_to, $row->from_to);
+  }
 ?></select>
 
 <br class="none">
 ?></select>
 
 <br class="none">