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'
23 <TD ALIGN="right" VALIGN="top">
24 % if ( $opt{no_links} ) {
25 <% $part_svc->svc |h %>:
27 <% FS::UI::Web::svc_link($m, $part_svc, $cust_svc) %>
30 <TD STYLE="padding-bottom:0px" VALIGN="top">
31 % if ( $opt{before_svc_callback} ) {
32 <% &{ $opt{before_svc_callback} }( $cust_svc ) %>
34 <B><% $cust_svc->agent_svcid ? $cust_svc->agent_svcid.': ' : '' %>
35 % if ( $opt{no_links} ) {
36 <% ($cust_svc->label)[1] |h %>
38 <% FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) %>
41 % if ( $opt{after_svc_callback} ) {
42 <% &{ $opt{after_svc_callback} }( $cust_svc ) %>
45 <TD ALIGN="right"><% FS::UI::Web::svc_export_links($m, $part_svc, $cust_svc) %>
46 % if ( $manage_link and $opt{'manage_link_loc'} eq 'right' && ! $opt{no_links} ) {
47 <A HREF="<% $manage_link %>" <% $manage_target %>><% $opt{'manage_link_text'} |h %></A>
51 % if ( $cust_svc->overlimit ) {
53 <TD ALIGN="right" COLSPAN="3" VALIGN="top"
54 STYLE="padding-bottom:1px; padding-top:0px">
55 <FONT SIZE="-2" COLOR="#FFD000">Overlimit: <%
56 time2str('%b %o %Y' . $opt{'cust_pkg-display_times'} ? ' %l:%M %P' : '',
57 $cust_svc->overlimit )
63 % # first column: (optional external balance and) recharge link
64 <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px; padding-top:0px">
65 % if ( $part_svc->svcdb eq 'svc_phone'
69 % my( $html, $hashref ) = $svc_x->export_getstatus;
70 % if ( length($hashref->{'Balance'}) ) { #quelle hack
71 <FONT SIZE="-1">Balance: <b><% $hashref->{'Balance'} %></b> </FONT>
74 % if ( $curuser->access_right('Recharge customer service')
75 % && $part_svc->svcdb eq 'svc_acct'
77 % && ( $svc_x->seconds ne ''
78 % || $svc_x->upbytes ne ''
79 % || $svc_x->downbytes ne ''
80 % || $svc_x->totalbytes ne ''
83 <FONT SIZE="-2">( <% svc_recharge_link($cust_svc)%> )</FONT>
86 % # second column: all other action links
87 <TD ALIGN="right" VALIGN="top" STYLE="padding-bottom:5px; padding-top:0px">
88 % if ( $part_svc->svcdb eq 'svc_broadband' && ! $opt{no_links} ) {
89 <FONT SIZE="-2">( <%
90 include('/elements/popup_link-ping.html',
91 'ip' => $svc_x->ip_addr
93 % if ( $manage_link and $opt{'manage_link_loc'} eq 'bottom' && ! $opt{no_links} ) {
94 <FONT SIZE="-2">( <A HREF="<% $manage_link %>" <% $manage_target %>><% $opt{'manage_link_text'} |h %></A> )</FONT>
97 % if ( $curuser->access_right('Unprovision customer service') && ! $opt{no_links} ) {
98 <FONT SIZE="-2">( <% $svc_unprovision_link %> )</FONT>
105 my $curuser = $FS::CurrentUser::CurrentUser;
107 my $cust_svc = $opt{'cust_svc'};
108 my $part_svc = $opt{'part_svc'} || $cust_svc->part_svc;
109 my $cust_pkg = $opt{'cust_pkg'} || $cust_svc->cust_pkg;
110 my $svc_x = $cust_svc->svc_x;
112 my $svc_unprovision_link =
113 qq!<A HREF="javascript:areyousure('${p}misc/unprovision.cgi?! .
115 qq!', '!.emt('Permanently unprovision and delete this service?').qq!')">!.emt('Unprovision').'</A>';
117 my $manage_link = $opt{'manage_link'};
118 my $manage_target = '';
119 if ( $part_svc->svcdb eq 'svc_broadband' and $manage_link ) {
120 my $ip_addr = $svc_x->ip_addr; #substitution for $manage_link
121 my $mac_addr = $svc_x->mac_addr; # ditto
122 $manage_link = eval(qq("$manage_link"));
123 $opt{'manage_link_text'} ||= mt('Manage Device');
124 $opt{'manage_link_loc'} ||= 'bottom';
125 $manage_target = ' target="_blank"' if $opt{'manage_link-new_window'};