diff options
| author | ivan <ivan> | 2010-02-04 06:53:14 +0000 | 
|---|---|---|
| committer | ivan <ivan> | 2010-02-04 06:53:14 +0000 | 
| commit | 6d43279ab6b571ad33d2d89d7403b72fdf5bc772 (patch) | |
| tree | c7e6d093c16a46527fa81b580c95d7250ae355ec | |
| parent | bd1c27e102584213471743d155b8f27d0d0f5bd9 (diff) | |
snom autodial integration
| -rw-r--r-- | httemplate/elements/phonenumber.html | 75 | ||||
| -rw-r--r-- | httemplate/pref/pref-process.html | 4 | ||||
| -rw-r--r-- | httemplate/pref/pref.html | 26 | 
3 files changed, 87 insertions, 18 deletions
diff --git a/httemplate/elements/phonenumber.html b/httemplate/elements/phonenumber.html index 60414a644..854f5846d 100644 --- a/httemplate/elements/phonenumber.html +++ b/httemplate/elements/phonenumber.html @@ -4,22 +4,64 @@      <% $number %> -%   if ( $opt{'callable'} && $curuser->option('vonage-username') ) {  - -      <% include('/elements/popup_link.html', -           'action'      => -             'https://secure.click2callu.com/tpcc/makecall'. -             '?username='. uri_escape($curuser->option('vonage-username')). -             '&password='. uri_escape($curuser->option('vonage-password')). -             "&fromnumber=$vonage_number". -             "&tonumber=$snumber", -           'width'       => 240, -           'height'      => 64, -           'actionlabel' => 'Initiating call', -           'label'       => qq!<IMG SRC="${fsurl}images/red_telephone_mimooh_01.png" BORDER=0 ALT="Call this number">!, -         ) -      %> +%   if ( $opt{'callable'} ) { +% +%     if ( $curuser->option('vonage-username') ) {  +% +%       (my $vonage_number = $curuser->option('vonage-fromnumber')) =~ s/\D//g; +%       $vonage_number =~ /^1/ or $vonage_number = "1$vonage_number"; + +        <% include('/elements/popup_link.html', +             'action'      => +               'https://secure.click2callu.com/tpcc/makecall'. +               '?username='. uri_escape($curuser->option('vonage-username')). +               '&password='. uri_escape($curuser->option('vonage-password')). +               "&fromnumber=$vonage_number". +               "&tonumber=$snumber", +             'width'       => 240, +             'height'      => 64, +             'actionlabel' => 'Initiating call', +             'label'       => "<$img>", +           ) +        %> + +%     } elsif ( $curuser->option('snom-ip') ) { +% +%       my $host = $curuser->option('snom-ip'); +%       if ( $curuser->option('snom-username') ) { +%         my $userpass = uri_escape($curuser->option('snom-username')); +%         $userpass .= ':'. uri_escape($curuser->option('snom-password')) +%           if $curuser->option('snom-password'); +%         $host = $userpass.'@'.$host; +%       } +% +%       $snumber = "1$snumber" unless $snumber =~ /~1/; #NANPA-centric + +%#        <% include('/elements/popup_link.html', +%#             'action'      => "http://$host/command.htm?number=$snumber", +%#             %link_common, +%#           ) +%#        %> + +        <A HREF="javascript:snom_call(<%$snumber%>)"><<% $img %>></A> +        <SCRIPT TYPE="text/javascript"> +          function snom_call(number) { + +            var url = '<% "http://$host/command.htm?number=" %>'; +            url = url + number; + +            var xmlhttp = new XMLHttpRequest(); +            xmlhttp.open('GET', url, true); +            xmlhttp.send(null); + +          } + +        </SCRIPT> + + +%     } +%  %   }   %  % } else {  @@ -34,7 +76,6 @@ my( $number, %opt ) = @_;  my $curuser = $FS::CurrentUser::CurrentUser; -( my $vonage_number = $curuser->option('vonage-fromnumber') ) =~ s/\D//g; -$vonage_number =~ /^1/ or $vonage_number = "1$vonage_number"; +my $img = qq(IMG SRC="${fsurl}images/red_telephone_mimooh_01.png" BORDER=0 ALT="Call this number");  </%init> diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html index 378164e7b..2b6c969f8 100644 --- a/httemplate/pref/pref-process.html +++ b/httemplate/pref/pref-process.html @@ -45,8 +45,10 @@ unless ( $error ) { # if ($access_user) {    #XXX autogen    my @paramlist = qw( menu_position default_customer_view                        email_address +                      snom-ip snom-username snom-password                        vonage-fromnumber vonage-username vonage-password -                      show_pkgnum show_db_profile save_db_profile +                      show_pkgnum show_confitem_counts +                      show_db_profile save_db_profile                        height width availHeight availWidth colorDepth                      ); diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html index 562ef2980..5cd75e26c 100644 --- a/httemplate/pref/pref.html +++ b/httemplate/pref/pref.html @@ -80,6 +80,10 @@ Development      <TD><INPUT TYPE="checkbox" NAME="show_pkgnum" VALUE="1" <% $curuser->option('show_pkgnum') ? 'CHECKED' : '' %>></TD>    </TR>    <TR> +    <TH>Show config item counts: </TH> +    <TD><INPUT TYPE="checkbox" NAME="show_confitem_counts" VALUE="1" <% $curuser->option('show_confitem_counts') ? 'CHECKED' : '' %>></TD> +  </TR> +  <TR>      <TH>Show database profiling (when available): </TH>      <TD><INPUT TYPE="checkbox" NAME="show_db_profile" VALUE="1" <% $curuser->option('show_db_profile') ? 'CHECKED' : '' %>></TD>    </TR> @@ -91,6 +95,28 @@ Development  </TABLE>  <BR> +SNOM integration +<% ntable("#cccccc",2) %> + +  <TR> +    <TH ALIGN="right">SNOM IP address</TH> +    <TD><INPUT TYPE="text" NAME="snom-ip" VALUE="<% $curuser->option('snom-ip') %>"></TD> +  </TR> + +  <TR> +    <TH ALIGN="right">SNOM HTTP username (if necessary)</TH> +    <TD><INPUT TYPE="text" NAME="snom-username" VALUE="<% $curuser->option('snom-username') %>"></TD> +  </TR> + +  <TR> +    <TH ALIGN="right">SNOM HTTP password (if necessary)</TH> +    <TD><INPUT TYPE="password" NAME="snom-password" VALUE="<% $curuser->option('snom-password') %>"></TD> +  </TR> + +</TABLE> +<BR> + +OR<BR><BR>  Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)  <% ntable("#cccccc",2) %>  | 
