[freeside-commits] freeside/httemplate/elements phonenumber.html,
1.5, 1.6
Ivan,,,
ivan at wavetail.420.am
Thu Mar 15 18:35:57 PDT 2007
Update of /home/cvs/cvsroot/freeside/httemplate/elements
In directory wavetail:/tmp/cvs-serv22234/httemplate/elements
Modified Files:
phonenumber.html
Log Message:
vonage click2call integration should not be sitewide, especially now that we have user prefs
Index: phonenumber.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/elements/phonenumber.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- phonenumber.html 22 Jan 2007 11:36:40 -0000 1.5
+++ phonenumber.html 16 Mar 2007 01:35:55 -0000 1.6
@@ -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>
More information about the freeside-commits
mailing list