[freeside-commits] freeside/httemplate/misc macinventory.cgi, NONE, 1.1.2.2
Erik Levinson
levinse at wavetail.420.am
Sat Jan 22 12:03:55 PST 2011
Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail.420.am:/tmp/cvs-serv30714/httemplate/misc
Added Files:
Tag: FREESIDE_2_1_BRANCH
macinventory.cgi
Log Message:
populate MAC address from inventory for svc_phone devices, RT7794
--- NEW FILE: macinventory.cgi ---
<% objToJson(\@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 @inventory_item =
qsearch('inventory_item', { 'classnum' => $inventory_class->classnum } );
my @macs;
foreach my $inventory_item ( @inventory_item ) {
push @macs, $inventory_item->item;
}
</%init>
More information about the freeside-commits
mailing list