%doc>
tr-cust_svc - Short display of a customer service for use in view/cust_main.
Formerly part of view/cust_main/packages/services.html
Usage:
<% include('/elements/tr-cust_svc.html',
#required
'part_svc' => $part_svc,
'cust_svc' => $cust_svc,
'cust_pkg' => $cust_pkg,
#optional
'cust_pkg-display_times' => '', #bool
'svc_broadband-manage_link' => '',
'maestro-status_test' => '',
)
%>
%doc>
<%
FS::UI::Web::svc_link($m, $part_svc, $cust_svc)
%> |
<%
FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc)
%> |
<% FS::UI::Web::svc_export_links($m, $part_svc, $cust_svc) %> |
% if ( $cust_svc->overlimit ) {
Overlimit: <%
time2str('%b %o %Y' . $opt{'cust_pkg-display_times'} ? ' %l:%M %P' : '',
$cust_svc->overlimit )
%>
|
% }
% # first column: recharge link
% if ( $curuser->access_right('Recharge customer service')
% && $part_svc->svcdb eq 'svc_acct'
% && ( $svc_x->seconds ne ''
% || $svc_x->upbytes ne ''
% || $svc_x->downbytes ne ''
% || $svc_x->totalbytes ne ''
% )
% ) {
( <% svc_recharge_link($cust_svc)%> )
% }
|
% # second column: all other action links
% if ( $part_svc->svcdb eq 'svc_broadband' ) {
( <%
include('/elements/popup_link-ping.html',
'ip' => $svc_x->ip_addr
) %> )
% my $manage_link = $opt{'svc_broadband-manage_link'};
% if ( $manage_link ) {
% my $ip_addr = $svc_x->ip_addr; #substitution for $manage_link
( "><% mt('Manage Device') |h %> )
% }
% } #svc_broadband
% if ( $curuser->access_right('Unprovision customer service') ) {
( <% $svc_unprovision_link %> )
% }
% if ( $part_svc->svcdb eq 'svc_pbx' && $opt{'maestro-status_test'} ) {
( Test maestro status )
% }
|
<%init>
my %opt = @_;
my $curuser = $FS::CurrentUser::CurrentUser;
my $cust_svc = $opt{'cust_svc'};
my $part_svc = $opt{'part_svc'} || $cust_svc->part_svc;
my $cust_pkg = $opt{'cust_pkg'} || $cust_svc->cust_pkg;
my $svc_x = $cust_svc->svc_x;
my $svc_unprovision_link =
qq!!.emt('Unprovision').'';
%init>