summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/Conf.pm20
-rw-r--r--httemplate/elements/phonenumber.html23
-rw-r--r--httemplate/images/red_telephone_mimooh_01.pngbin0 -> 921 bytes
-rw-r--r--httemplate/view/cust_main/contacts.html28
4 files changed, 65 insertions, 6 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index 88dbdf082..a5add28d8 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -1661,6 +1661,26 @@ 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',
+ },
+
);
1;
diff --git a/httemplate/elements/phonenumber.html b/httemplate/elements/phonenumber.html
new file mode 100644
index 000000000..1330ca109
--- /dev/null
+++ b/httemplate/elements/phonenumber.html
@@ -0,0 +1,23 @@
+<%
+ my( $number, %opt ) = @_;
+ my $conf = new FS::Conf;
+ ( my $snumber = $number ) =~ s/\D//g;
+%>
+<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws.js"></SCRIPT>
+<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_iframe.js"></SCRIPT>
+<SCRIPT TYPE="text/javascript" SRC="../elements/overlibmws_draggable.js"></SCRIPT>
+<SCRIPT TYPE="text/javascript">
+function OLiframeContent(src, width, height, name) {
+ return ('<iframe src="'+src+'" width="'+width+'" height="'+height+'"'
+ +(name?' name="'+name+'" id="'+name+'"':'')+' scrolling="auto">'
+ +'<div>[iframe not supported]</div></iframe>');
+}
+</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>
+ <% } %>
+<% } else { %>
+ &nbsp;
+<% } %>
diff --git a/httemplate/images/red_telephone_mimooh_01.png b/httemplate/images/red_telephone_mimooh_01.png
new file mode 100644
index 000000000..2212ff0e8
--- /dev/null
+++ b/httemplate/images/red_telephone_mimooh_01.png
Binary files differ
diff --git a/httemplate/view/cust_main/contacts.html b/httemplate/view/cust_main/contacts.html
index 456d117a6..89926ea64 100644
--- a/httemplate/view/cust_main/contacts.html
+++ b/httemplate/view/cust_main/contacts.html
@@ -51,14 +51,22 @@ Billing address
%>
<TR>
<TD ALIGN="right"><%= $daytime_label %></TD>
- <TD COLSPAN=5 BGCOLOR="#ffffff">
- <%= $cust_main->daytime || '&nbsp' %>
+ <TD COLSPAN=6 BGCOLOR="#ffffff">
+ <%= include('/elements/phonenumber.html',
+ $cust_main->daytime,
+ 'callable'=>1
+ )
+ %>
</TD>
</TR>
<TR>
<TD ALIGN="right"><%= $night_label %></TD>
- <TD COLSPAN=5 BGCOLOR="#ffffff">
- <%= $cust_main->night || '&nbsp' %>
+ <TD COLSPAN=6 BGCOLOR="#ffffff">
+ <%= include('/elements/phonenumber.html',
+ $cust_main->night,
+ 'callable'=>1
+ )
+ %>
</TD>
</TR>
<TR>
@@ -111,13 +119,21 @@ Service address
<TR>
<TD ALIGN="right"><%= $daytime_label %></TD>
<TD COLSPAN=5 BGCOLOR="#ffffff">
- <%= $cust_main->get("${pre}daytime") || '&nbsp' %>
+ <%= include('/elements/phonenumber.html',
+ $cust_main->get("${pre}daytime"),
+ 'callable'=>1
+ )
+ %>
</TD>
</TR>
<TR>
<TD ALIGN="right"><%= $night_label %></TD>
<TD COLSPAN=5 BGCOLOR="#ffffff">
- <%= $cust_main->get("${pre}night") || '&nbsp' %>
+ <%= include('/elements/phonenumber.html',
+ $cust_main->get("${pre}night"),
+ 'callable'=>1
+ )
+ %>
</TD>
</TR>
<TR>