summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/Conf.pm20
-rw-r--r--httemplate/elements/phonenumber.html27
-rw-r--r--httemplate/pref/pref.html64
3 files changed, 62 insertions, 49 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index d9f7d19..5f7cb8f 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -1852,26 +1852,6 @@ httemplate/docs/config.html
'type' => 'checkbox',
},
- #these should become per-user...
- {
- 'key' => 'vonage-username',
- 'section' => '',
- 'description' => 'Vonage Click2Call username (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
- 'type' => 'text',
- },
- {
- 'key' => 'vonage-password',
- 'section' => '',
- 'description' => 'Vonage Click2Call username (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
- 'type' => 'text',
- },
- {
- 'key' => 'vonage-fromnumber',
- 'section' => '',
- 'description' => 'Vonage Click2Call number (see <a href="https://secure.click2callu.com/">https://secure.click2callu.com/</a>)',
- 'type' => 'text',
- },
-
{
'key' => 'echeck-nonus',
'section' => 'billing',
diff --git a/httemplate/elements/phonenumber.html b/httemplate/elements/phonenumber.html
index ffbd8c1..b1ae2aa 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 {
&nbsp;
+
% }
+<%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>
diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html
index 507a897..229ac0e 100644
--- a/httemplate/pref/pref.html
+++ b/httemplate/pref/pref.html
@@ -8,39 +8,63 @@
Change password (leave blank for no change)
<% ntable("#cccccc",2) %>
-<TR>
- <TD ALIGN="right">Current password: </TD>
- <TD><INPUT TYPE="password" NAME="_password"></TD>
-</TR>
+ <TR>
+ <TH ALIGN="right">Current password: </TH>
+ <TD><INPUT TYPE="password" NAME="_password"></TD>
+ </TR>
-<TR>
- <TD ALIGN="right">New password: </TD>
- <TD><INPUT TYPE="password" NAME="new_password"></TD>
-</TR>
+ <TR>
+ <TH ALIGN="right">New password: </TH>
+ <TD><INPUT TYPE="password" NAME="new_password"></TD>
+ </TR>
-<TR>
- <TD ALIGN="right">Re-enter new password: </TD>
- <TD><INPUT TYPE="password" NAME="new_password2"></TD>
-</TR>
+ <TR>
+ <TH ALIGN="right">Re-enter new password: </TH>
+ <TD><INPUT TYPE="password" NAME="new_password2"></TD>
+ </TR>
</TABLE>
<BR>
+
Interface
<% ntable("#cccccc",2) %>
-<TR>
- <TD>Menu location: </TD>
- <TD>
- <INPUT TYPE="radio" NAME="menu_position" VALUE="left" onClick="document.images['menu_example'].src='../images/menu-left-example.png';" <% $menu_position eq 'left' ? ' CHECKED' : ''%>> Left<BR>
- <INPUT TYPE="radio" NAME="menu_position" VALUE="top"onClick="document.images['menu_example'].src='../images/menu-top-example.png';" <% $menu_position eq 'top' ? ' CHECKED' : ''%>> Top <BR>
- </TD>
- <TD><IMG NAME="menu_example" SRC="../images/menu-<% $menu_position %>-example.png"></TD>
-</TR>
+ <TR>
+ <TH>Menu location: </TH>
+ <TD>
+ <INPUT TYPE="radio" NAME="menu_position" VALUE="left" onClick="document.images['menu_example'].src='../images/menu-left-example.png';" <% $menu_position eq 'left' ? ' CHECKED' : ''%>> Left<BR>
+ <INPUT TYPE="radio" NAME="menu_position" VALUE="top"onClick="document.images['menu_example'].src='../images/menu-top-example.png';" <% $menu_position eq 'top' ? ' CHECKED' : ''%>> Top <BR>
+ </TD>
+ <TD><IMG NAME="menu_example" SRC="../images/menu-<% $menu_position %>-example.png"></TD>
+ </TR>
</TABLE>
<BR>
+
+Vonage integration (see <a href="https://secure.click2callu.com/">Click2Call</a>)
+<% ntable("#cccccc",2) %>
+
+ <TR>
+ <TH ALIGN="right">Vonage phone number</TH>
+ <TD><INPUT TYPE="text" NAME="vonage-fromnumber"></TD>
+ </TR>
+
+ <TR>
+ <TH ALIGN="right">Vonage username</TH>
+ <TD><INPUT TYPE="text" NAME="vonage-username"></TD>
+ </TR>
+
+ <TR>
+ <TH ALIGN="right">Vonage password</TH>
+ <TD><INPUT TYPE="password" NAME="vonage-password"></TD>
+ </TR>
+
+</TABLE>
+<BR>
+
+
% foreach my $prop (qw( height width availHeight availWidth colorDepth )) {
<INPUT TYPE="hidden" NAME="<% $prop %>" VALUE="">
<SCRIPT TYPE="text/javascript">