X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fpbx_extension.html;fp=httemplate%2Felements%2Fpbx_extension.html;h=62a1f5172f6fa377403398ab2961a51f71a0e1b0;hb=6ac45d15e85b10e3d63645c26a0a2acbad103df1;hp=0000000000000000000000000000000000000000;hpb=5fbd483ef56737fad894f18ec311a817c40054f0;p=freeside.git diff --git a/httemplate/elements/pbx_extension.html b/httemplate/elements/pbx_extension.html new file mode 100644 index 000000000..62a1f5172 --- /dev/null +++ b/httemplate/elements/pbx_extension.html @@ -0,0 +1,113 @@ +% 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 {}; + +