[freeside-commits] freeside/FS/FS Schema.pm, 1.239.2.16, 1.239.2.17 part_device.pm, 1.2, 1.2.4.1
Erik Levinson
levinse at wavetail.420.am
Sat Jan 22 12:03:55 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv30714/FS/FS
Modified Files:
Tag: FREESIDE_2_1_BRANCH
Schema.pm part_device.pm
Log Message:
populate MAC address from inventory for svc_phone devices, RT7794
Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.239.2.16
retrieving revision 1.239.2.17
diff -u -w -d -r1.239.2.16 -r1.239.2.17
--- Schema.pm 22 Jan 2011 02:45:32 -0000 1.239.2.16
+++ Schema.pm 22 Jan 2011 20:03:51 -0000 1.239.2.17
@@ -2810,7 +2810,7 @@
'columns' => [
'devicepart', 'serial', '', '', '', '',
'devicename', 'varchar', '', $char_d, '', '',
- #'classnum', #tie to an inventory class?
+ 'inventory_classnum', 'int', 'NULL', '', '', '',
],
'primary_key' => 'devicepart',
'unique' => [ [ 'devicename' ] ], #?
Index: part_device.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_device.pm,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -u -w -d -r1.2 -r1.2.4.1
--- part_device.pm 8 Feb 2010 15:37:28 -0000 1.2
+++ part_device.pm 22 Jan 2011 20:03:51 -0000 1.2.4.1
@@ -40,6 +40,7 @@
devicename
+=item inventory_classnum
=back
@@ -103,6 +104,7 @@
my $error =
$self->ut_numbern('devicepart')
|| $self->ut_text('devicename')
+ || $self->ut_foreign_keyn('inventory_classnum', 'inventory_class', 'classnum')
;
return $error if $error;
@@ -121,6 +123,19 @@
qsearch( 'export_device', { 'devicepart' => $self->devicepart } );
}
+=item inventory_class
+
+Returns the inventory class (see L<FS::inventory_class>) for this device,
+if any.
+
+=cut
+
+sub inventory_class {
+ my $self = shift;
+ return '' unless $self->inventory_classnum;
+ qsearchs('inventory_class', { 'classnum' => $self->inventory_classnum });
+}
+
sub process_batch_import {
my $job = shift;
More information about the freeside-commits
mailing list