X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fsvc_phone.pm;h=00ccc1958485f4e5c2b696c90a8d4499ba7bcbf9;hp=fca33690df6ad7b4de6b342453299480d6401e7d;hb=65b1729a22924fd72ba24449727268159b070b36;hpb=c8cccb4a92adceb943c635fe62dad0d034462ce0 diff --git a/FS/FS/svc_phone.pm b/FS/FS/svc_phone.pm index fca33690d..00ccc1958 100644 --- a/FS/FS/svc_phone.pm +++ b/FS/FS/svc_phone.pm @@ -63,9 +63,53 @@ 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, + disable_select => 1, + }, + 'phonenum' => 'Phone number', + 'pin' => { label => 'Personal Identification Number', + type => 'text', + disable_inventory => 1, + disable_select => 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,