X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_hardware.pm;h=4970b3e92ada8df30775ee782ee1c87bac95d586;hb=b79a8cb932946c849328a3c117c35821d9d21e66;hp=5b81a9c2b69bdfea4652c523971c71c7862eca7d;hpb=b65b8096089410001dfbcd35f9a56f9405b9f5f1;p=freeside.git diff --git a/FS/FS/svc_hardware.pm b/FS/FS/svc_hardware.pm index 5b81a9c2b..4970b3e92 100644 --- a/FS/FS/svc_hardware.pm +++ b/FS/FS/svc_hardware.pm @@ -45,6 +45,8 @@ The following fields are currently supported: =item serial - Serial number +=item smartcard - Smartcard number, for devices that use a smartcard + =item statusnum - Service status (see L) =item note - Installation notes: location on property, physical access, etc. @@ -82,6 +84,7 @@ sub table_info { 'serial' => { label => 'Serial number', %opts }, 'hw_addr' => { label => 'Hardware address', %opts }, 'ip_addr' => { label => 'IP address', %opts }, + 'smartcard' => { label => 'Smartcard #', %opts }, 'statusnum' => { label => 'Service status', type => 'select', select_table => 'hardware_status', @@ -112,7 +115,12 @@ sub search_sql { $hex =~ s/\W//g; push @where, 'svc_hardware.hw_addr LIKE \'%'.$hex.'%\''; } - '(' . join(' OR ', @where) . ')'; + + if ( @where ) { + '(' . join(' OR ', @where) . ')'; + } else { + '1 = 0'; #false + } } sub label { @@ -160,8 +168,9 @@ sub check { || $self->ut_ip46n('ip_addr') || $self->ut_hexn('hw_addr') || $self->ut_alphan('serial') + || $self->ut_alphan('smartcard') || $self->ut_foreign_keyn('statusnum', 'hardware_status', 'statusnum') - || $self->ut_textn('note') + || $self->ut_anything('note') ; return $error if $error;