diff options
author | ivan <ivan> | 2007-03-16 01:35:55 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-03-16 01:35:55 +0000 |
commit | 7b3d074cbb694330334469510548d98eebe196ed (patch) | |
tree | 01fff36adbef8226f83634f5cf7775399cf157f3 /httemplate/elements | |
parent | 0219157aab31141211f9342993e65a262da3cf29 (diff) |
vonage click2call integration should not be sitewide, especially now that we have user prefs
Diffstat (limited to 'httemplate/elements')
-rw-r--r-- | httemplate/elements/phonenumber.html | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/httemplate/elements/phonenumber.html b/httemplate/elements/phonenumber.html index ffbd8c100..b1ae2aa2a 100644 --- a/httemplate/elements/phonenumber.html +++ b/httemplate/elements/phonenumber.html @@ -1,22 +1,31 @@ -% -% my( $number, %opt ) = @_; -% my $conf = new FS::Conf; -% ( my $snumber = $number ) =~ s/\D//g; -% - <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws_iframe.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws_draggable.js"></SCRIPT> <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/iframecontentmws.js"></SCRIPT> + % if ( length($number) ) { <% $number %> -% if ( $opt{'callable'} && $conf->config('vonage-username') ) { - <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('https://secure.click2callu.com/tpcc/makecall?username=<% $conf->config('vonage-username') %>&password=<% $conf->config('vonage-password') %>&fromnumber=<% $conf->config('vonage-fromnumber')%>&tonumber=1<% $snumber %>', 240, 64, 'call_popup'), CAPTION, 'Initiating call', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE, WIDTH, 240, HEIGHT, 64 ); return false;" TITLE="Call this number"><IMG SRC="<%$fsurl%>images/red_telephone_mimooh_01.png" BORDER=0 ALT="Call this number"></A> -% } +% if ( $opt{'callable'} && $curuser->option('vonage-username') ) { + + <A HREF="javascript:void(0);" onClick="overlib( OLiframeContent('https://secure.click2callu.com/tpcc/makecall?username=<% uri_escape($curuser->option('vonage-username')) %>&password=<% uri_escape($curuser->option('vonage-password')) %>&fromnumber=<% uri_escape($curuser->option('vonage-fromnumber')) %>&tonumber=1<% $snumber %>', 240, 64, 'call_popup'), CAPTION, 'Initiating call', STICKY, AUTOSTATUSCAP, CLOSECLICK, DRAGGABLE, WIDTH, 240, HEIGHT, 64 ); return false;" TITLE="Call this number"><IMG SRC="<%$fsurl%>images/red_telephone_mimooh_01.png" BORDER=0 ALT="Call this number"></A> + +% } +% % } else { + % } +<%init> + +my( $number, %opt ) = @_; +( my $snumber = $number ) =~ s/\D//g; + +my $curuser = $FS::CurrentUser::CurrentUser; + +( my $vonage_number = $curuser->option('vonage-fromnumber') ) =~ s/\D//g; +$vonage_number =~ /^1/ or $vonage_number = "1$vonage_number"; +</%init> |