From 978862f11a10e6a0a8b6010d22be3f15bf7ea8f5 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 6 Mar 2013 16:32:44 -0800 Subject: cleanup phone devices, RT#21623 --- httemplate/misc/macinventory.cgi | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'httemplate/misc/macinventory.cgi') diff --git a/httemplate/misc/macinventory.cgi b/httemplate/misc/macinventory.cgi index b07da9726..7ed5c6607 100644 --- a/httemplate/misc/macinventory.cgi +++ b/httemplate/misc/macinventory.cgi @@ -13,13 +13,8 @@ die "unknown devicepart $devicepart" unless $part_device; my $inventory_class = $part_device->inventory_class; die "devicepart $devicepart has no inventory" unless $inventory_class; -my @inventory_item = +my @macs = + map $_->item, qsearch('inventory_item', { 'classnum' => $inventory_class->classnum } ); -my @macs; - -foreach my $inventory_item ( @inventory_item ) { - push @macs, $inventory_item->item; -} - -- cgit v1.2.1 From 54156948ccda87655f9f4bb26a2747ab49b616ce Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 17 Apr 2013 21:09:26 -0700 Subject: move from legacy compat JSON to_json to modern JSON::XS encode_json, RT#22630 --- httemplate/misc/macinventory.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/misc/macinventory.cgi') diff --git a/httemplate/misc/macinventory.cgi b/httemplate/misc/macinventory.cgi index 7ed5c6607..cec0e3121 100644 --- a/httemplate/misc/macinventory.cgi +++ b/httemplate/misc/macinventory.cgi @@ -1,4 +1,4 @@ -<% objToJson(\@macs) %> +<% encode_json(\@macs) %>\ <%init> # XXX: this should be agent-virtualized / limited -- cgit v1.2.1