RT#8465: add service label to downloadable package reports
authormark <mark>
Fri, 28 May 2010 07:51:01 +0000 (07:51 +0000)
committermark <mark>
Fri, 28 May 2010 07:51:01 +0000 (07:51 +0000)
httemplate/search/cust_pkg.cgi

index adbec7a..74a3a6d 100755 (executable)
                     #      '</table>';
                     #    },
                     sub {
+                      my $cust_pkg = shift;
+                      my $type = $cgi->param('_type') || '';
+                      if ($type =~ /xls|csv/) {
+                        my $cust_svc = $cust_pkg->primary_cust_svc;
+                        if($cust_svc) {
+                          return join ": ",($cust_svc->label)[0,1];
+                        }
+                        else {
+                          return '';
+                        }
+                      }
+                      else {
                           [ map {
                                   [ 
                                     { 'data' => $_->[0]. ':',
                                                 $_->[2]. '.cgi?'. $_->[3],
                                     },
                                   ];
-                                } shift->labels
+                                } $cust_pkg->labels
                           ];
-                        },
+                      }
+                    }
                   ],
                   'color' => [
                     '',