X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2F477.html;h=cc865e0d475f8ec83782c5a281a2e80977a4ac9b;hb=b3bcbc3dda6f1b994f206c22b02acddb17ebdf1a;hp=fb85f1e09b4771408a54c0c37d8b5192960482ee;hpb=022bfd91eca7ae26f8f6ee125179f5c0ff4cbb72;p=freeside.git

diff --git a/httemplate/search/477.html b/httemplate/search/477.html
index fb85f1e09..cc865e0d4 100644
--- a/httemplate/search/477.html
+++ b/httemplate/search/477.html
@@ -49,13 +49,23 @@ a.download {
   <thead>
     <& $header &>
   </thead>
+%   my $rownum = 0;
 %   foreach my $row (@$data) {
   <tr>
+%     my $first = 1;
 %     foreach my $item (@$row) {
-    <td><% $item %></td>
+    <td>
+%     if ($first and $part_link{$partname}) {
+      <a href="<% $part_link{$partname} . "477rownum=$rownum" %>"><% $item || '(empty)' %></a>
+%       $first = 0;
+%     } else {
+      <% $item %>
 %     }
+    </td>
+%   } #foreach $item
   </tr>
-%   }
+%   $rownum++;
+%   } #foreach $row
 </table>
 % } # foreach $partname
 <& /elements/footer.html &>
@@ -64,6 +74,7 @@ die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('List packages');
 
 my %parts;
+my %part_link;
 # load from cache if possible
 my $session;
 if ( $cgi->param('session') =~ /^(\d+)$/ ) {
@@ -83,8 +94,16 @@ my @partnames = grep /^\w+$/, $cgi->param('parts');
 foreach my $partname (@partnames) {
   $parts{$partname} ||= FS::Report::FCC_477->report( $partname,
     date      => $date,
-    agentnum  => $agentnum
+    agentnum  => $agentnum,
   );
+  my $detail_table = FS::Report::FCC_477->part_table($partname);
+  if ($detail_table eq 'cust_pkg') {
+    my $link = popurl(1).'cust_pkg.cgi?477part='.$partname.";date=$date;";
+    if ($agentnum) {
+      $link .= "agentnum=$agentnum;";
+    }
+    $part_link{$partname} = $link;
+  } # don't include detail links to deploy_blocks, that's pointless
 }
 $m->cache->set($session, \%parts, '1h');