1 % unless ( $opt{'js_only'} ) {
3 <INPUT TYPE="hidden" NAME="<%$name%>" ID="<%$id%>" VALUE="<% $curr_value %>">
5 <TABLE STYLE="display:inline">
14 NAME = "<%$name%>_extension"
15 ID = "<%$id%>_extension"
16 VALUE = "<% scalar($cgi->param($name.'_extension'))
17 || $pbx_extension->extension
24 <FONT SIZE="-1">Extension</FONT>
33 NAME = "<%$name%>_pin"
35 VALUE = "<% scalar($cgi->param($name.'_pin'))
36 || $pbx_extension->pin
43 <FONT SIZE="-1">PIN</FONT>
52 NAME = "<%$name%>_sip_password"
53 ID = "<%$id%>_sip_password"
54 VALUE = "<% scalar($cgi->param($name.'_sip_password'))
55 || $pbx_extension->sip_password
57 SIZE = <% $passwordmax == 80 ? 20 : $passwordmax + 2 %>
58 MAXLENGTH = <% $passwordmax + 2 %>
62 <FONT SIZE="-1">SIP Password</FONT>
71 NAME = "<%$name%>_phone_name"
72 ID = "<%$id%>_phone_name"
73 VALUE = "<% scalar($cgi->param($name.'_phone_name'))
74 || $pbx_extension->phone_name
81 <FONT SIZE="-1">Name</FONT>
92 my $conf = new FS::Conf;
93 my $passwordmax = $conf->config('sip_passwordmax') || 80;
95 my $name = $opt{'element_name'} || $opt{'field'} || 'extensionnum';
96 my $id = $opt{'id'} || 'extensionnum';
98 my $curr_value = $opt{'curr_value'} || $opt{'value'};
101 if ( $opt{'onchange'} ) {
102 $onchange = $opt{'onchange'};
103 $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
104 $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack. all onchange
105 #callbacks should act the same
106 $onchange = 'onChange="'. $onchange. '"';
109 my $pbx_extension = $curr_value
110 ? qsearchs('pbx_extension', { 'extensionnum' => $curr_value } )
111 : new FS::pbx_extension {};