don't look up or display census tracts for non-U.S. addresses, #32249
[freeside.git] / httemplate / view / cust_main / packages / services.html
index 5f458e6..bb676e8 100644 (file)
@@ -3,20 +3,22 @@
 % ###
 
   <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
-    <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH="100%">
+    <TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=2 WIDTH="100%">
     <SCRIPT TYPE="text/javascript">
 function clearhint_search_cust_svc(obj, str) {
   if (obj.value == str) obj.value = '';
 }
     </SCRIPT>
 
-%  foreach my $part_svc ( $cust_pkg->part_svc(
-%                           'summarize_size' => $opt{'cust_pkg-large_pkg_size'}
-%                       ) )
-%  {
-
+%  foreach my $part_svc (
+%    $cust_pkg->part_svc(
+%      'summarize_size'    => $opt{'cust_pkg-large_pkg_size'},
+%      'hide_discontinued' => $opt{'cust_pkg-hide_discontinued-part_svc'},
+%    )
+%  ) {
+%
 %    my $num_cust_svc = $cust_pkg->num_cust_svc( $part_svc->svcpart );
-
+%
 %    if ( $opt{'cust_pkg-large_pkg_size'} > 0 and
 %         $opt{'cust_pkg-large_pkg_size'} <= $num_cust_svc ) { # summarize
 %
@@ -24,7 +26,7 @@ function clearhint_search_cust_svc(obj, str) {
         <TD ALIGN="right" VALIGN="top">
 %       my $href="${p}search/cust_pkg_svc.html?svcpart=".$part_svc->svcpart.
 %          ";pkgnum=".$cust_pkg->pkgnum;
-        <A HREF="<% $href %>"><% $part_svc->svc %></A>
+        <A HREF="<% $href %>"><% $part_svc->svc |h %></A>
         </TD>
         <TD ALIGN="left" VALIGN="top">
         <A HREF="<% $href %>"><B>(<% mt("view all [_1]", $num_cust_svc) |h %>)</B></A>
@@ -74,9 +76,21 @@ function clearhint_search_cust_svc(obj, str) {
 
       <TR>
         <TD COLSPAN=3 ALIGN="center" STYLE="padding-bottom:4px;padding-top:0px">
-          <B><% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %></B>
+
+          <B>
+%         if ( $opt{no_links} ) {
+            <% $part_svc->svc |h %>: <% $part_svc->num_avail %>
+            <% mt('Available') |h %>
+%         } else {
+            <% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %>
+%         }
+          </B>
+
 %        if ( $curuser->access_right('Bulk provision customer service') 
-%               && $part_svc->svcdb eq 'svc_phone' ) {
+%               && $part_svc->svcdb eq 'svc_phone'
+%               && ! $opt{no_links}
+%           )
+%        {
 %          if ( $part_svc->num_avail > 5 ) {
 %             local $opt{'bulk'} = 1;
               <BR><% svc_provision_link($cust_pkg, $part_svc, \%opt, $curuser) %>
@@ -104,8 +118,6 @@ my $cust_pkg = $opt{'cust_pkg'};
 my $part_pkg = $opt{'part_pkg'};
 my $curuser  = $FS::CurrentUser::CurrentUser;
 
-my $conf = new FS::Conf;
-
 sub svc_provision_link {
   my ($cust_pkg, $part_svc, $opt, $curuser) = @_;