diff options
author | Mark Wells <mark@freeside.biz> | 2014-09-30 00:53:58 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2014-09-30 00:53:58 -0700 |
commit | fa9e50e040977723813e884f93f7f7c5819c9037 (patch) | |
tree | e6845f340b793049e66f1aa4e3329fc7601a908c /httemplate/search/477.html | |
parent | 95759ff41840195d29cc28e492c895d6db55dd8f (diff) |
detail links on new 477 report, #30360
Diffstat (limited to 'httemplate/search/477.html')
-rw-r--r-- | httemplate/search/477.html | 25 |
1 files changed, 22 insertions, 3 deletions
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'); |