X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fsvc_phone.pm;h=8e39b9f10546a997b8af71b5c971861d94734418;hp=fca33690df6ad7b4de6b342453299480d6401e7d;hb=633c48448d9468690b7ad77eb6ff7c660a286658;hpb=6cb5c702b17b98be46adea4539e15d5f312e5be1 diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm index fca33690d..8e39b9f10 100644 --- a/FS/FS/svc_phone.pm +++ b/FS/FS/svc_phone.pm @@ -63,9 +63,51 @@ points to. You can ask the object for a copy with the I method. =cut # the new method can be inherited from FS::Record, if a table method is defined +# +sub table_info { + { + 'name' => 'Phone number', + 'sorts' => 'phonenum', + 'display_weight' => 60, + 'cancel_weight' => 80, + 'fields' => { + 'countrycode' => { label => 'Country code', + type => 'text', + disable_inventory => 1, + }, + 'phonenum' => 'Phone number', + 'pin' => { label => 'Personal Identification Number', + type => 'text', + disable_inventory => 1, + }, + }, + }; +} sub table { 'svc_phone'; } +=item search_sql STRING + +Class method which returns an SQL fragment to search for the given string. + +=cut + +sub search_sql { + my( $class, $string ) = @_; + $class->search_sql_field('phonenum', $string ); +} + +=item label + +Returns the phone number. + +=cut + +sub label { + my $self = shift; + $self->phonenum; #XXX format it better +} + =item insert Adds this record to the database. If there is an error, returns the error,