X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fphonenumber.html;h=736984b45d46d3346c1370760bd846d83abb5c8f;hp=60414a644781e7b65c3b3bcbfc19170a089330a4;hb=c3da5cf1caa244937d280e0f406927103beef148;hpb=d6ed8d790ea01fad5bcb42ea3fcb58cf8c5aac2c diff --git a/httemplate/elements/phonenumber.html b/httemplate/elements/phonenumber.html index 60414a644..736984b45 100644 --- a/httemplate/elements/phonenumber.html +++ b/httemplate/elements/phonenumber.html @@ -4,24 +4,70 @@ <% $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!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, +%# ) +%# %> + + <<% $img %>> + + + +% } +% % } % +% if ( $opt{'calling_list_exempt'} ) { + - calling list exempt +% } +% % } else {   @@ -34,7 +80,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");