X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_hardware.pm;h=16a5ea99c7e2ac8570b9f9bb8814ce5dff66cf0f;hb=f1446e6af463609c1488ba367d437b728556f35a;hp=b28cc9ef5b131c88a1a4a9a1dbdab9fd861e431c;hpb=fd67c768f2f59f7883197889ef02bb3e1fb2b0c7;p=freeside.git diff --git a/FS/FS/svc_hardware.pm b/FS/FS/svc_hardware.pm index b28cc9ef5..16a5ea99c 100644 --- a/FS/FS/svc_hardware.pm +++ b/FS/FS/svc_hardware.pm @@ -1,10 +1,9 @@ package FS::svc_hardware; +use base qw( FS::svc_Common ); use strict; -use base qw( FS::svc_Common ); use vars qw( $conf ); -use FS::Record qw( qsearch qsearchs ); -use FS::hardware_type; +use FS::Record qw( qsearchs ); #qsearch qsearchs ); use FS::hardware_status; use FS::Conf; @@ -133,7 +132,17 @@ sub search_sql { sub label { my $self = shift; - $self->serial || $self->display_hw_addr; + my @label = (); + if (my $type = $self->hardware_type) { + push @label, 'Type:' . $type->description; + } + if (my $ser = $self->serial) { + push @label, 'Serial#' . $ser; + } + if (my $mac = $self->display_hw_addr) { + push @label, 'MAC:'. $mac; + } + return join(', ', @label); } =item insert @@ -200,13 +209,6 @@ sub check { Returns the L object associated with this installation. -=cut - -sub hardware_type { - my $self = shift; - return qsearchs('hardware_type', { 'typenum' => $self->typenum }); -} - =item status_label Returns the 'label' field of the L object associated