% if ( $columnflag eq 'F' ) {
<& fixed.html, %opt &>
% } elsif ( $use_selector ) {
% my $servers = $exports[0]->get_sip_servers;
% # pretty simple selector, they're all just hostnames/IP addresses
<& tr-select.html,
%opt,
options => $servers,
&>
% } else {
<& tr-input-text.html, %opt &>
% }
<%init>
my %opt = @_;
my $cell_style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
$opt{'field'} ||= 'sip_server';
#false laziness w/select-did.html
#XXX make sure this comes through on errors too
my $svcpart = $opt{'svcpart'}
|| $opt{'object'}->svcpart
|| $opt{'object'}->cust_svc->svcpart;
my $part_svc = qsearchs('part_svc', { 'svcpart'=>$svcpart } );
die "unknown svcpart $svcpart" unless $part_svc;
my $columnflag;
my $psc = $part_svc->part_svc_column($opt{'field'});
if ( $psc ) {
$columnflag = $psc->columnflag;
}
my @exports = $part_svc->part_export_did;
if ( scalar(@exports) > 1 ) {
die "more than one DID-providing export attached to svcpart $svcpart";
}
my $use_selector = 0;
if ( $exports[0] and $exports[0]->can('get_sip_servers') ) {
$use_selector = 1;
}
%init>