[freeside-commits] freeside/FS/FS Conf.pm, 1.324.2.30, 1.324.2.31 svc_phone.pm, 1.20.2.5, 1.20.2.6
Ivan,,,
ivan at wavetail.420.am
Fri Mar 12 14:02:22 PST 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv19022/FS/FS
Modified Files:
Tag: FREESIDE_1_9_BRANCH
Conf.pm svc_phone.pm
Log Message:
add svc_phone-phone_name-max_length config, RT#7047
Index: svc_phone.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_phone.pm,v
retrieving revision 1.20.2.5
retrieving revision 1.20.2.6
diff -u -w -d -r1.20.2.5 -r1.20.2.6
--- svc_phone.pm 12 Mar 2010 21:29:16 -0000 1.20.2.5
+++ svc_phone.pm 12 Mar 2010 22:02:20 -0000 1.20.2.6
@@ -2,7 +2,7 @@
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;
@@ -23,6 +23,7 @@
#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
@@ -383,6 +384,10 @@
;
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) ) {
Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.324.2.30
retrieving revision 1.324.2.31
diff -u -w -d -r1.324.2.30 -r1.324.2.31
--- Conf.pm 9 Mar 2010 04:41:08 -0000 1.324.2.30
+++ Conf.pm 12 Mar 2010 22:02:20 -0000 1.324.2.31
@@ -3304,6 +3304,13 @@
},
{
+ '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' => '',
'description' => 'Default countrcode',
More information about the freeside-commits
mailing list