this has been an evening of logical negation
[freeside.git] / httemplate / edit / part_svc.cgi
index e033a7b..6868ffd 100755 (executable)
@@ -53,6 +53,7 @@ Services are items you offer to your customers.
     <LI>svc_forward - mail forwarding
     <LI>svc_www - Virtual domain website
     <LI>svc_broadband - Broadband/High-speed Internet service
+    <LI>svc_external - Externally-tracked service
 <!--   <LI>svc_charge - One-time charges (Partially unimplemented)
        <LI>svc_wo - Work orders (Partially unimplemented)
 -->
@@ -129,31 +130,33 @@ my %defs = (
     'ip_addr' => 'IP address.  Leave blank for automatic assignment.',
     'blocknum' => 'Address block.',
   },
+  'svc_external' => {
+    #'id' => '',
+    #'title' => '',
+  },
 );
 
-  #comment this out until it can be fixed, see bug#590
-  #
-  #foreach my $svcdb (grep dbdef->table($_), keys %defs ) {
-  #  my $self = "FS::$svcdb"->new;
-  #  $vfields{$svcdb} = {};
-  #  foreach my $field ($self->virtual_fields) { # svc_Common::virtual_fields with a null svcpart returns all of them
-  #    my $pvf = $self->pvf($field);
-  #    my @list = $pvf->list;
-  #    if (scalar @list) {
-  #      $defs{$svcdb}->{$field} = { desc        => $pvf->label,
-  #                                  type        => 'select',
-  #                                  select_list => \@list };
-  #    } else {
-  #      $defs{$svcdb}->{$field} = $pvf->label;
-  #    } #endif
-  #    $vfields{$svcdb}->{$field} = $pvf;
-  #    warn "\$vfields{$svcdb}->{$field} = $pvf";
-  #  } #next $field
-  #} #next $svcdb
+  foreach my $svcdb (grep dbdef->table($_), keys %defs ) {
+    my $self = "FS::$svcdb"->new;
+    $vfields{$svcdb} = {};
+    foreach my $field ($self->virtual_fields) { # svc_Common::virtual_fields with a null svcpart returns all of them
+      my $pvf = $self->pvf($field);
+      my @list = $pvf->list;
+      if (scalar @list) {
+        $defs{$svcdb}->{$field} = { desc        => $pvf->label,
+                                    type        => 'select',
+                                    select_list => \@list };
+      } else {
+        $defs{$svcdb}->{$field} = $pvf->label;
+      } #endif
+      $vfields{$svcdb}->{$field} = $pvf;
+      warn "\$vfields{$svcdb}->{$field} = $pvf";
+    } #next $field
+  } #next $svcdb
   
   my @dbs = $hashref->{svcdb}
              ? ( $hashref->{svcdb} )
-             : qw( svc_acct svc_domain svc_forward svc_www svc_broadband );
+             : qw( svc_acct svc_domain svc_forward svc_www svc_broadband svc_external );
 
   tie my %svcdb, 'Tie::IxHash', map { $_=>$_ } grep dbdef->table($_), @dbs;
   my $widget = new HTML::Widgets::SelectLayers(
@@ -176,7 +179,7 @@ my %defs = (
       $html .= '<BR><BR>'. table().
                table(). "<TR><TH COLSPAN=$columns>Exports</TH></TR><TR>";
       foreach my $part_export ( @part_export ) {
-        $html .= '<TD><INPUT TYPE="checbox"'.
+        $html .= '<TD><INPUT TYPE="checkbox"'.
                  ' NAME="exportnum'. $part_export->exportnum. '"  VALUE="1" ';
         $html .= 'CHECKED'
           if ( $clone || $part_svc->svcpart ) #null svcpart search causing error