diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-04-17 20:44:39 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-04-17 20:44:39 -0700 |
commit | 04bf3e2423b070d3e3e2a2e6006b678bcf11b481 (patch) | |
tree | df34ab7f8a9a14305a2b2b6124035f680cc559ef /httemplate/elements | |
parent | 9fbee73725ce02023c76179d573048cf4177903b (diff) |
move from legacy compat JSON to_json to modern JSON::XS encode_json, RT#22630
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/auto-table.html | 4 | ||||
-rw-r--r-- | httemplate/elements/dashboard-toplist.html | 3 | ||||
-rw-r--r-- | httemplate/elements/select-tiered.html | 7 | ||||
-rw-r--r-- | httemplate/elements/tr-select-cust_location.html | 2 |
4 files changed, 3 insertions, 13 deletions
diff --git a/httemplate/elements/auto-table.html b/httemplate/elements/auto-table.html index 3a3bd405d..5118b91ff 100644 --- a/httemplate/elements/auto-table.html +++ b/httemplate/elements/auto-table.html @@ -50,7 +50,7 @@ var <%$pre%>next_rownum; var <%$pre%>set_rownum; var <%$pre%>addRow; var <%$pre%>deleteRow; -var <%$pre%>fieldorder = <% to_json($fieldorder) %>; +var <%$pre%>fieldorder = <% encode_json($fieldorder) %>; function <%$pre%>possiblyAddRow_factory(obj) { var callback = obj.onchange; @@ -190,7 +190,7 @@ function <%$pre%>init() { <%$pre%>template.appendChild(delete_cell); // preload rows - var rows = <% to_json(\@rows) %>; + var rows = <% encode_json(\@rows) %>; for (var i = 0; i < rows.length; i++) { <%$pre%>addRow(rows[i]); } diff --git a/httemplate/elements/dashboard-toplist.html b/httemplate/elements/dashboard-toplist.html index f4a372519..b80af7883 100644 --- a/httemplate/elements/dashboard-toplist.html +++ b/httemplate/elements/dashboard-toplist.html @@ -169,7 +169,6 @@ if ( $FS::TicketSystem::system eq 'RT_Internal' ObjectCustomFieldValues.ObjectId = cust_tickets.Id ) GROUP BY cust_tickets.custnum, ObjectCustomFieldValues.Content"; - #warn $sql."\n"; } else { # no custom_priority_field $sql = "SELECT cust_tickets.custnum, @@ -181,10 +180,8 @@ if ( $FS::TicketSystem::system eq 'RT_Internal' my $sth = dbh->prepare($sql) or die dbh->errstr; $sth->execute or die $sth->errstr; while ( my $row = $sth->fetchrow_hashref ) { - #warn to_json($row)."\n"; $num_tickets_by_priority{ $row->{priority} }->{ $row->{custnum} } = $row->{num_tickets}; } } -#warn Dumper \%num_tickets_by_priority; </%init> diff --git a/httemplate/elements/select-tiered.html b/httemplate/elements/select-tiered.html index e332eeff8..3ff5471ae 100644 --- a/httemplate/elements/select-tiered.html +++ b/httemplate/elements/select-tiered.html @@ -124,13 +124,6 @@ my %opt = @_; my $pre = $opt{prefix} || ''; my $tiers = $opt{tiers} or die "no tiers defined"; -#my $json = JSON->new()->canonical(); #sort -# something super weird and broken going on with JSON's auto-loading, just -# using JSON alone errors out with -# Can't locate object method "new" via package "null" (perhaps you forgot to -# load "null"?) -# yes, "null", not "JSON". so instead, using JSON::XS explicity... -use JSON::XS; my $json = JSON::XS->new(); $json->canonical; diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index 4c17249bd..780bf96ad 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -153,7 +153,7 @@ Example: } } - var location_fields = <% to_json(\@location_fields) %>; + var location_fields = <% encode_json(\@location_fields) %>; function update_location( string ) { var hash = JSON.parse(string); for(var i = 0; i < location_fields.length; i++) { |