if ( $svc_x->isa('FS::svc_pbx') ) {
+ return 'Name must be 19 characters or less (thirdlane restriction?)'
+ if length($svc_x->title) > 19;
+
+ return 'Name must consist of alphanumerics and spaces only (thirdlane restriction?)'
+ unless $svc_x->title =~ /^[\w\s]+$/;
+
my $tenant = {
'tenant' => $svc_x->title,
'maxusers' => $svc_x->max_extensions,
use strict;
use base qw( FS::svc_External_Common );
-#use FS::Record qw( qsearch qsearchs );
+use FS::Record qw( qsearchs ); # qsearch );
use FS::cust_svc;
=head1 NAME
$self->SUPER::check;
}
+#XXX this is a way-too simplistic implementation
+# at the very least, title should be unique across exports that need that or
+# controlled by a conf setting or something
+sub _check_duplicate {
+ my $self = shift;
+
+ $self->lock_table;
+
+ if ( qsearchs( 'svc_pbx', { 'title' => $self->title } ) ) {
+ return "Name in use";
+ } else {
+ return '';
+ }
+}
+
=back
=head1 BUGS