'type' => 'checkbox',
},
+ {
+ 'key' => 'svc_phone-phone_name-max_length',
+ 'section' => '',
+ 'description' => 'Maximum length of the phone service "Name" field (svc_phone.phone_name). Sometimes useful to limit this (to 15?) when exporting as Caller ID data.',
+ 'type' => 'text',
+ },
+
{
'key' => 'default_phone_countrycode',
'section' => '',
use strict;
use base qw( FS::svc_Domain_Mixin FS::location_Mixin FS::svc_Common );
-use vars qw( $DEBUG $me @pw_set $conf );
+use vars qw( $DEBUG $me @pw_set $conf $phone_name_max );
use Data::Dumper;
use Scalar::Util qw( blessed );
use FS::Conf;
#ask FS::UID to run this stuff for us later
$FS::UID::callback{'FS::svc_acct'} = sub {
$conf = new FS::Conf;
+ $phone_name_max = $conf->config('svc_phone-phone_name-max_length');
};
=head1 NAME
;
return $error if $error;
+ return 'Name ('. $self->phone_name.
+ ") is longer than $phone_name_max characters"
+ if $phone_name_max && length($self->phone_name) > $phone_name_max;
+
$self->countrycode(1) unless $self->countrycode;
unless ( length($self->sip_password) ) {
},
'sip_password',
'pin',
- 'phone_name',
+ { field => 'phone_name',
+ type => 'text',
+ maxlength => $conf->config('svc_phone-phone_name-max_length'),
+ },
{ value => 'E911 Information',
type => 'tablebreak-tr-title',