book closing schema changes
[freeside.git] / FS / FS / part_svc.pm
index f1e71ad..41ee21d 100644 (file)
@@ -2,7 +2,7 @@ package FS::part_svc;
 
 use strict;
 use vars qw( @ISA );
-use FS::Record qw( qsearchs fields dbh );
+use FS::Record qw( qsearch qsearchs fields dbh );
 use FS::part_svc_column;
 
 @ISA = qw(FS::Record);
@@ -40,9 +40,7 @@ FS::Record.  The following fields are currently supported:
 =item svcdb - table used for this service.  See L<FS::svc_acct>,
 L<FS::svc_domain>, and L<FS::svc_forward>, among others.
 
-=item I<svcdb>__I<field> - Default or fixed value for I<field> in I<svcdb>.
-
-=item I<svcdb>__I<field>_flag - defines I<svcdb>__I<field> action: null, `D' for default, or `F' for fixed
+=item disabled - Disabled flag, empty or `Y'
 
 =back
 
@@ -63,6 +61,7 @@ sub table { 'part_svc'; }
 
 Adds this service definition to the database.  If there is an error, returns
 the error, otherwise returns false.
+
 =item I<svcdb>__I<field> - Default or fixed value for I<field> in I<svcdb>.
 
 =item I<svcdb>__I<field>_flag - defines I<svcdb>__I<field> action: null, `D' for default, or `F' for fixed
@@ -232,12 +231,14 @@ sub check {
     $self->ut_numbern('svcpart')
     || $self->ut_text('svc')
     || $self->ut_alpha('svcdb')
+    || $self->ut_enum('disabled', [ '', 'Y' ] )
   ;
   return $error if $error;
 
   my @fields = eval { fields( $recref->{svcdb} ) }; #might die
   return "Unknown svcdb!" unless @fields;
 
+##REPLACED BY part_svc_column
 #  my $svcdb;
 #  foreach $svcdb ( qw(
 #    svc_acct svc_acct_sm svc_domain
@@ -285,11 +286,20 @@ sub part_svc_column {
                                };
 }
 
+=item all_part_svc_column
+
+=cut
+
+sub all_part_svc_column {
+  my $self = shift;
+  qsearch('part_svc_column', { 'svcpart' => $self->svcpart } );
+}
+
 =back
 
 =head1 VERSION
 
-$Id: part_svc.pm,v 1.4 2001-09-11 00:08:18 ivan Exp $
+$Id: part_svc.pm,v 1.9 2002-01-28 06:57:23 ivan Exp $
 
 =head1 BUGS
 
@@ -300,9 +310,9 @@ should be fixed.
 
 =head1 SEE ALSO
 
-L<FS::Record>, L<FS::part_pkg>, L<FS::pkg_svc>, L<FS::cust_svc>,
-L<FS::svc_acct>, L<FS::svc_forward>, L<FS::svc_domain>, schema.html from the
-base documentation.
+L<FS::Record>, L<FS::part_svc_column>, L<FS::part_pkg>, L<FS::pkg_svc>,
+L<FS::cust_svc>, L<FS::svc_acct>, L<FS::svc_forward>, L<FS::svc_domain>,
+schema.html from the base documentation.
 
 =cut