% unless ( $opt{'js_only'} ) { % ### % # extension % ### % ### % # pin % ### % ### % # sip_password % ### % ### % # phone_name % ###
>
Extension
>
PIN
MAXLENGTH = <% $passwordmax + 2 %> <% $onchange %> >
SIP Password
>
Name
% } <%init> my( %opt ) = @_; my $conf = new FS::Conf; my $passwordmax = $conf->config('sip_passwordmax') || 80; my $name = $opt{'element_name'} || $opt{'field'} || 'extensionnum'; my $id = $opt{'id'} || 'extensionnum'; my $curr_value = $opt{'curr_value'} || $opt{'value'}; my $onchange = ''; if ( $opt{'onchange'} ) { $onchange = $opt{'onchange'}; $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/; $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange #callbacks should act the same $onchange = 'onChange="'. $onchange. '"'; } my $pbx_extension = $curr_value ? qsearchs('pbx_extension', { 'extensionnum' => $curr_value } ) : new FS::pbx_extension {};