X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fsvc_pbx.pm;h=37c7bb7195576cd7671e5d6d16f01d431b12b0b1;hb=046395d0a66db2f057c80768e01ae0f5b06bc555;hp=4ba8e6660fdcb1e145c70c6d0fb985cc6974a946;hpb=72d25b4abaa6e8e909c12c67ce45cd4eaa7ce867;p=freeside.git diff --git a/FS/FS/svc_pbx.pm b/FS/FS/svc_pbx.pm index 4ba8e6660..37c7bb719 100644 --- a/FS/FS/svc_pbx.pm +++ b/FS/FS/svc_pbx.pm @@ -2,7 +2,7 @@ package FS::svc_pbx; 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 @@ -80,7 +80,7 @@ sub table_info { 'display_weight' => 70, 'cancel_weight' => 90, 'fields' => { - 'id' => 'Thirdlane ID', + 'id' => 'ID', 'title' => 'Name', 'max_extensions' => 'Maximum number of User Extensions', # 'field' => 'Description', @@ -214,6 +214,21 @@ sub check { $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