blob: cec0e312177227e310585c03d3c3639bddc6979c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<% encode_json(\@macs) %>\
<%init>
# XXX: this should be agent-virtualized / limited
my $devicepart = $cgi->param('arg');
die 'invalid devicepart' unless $devicepart =~ /^\d+$/;
my $part_device = qsearchs('part_device', { 'devicepart' => $devicepart } );
die "unknown devicepart $devicepart" unless $part_device;
my $inventory_class = $part_device->inventory_class;
die "devicepart $devicepart has no inventory" unless $inventory_class;
my @macs =
map $_->item,
qsearch('inventory_item', { 'classnum' => $inventory_class->classnum } );
</%init>
|