From e9b7648aa4f838e45de95128dc22053aa8eafdb4 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 22 Feb 2006 13:07:48 +0000 Subject: [PATCH] add vonage click2call feature --- FS/FS/Conf.pm | 20 ++++++++++++++++++ httemplate/elements/phonenumber.html | 23 +++++++++++++++++++++ httemplate/images/red_telephone_mimooh_01.png | Bin 0 -> 921 bytes httemplate/view/cust_main/contacts.html | 28 ++++++++++++++++++++------ 4 files changed, 65 insertions(+), 6 deletions(-) create mode 100644 httemplate/elements/phonenumber.html create mode 100644 httemplate/images/red_telephone_mimooh_01.png 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 https://secure.click2callu.com/)', + 'type' => 'text', + }, + { + 'key' => 'vonage-password', + 'section' => '', + 'description' => 'Vonage Click2Call username (see https://secure.click2callu.com/)', + 'type' => 'text', + }, + { + 'key' => 'vonage-fromnumber', + 'section' => '', + 'description' => 'Vonage Click2Call number (see https://secure.click2callu.com/)', + '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; +%> + + + + +<% if ( length($number) ) { %> + <%= $number %> + <% if ( $opt{'callable'} && $conf->config('vonage-username') ) { %> + Call this number + <% } %> +<% } else { %> +   +<% } %> diff --git a/httemplate/images/red_telephone_mimooh_01.png b/httemplate/images/red_telephone_mimooh_01.png new file mode 100644 index 0000000000000000000000000000000000000000..2212ff0e8574c945f76a836d29410f3ce654a7e7 GIT binary patch literal 921 zcmV;K17`e*P)dSCcWKw6X~4@ z;YAV%kzQB{g&Bq!iixis-v{bMYQD`jUz)Y)+|HakXTL5SQfc7>&(-te%lG?yf6tev zs}e*{`BvWl%wn_S@z3WpHNEg`M@RB_clY34-n-1TS|(4Rc8Itj#dv^0WYEWh-Tabf)niOwt*BV@R%7EkuN^y9 znU~23_z`>YHm)`_$gio97mE>saP_LxrAz9EhQLyO_&d|+m9ny(o2E^hS9S1UOfCnG zU_0JL=Yj?57A|~D*|;rRNT>aV5uSSlx}>u5n~kZ|{PJ`<5&}4cudo_5xP9S*!CX!* zm68{Nypa*(Z{1RnPV2#ehi(>tmy*e~H)hSs20|c=5DpVQB77f9Rr%X|} zV~1==UMEu*v3$`dD4 z^!7U6+UoU-7bQ|DM>84SgM;pn+r^iMSp!iGAyDlF8DyYaX^ZEgC= zZs)uGEXME?1Er4H&#)>%Qv=o08Iy-77E?ZE4CosgG8lp@+&jRh#~9d10kfM~ vF^-A?N+U`W#D}?ijo%0O@K=uhSG@fN1W`yGF?D@}00000NkvXXu0mjf)(5mx literal 0 HcmV?d00001 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 %> <%= $daytime_label %> - - <%= $cust_main->daytime || ' ' %> + + <%= include('/elements/phonenumber.html', + $cust_main->daytime, + 'callable'=>1 + ) + %> <%= $night_label %> - - <%= $cust_main->night || ' ' %> + + <%= include('/elements/phonenumber.html', + $cust_main->night, + 'callable'=>1 + ) + %> @@ -111,13 +119,21 @@ Service address <%= $daytime_label %> - <%= $cust_main->get("${pre}daytime") || ' ' %> + <%= include('/elements/phonenumber.html', + $cust_main->get("${pre}daytime"), + 'callable'=>1 + ) + %> <%= $night_label %> - <%= $cust_main->get("${pre}night") || ' ' %> + <%= include('/elements/phonenumber.html', + $cust_main->get("${pre}night"), + 'callable'=>1 + ) + %> -- 2.11.0