summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/477.html25
-rwxr-xr-xhttemplate/search/cust_pkg.cgi1
2 files changed, 23 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');
diff --git a/httemplate/search/cust_pkg.cgi b/httemplate/search/cust_pkg.cgi
index c38848721..c88b3a1d5 100755
--- a/httemplate/search/cust_pkg.cgi
+++ b/httemplate/search/cust_pkg.cgi
@@ -158,6 +158,7 @@ $search_hash{'query'} = $cgi->keywords;
#scalars
for (qw( agentnum cust_status cust_main_salesnum salesnum custnum magic status
custom cust_fields pkgbatch zip
+ 477part 477rownum date
))
{
$search_hash{$_} = $cgi->param($_) if length($cgi->param($_));