move from legacy compat JSON to_json to modern JSON::XS encode_json, RT#22630
authorIvan Kohler <ivan@freeside.biz>
Thu, 18 Apr 2013 04:09:26 +0000 (21:09 -0700)
committerIvan Kohler <ivan@freeside.biz>
Thu, 18 Apr 2013 04:09:26 +0000 (21:09 -0700)
17 files changed:
httemplate/misc/areacodes.cgi
httemplate/misc/choose_tax_location.html
httemplate/misc/cust-part_pkg.cgi
httemplate/misc/exchanges.cgi
httemplate/misc/location.cgi
httemplate/misc/macinventory.cgi
httemplate/misc/maestro-customer_status.html
httemplate/misc/part_svc-columns.cgi
httemplate/misc/phonenums.cgi
httemplate/misc/regions.cgi
httemplate/misc/xmlhttp-address_standardize.html
httemplate/misc/xmlhttp-calculate_taxes.html
httemplate/misc/xmlhttp-cust_bill-search.html
httemplate/misc/xmlhttp-cust_main-censustract.html
httemplate/misc/xmlhttp-cust_main-discount_terms.cgi
httemplate/misc/xmlhttp-cust_main-search.cgi
httemplate/misc/xmlhttp-ping.html

index 9d32a3b..4b31deb 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson(\@areacodes) %>
+<% encode_json(\@areacodes) %>\
 <%init>
 
 my( $state, $svcpart ) = $cgi->param('arg');
index 6ef7623..23099c4 100644 (file)
@@ -11,7 +11,7 @@
 %   map { $value{$_} = $location{$_} } qw ( city state )
 %     if $location{country} eq 'CA';
 %
-%   my $value = encode_entities(objToJson({ %value })
+%   my $value = encode_entities(encode_json({ %value })
 %                              );
 %   my $content = '';
 %   $content .= $location->$_. '&nbsp;' x ( $max{$_} - length($location->$_) )
index a277ba4..43b9229 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson( \@return ) %>
+<% encode_json( \@return ) %>\
 <%init>
 
 my( $custnum, $prospectnum, $classnum ) = $cgi->param('arg');
index 8a67f7b..0de4ace 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson(\@exchanges) %>
+<% encode_json(\@exchanges) %>\
 <%init>
 
 my( $areacode, $svcpart ) = $cgi->param('arg');
index 35ae0f1..fab61dd 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson(\%hash) %>
+<% encode_json(\%hash) %>\
 <%init>
 
 my $locationnum = $cgi->param('arg');
index 7ed5c66..cec0e31 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson(\@macs) %>
+<% encode_json(\@macs) %>\
 <%init>
 
 # XXX: this should be agent-virtualized / limited
index 8acae2b..a872d49 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson( $return ) %>
+<% encode_json( $return ) %>\
 <%init>
 
 my $return;
index 0602561..a86164d 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson(\@output) %>
+<% encode_json(\@output) %>\
 <%init>
 
 my $conf = new FS::Conf;
index 5084628..a048280 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson(\@phonenums) %>
+<% encode_json(\@phonenums) %>\
 <%init>
 
 my( $exchangestring, $svcpart ) = $cgi->param('arg');
index 2450ea3..31538b0 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson(\@regions) %>
+<% encode_json(\@regions) %>\
 <%init>
 
 my( $state, $svcpart ) = $cgi->param('arg');
index 15f266a..6182653 100644 (file)
@@ -1,4 +1,4 @@
-<% encode_json($return) %>
+<% encode_json($return) %>\
 <%init>
 
 local $SIG{__DIE__}; #disable Mason error trap
index d3dc36a..ed7bd01 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson($return) %>
+<% encode_json($return) %>\
 <%init>
 
 my $DEBUG = 0;
index 459c5db..c60a0b0 100644 (file)
@@ -1,4 +1,4 @@
-<% encode_json(\@return) %>
+<% encode_json(\@return) %>\
 <%init>
 
 my $curuser = $FS::CurrentUser::CurrentUser;
index 4b00898..4c708a4 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson($return) %>
+<% encode_json($return) %>\
 <%init>
 
 my %arg = $cgi->param('arg');
index b524e69..36b18b4 100644 (file)
@@ -16,7 +16,7 @@
 %     }
 %   }
 %
-<% objToJson($return) %>
+<% encode_json($return) %>\
 % } 
 <%init>
 
index acf7e70..73c9ff8 100644 (file)
@@ -5,7 +5,7 @@
 %                                  # cust_main-agent_custid-format') eq 'ww?d+'
 %      $return = findbycustnum_or_agent_custid($1);
 %   }
-<% objToJson($return) %>
+<% encode_json($return) %>\
 % } elsif ( $sub eq 'smart_search' ) {
 %
 %   my $string = $cgi->param('arg');
 %                    @cust_main
 %                ];
 %     
-<% objToJson($return) %>
+<% encode_json($return) %>\
 % } elsif ( $sub eq 'invnum_search' ) {
 %
 %   my $string = $cgi->param('arg');
 %   if ( $string =~ /^(\d+)$/ ) {
 %     my $inv = qsearchs('cust_bill', { 'invnum' => $1 });
 %     my $return = $inv ? findbycustnum($inv->custnum) : [];
-<% objToJson($return) %>
+<% encode_json($return) %>\
 %   } else { #return nothing
 []
 %   }
@@ -47,7 +47,7 @@
 %       city => $_->city,
 %     };
 %   }
-<% objToJson($return) %>
+<% encode_json($return) %>\
 % }
 <%init>
 
index e993032..01baa3f 100644 (file)
@@ -1,4 +1,4 @@
-<% objToJson($return) %>
+<% encode_json($return) %>\
 <%init>
 
 my $conf = new FS::Conf;