2 tr-cust_svc - Short display of a customer service for use in view/cust_main.
4 Formerly part of view/cust_main/packages/services.html
8 <% include('/elements/tr-cust_svc.html',
10 'part_svc' => $part_svc,
11 'cust_svc' => $cust_svc,
12 'cust_pkg' => $cust_pkg,
14 'cust_pkg-display_times' => '', #bool
15 'manage_link' => '', #for svc_broadband
16 'manage_link_text' => '', #default 'Manage Device'
17 'manage_link_loc' => '', #default 'bottom', or 'right'
18 'maestro-status_test' => '',
24 <TD ALIGN="right" VALIGN="top"><%
25 FS::UI::Web::svc_link($m, $part_svc, $cust_svc)
27 <TD STYLE="padding-bottom:0px"><B><% $cust_svc->agent_svcid ? $cust_svc->agent_svcid.': ' : '' %><%
28 FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc)
30 <TD ALIGN="right"><% FS::UI::Web::svc_export_links($m, $part_svc, $cust_svc) %>
31 % if ( $manage_link and $opt{'manage_link_loc'} eq 'right' ) {
32 <A HREF="<% $manage_link %>" <% $manage_target %>><% $opt{'manage_link_text'} |h %></A>
36 % if ( $cust_svc->overlimit ) {
38 <TD ALIGN="right" COLSPAN="3" VALIGN="top"
39 STYLE="padding-bottom:1px; padding-top:0px">
40 <FONT SIZE="-2" COLOR="#FFD000">Overlimit: <%
41 time2str('%b %o %Y' . $opt{'cust_pkg-display_times'} ? ' %l:%M %P' : '',
42 $cust_svc->overlimit )
48 % # first column: recharge link
49 <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px; padding-top:0px">
50 % if ( $curuser->access_right('Recharge customer service')
51 % && $part_svc->svcdb eq 'svc_acct'
52 % && ( $svc_x->seconds ne ''
53 % || $svc_x->upbytes ne ''
54 % || $svc_x->downbytes ne ''
55 % || $svc_x->totalbytes ne ''
58 <FONT SIZE="-2">( <% svc_recharge_link($cust_svc)%> )</FONT>
61 % # second column: all other action links
62 <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px; padding-top:0px">
63 % if ( $part_svc->svcdb eq 'svc_broadband' ) {
64 <FONT SIZE="-2">( <%
65 include('/elements/popup_link-ping.html',
66 'ip' => $svc_x->ip_addr
68 % if ( $manage_link and $opt{'manage_link_loc'} eq 'bottom' ) {
69 <FONT SIZE="-2">( <A HREF="<% $manage_link %>" <% $manage_target %>><% $opt{'manage_link_text'} |h %></A> )</FONT>
72 % if ( $curuser->access_right('Unprovision customer service') ) {
73 <FONT SIZE="-2">( <% $svc_unprovision_link %> )</FONT>
75 % if ( $part_svc->svcdb eq 'svc_pbx' && $opt{'maestro-status_test'} ) {
76 <FONT SIZE="-2">( <A HREF="<%$p%>misc/maestro-customer_status-test.html?<% $cust_pkg->custnum.'+'.$cust_svc->svcnum %>">Test maestro status</A> )
84 my $curuser = $FS::CurrentUser::CurrentUser;
86 my $cust_svc = $opt{'cust_svc'};
87 my $part_svc = $opt{'part_svc'} || $cust_svc->part_svc;
88 my $cust_pkg = $opt{'cust_pkg'} || $cust_svc->cust_pkg;
89 my $svc_x = $cust_svc->svc_x;
91 my $svc_unprovision_link =
92 qq!<A HREF="javascript:areyousure('${p}misc/unprovision.cgi?! .
94 qq!', '!.emt('Permanently unprovision and delete this service?').qq!')">!.emt('Unprovision').'</A>';
96 my $manage_link = $opt{'manage_link'};
97 my $manage_target = '';
98 if ( $part_svc->svcdb eq 'svc_broadband' and $manage_link ) {
99 my $ip_addr = $svc_x->ip_addr; #substitution for $manage_link
100 $manage_link = eval(qq("$manage_link"));
101 $opt{'manage_link_text'} ||= mt('Manage Device');
102 $opt{'manage_link_loc'} ||= 'bottom';
103 $manage_target = ' target="_blank"' if $opt{'manage_link-new_window'};