optimize package view with tons of packages, RT#28526
[freeside.git] / httemplate / view / cust_main / packages / package.html
index e97c141..ab7bad2 100644 (file)
         %>
         <A NAME="cust_pkg<% $cust_pkg->pkgnum %>"
            ID  ="cust_pkg<% $cust_pkg->pkgnum %>"
-        ><% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B></A>
-        - 
-        <% $part_pkg->custom_comment |h %>
+        ><% $opt{show_pkgnum} ? $cust_pkg->pkgnum.': ' : '' %><B><% $part_pkg->pkg |h %></B></A>
+%       my $custom_comment = $part_pkg->custom_comment('cust_pkg'=>$cust_pkg);
+        <% $custom_comment ? ' - ' : '' %>
+        <% $custom_comment |h %>
       </TD>
     </TR>
 
               <% $br ? '<BR>' : '' %>
 %           } 
 
-%           if ( $cust_pkg->num_cust_event
-%                && (    $curuser->access_right('Billing event reports')
+%           if (    (    $curuser->access_right('Billing event reports')
 %                     || $curuser->access_right('View customer billing events')
 %                   )
+%                && $cust_pkg->num_cust_event
 %              ) {
               (&nbsp;<%pkg_event_link($cust_pkg)%>&nbsp;)
 %           }