add legacy_cust_bill to hold legacy invoice content, RT#12981
[freeside.git] / httemplate / elements / phonenumber.html
1 <% include('/elements/init_overlib.html') %>
2
3 % if ( length($number) ) { 
4
5     <% $number %>
6
7 %   if ( $opt{'callable'} ) {
8 %
9 %     if ( $curuser->option('vonage-username') ) { 
10 %
11 %       (my $vonage_number = $curuser->option('vonage-fromnumber')) =~ s/\D//g;
12 %       $vonage_number =~ /^1/ or $vonage_number = "1$vonage_number";
13
14         <% include('/elements/popup_link.html',
15              'action'      =>
16                'https://secure.click2callu.com/tpcc/makecall'.
17                '?username='. uri_escape($curuser->option('vonage-username')).
18                '&password='. uri_escape($curuser->option('vonage-password')).
19                "&fromnumber=$vonage_number".
20                "&tonumber=$snumber",
21              'width'       => 240,
22              'height'      => 64,
23              'actionlabel' => 'Initiating call',
24              'label'       => "<$img>",
25            )
26         %>
27
28 %     } elsif ( $curuser->option('snom-ip') ) {
29 %
30 %       my $host = $curuser->option('snom-ip');
31 %       if ( $curuser->option('snom-username') ) {
32 %         my $userpass = uri_escape($curuser->option('snom-username'));
33 %         $userpass .= ':'. uri_escape($curuser->option('snom-password'))
34 %           if $curuser->option('snom-password');
35 %         $host = $userpass.'@'.$host;
36 %       }
37 %
38 %       $snumber = "1$snumber" unless $snumber =~ /~1/; #NANPA-centric
39
40 %#        <% include('/elements/popup_link.html',
41 %#             'action'      => "http://$host/command.htm?number=$snumber",
42 %#             %link_common,
43 %#           )
44 %#        %>
45
46         <A HREF="javascript:snom_call(<%$snumber%>)"><<% $img %>></A>
47
48         <SCRIPT TYPE="text/javascript">
49           function snom_call(number) {
50
51             var url = '<% "http://$host/command.htm?number=" %>';
52             url = url + number;
53
54             var xmlhttp = new XMLHttpRequest();
55             xmlhttp.open('GET', url, true);
56             xmlhttp.send(null);
57
58           }
59
60         </SCRIPT>
61
62
63 %     }
64 %
65 %   } 
66 %
67 %   if ( $opt{'calling_list_exempt'} ) {
68  - calling list exempt
69 %   }
70 %
71 % } else { 
72
73   &nbsp;
74
75 % } 
76 <%init>
77
78 my( $number, %opt ) = @_;
79 ( my $snumber = $number ) =~ s/\D//g;
80
81 my $curuser = $FS::CurrentUser::CurrentUser;
82
83 my $img = qq(IMG SRC="${fsurl}images/red_telephone_mimooh_01.png" BORDER=0 ALT="Call this number");
84
85 </%init>