get rid of header foo in individual templates
[freeside.git] / httemplate / search / cust_pkg.cgi
index 2ab6e2b..93ce7ae 100755 (executable)
@@ -1,5 +1,5 @@
 <%
-# <!-- $Id: cust_pkg.cgi,v 1.3 2001-08-19 08:32:43 ivan Exp $ -->
+# <!-- $Id: cust_pkg.cgi,v 1.6 2001-10-30 14:54:07 ivan Exp $ -->
 
 use strict;
 use vars qw ( $cgi @cust_pkg $sortby $query %part_pkg );
@@ -58,8 +58,7 @@ if ( scalar(@cust_pkg) == 1 ) {
   eidiot("No packages found");
 } else {
   my($total)=scalar(@cust_pkg);
-  print $cgi->header( '-expires' => 'now' ),
-        header('Package Search Results',''),
+  print header('Package Search Results',''),
         "$total matching packages found<BR>", &table(), <<END;
       <TR>
         <TH>Package</TH>
@@ -86,27 +85,31 @@ END
     sort $sortby grep(!$saw{$_->pkgnum}++, @cust_pkg)
   ) {
     my($cust_main)=qsearchs('cust_main',{'custnum'=>$cust_pkg->custnum});
-    my($pkgnum, $custnum, $last, $first, $company,
-       $ship_last, $ship_first, $ship_company)=(
+    my($pkgnum, $custnum, $last, $first, $company) = (
       $cust_pkg->pkgnum,
       $cust_pkg->custnum,
       $cust_main ? $cust_main->last : '',
       $cust_main ? $cust_main->first : '',
       $cust_main ? $cust_main->company : '',
-      $cust_main
-        ? ( $cust_main->ship_last || $cust_main->getfield('last') )
-        : '',
-      $cust_main 
-        ? ( $cust_main->ship_last
-            ? $cust_main->ship_first
-            : $cust_main->first )
-        : '',
-      $cust_main 
-        ? ( $cust_main->ship_last
-            ? $cust_main->ship_company
-            : $cust_main->company )
-        : '',
     );
+    my($ship_last, $ship_first, $ship_company);
+    if ( defined dbdef->table('cust_main')->column('ship_last') ) {
+      ($ship_last, $ship_first, $ship_company) = (
+        $cust_main
+          ? ( $cust_main->ship_last || $cust_main->getfield('last') )
+          : '',
+        $cust_main 
+          ? ( $cust_main->ship_last
+              ? $cust_main->ship_first
+              : $cust_main->first )
+          : '',
+        $cust_main 
+          ? ( $cust_main->ship_last
+              ? $cust_main->ship_company
+              : $cust_main->company )
+          : '',
+      );
+    }
     my $pkg = $part_pkg{$cust_pkg->pkgpart}->pkg;
     #$pkg .= ' - '. $part_pkg{$cust_pkg->pkgpart}->comment;
     my @cust_svc = qsearch( 'cust_svc', { 'pkgnum' => $pkgnum } );