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
'display_weight' => 70,
'cancel_weight' => 90,
'fields' => {
- 'id' => 'Thirdlane ID',
- 'title' => 'Description',
+ 'id' => 'ID',
+ 'title' => 'Name',
'max_extensions' => 'Maximum number of User Extensions',
# 'field' => 'Description',
# 'another_field' => {
=item label
-Returns a meaningful identifier for this PBX tenant.
+Returns the title field for this PBX tenant.
=cut
sub label {
my $self = shift;
- $self->label_field; #or something more complicated if necessary
+ $self->title;
}
=item insert
$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