summaryrefslogtreecommitdiff
path: root/FS/FS/svc_external.pm
diff options
context:
space:
mode:
authorivan <ivan>2006-12-29 08:51:34 +0000
committerivan <ivan>2006-12-29 08:51:34 +0000
commit633c48448d9468690b7ad77eb6ff7c660a286658 (patch)
tree4e08051f8d805e7e95c8dffe5e3e73b0c360f965 /FS/FS/svc_external.pm
parent6cb5c702b17b98be46adea4539e15d5f312e5be1 (diff)
service refactor!
Diffstat (limited to 'FS/FS/svc_external.pm')
-rw-r--r--FS/FS/svc_external.pm70
1 files changed, 41 insertions, 29 deletions
diff --git a/FS/FS/svc_external.pm b/FS/FS/svc_external.pm
index 14eab7e03..5aaee4872 100644
--- a/FS/FS/svc_external.pm
+++ b/FS/FS/svc_external.pm
@@ -1,16 +1,11 @@
package FS::svc_external;
use strict;
-use vars qw(@ISA); # $conf
-use FS::UID;
-#use FS::Record qw( qsearch qsearchs dbh);
-use FS::svc_Common;
+use vars qw(@ISA);
+use FS::Conf;
+use FS::svc_External_Common;
-@ISA = qw( FS::svc_Common );
-
-#FS::UID::install_callback( sub {
-# $conf = new FS::Conf;
-#};
+@ISA = qw( FS::svc_External_Common );
=head1 NAME
@@ -39,9 +34,9 @@ FS::svc_external - Object methods for svc_external records
=head1 DESCRIPTION
-An FS::svc_external object represents a externally tracked service.
-FS::svc_external inherits from FS::svc_Common. The following fields are
-currently supported:
+An FS::svc_external object represents a generic externally tracked service.
+FS::svc_external inherits from FS::svc_External_Common (and FS::svc_Common).
+The following fields are currently supported:
=over 4
@@ -67,8 +62,31 @@ points to. You can ask the object for a copy with the I<hash> method.
=cut
+sub table_info {
+ {
+ 'name' => 'External service',
+ 'sorts' => 'id',
+ 'display_weight' => 90,
+ 'cancel_weight' => 10,
+ 'fields' => {
+ },
+ };
+}
+
sub table { 'svc_external'; }
+# oh! this should be moved to svc_artera_turbo or something now
+sub label {
+ my $self = shift;
+ my $conf = new FS::Conf;
+ if ( $conf->config('svc_external-display_type') eq 'artera_turbo' ) {
+ sprintf('%010d', $self->id). '-'.
+ substr('0000000000'.uc($self->title), -10);
+ } else {
+ $self->SUPER::label;
+ }
+}
+
=item insert [ , OPTION => VALUE ... ]
Adds this external service to the database. If there is an error, returns the
@@ -149,21 +167,15 @@ and replace methods.
=cut
-sub check {
- my $self = shift;
-
- my $x = $self->setfixed;
- return $x unless ref($x);
- my $part_svc = $x;
-
- my $error =
- $self->ut_numbern('svcnum')
- || $self->ut_numbern('id')
- || $self->ut_textn('title')
- ;
-
- $self->SUPER::check;
-}
+#sub check {
+# my $self = shift;
+# my $error;
+#
+# $error = $self->SUPER::delete;
+# return $error if $error;
+#
+# '';
+#}
=back
@@ -171,8 +183,8 @@ sub check {
=head1 SEE ALSO
-L<FS::svc_Common>, L<FS::Record>, L<FS::cust_svc>, L<FS::part_svc>,
-L<FS::cust_pkg>, schema.html from the base documentation.
+L<FS::svc_External_Common>, L<FS::svc_Common>, L<FS::Record>, L<FS::cust_svc>,
+L<FS::part_svc>, L<FS::cust_pkg>, schema.html from the base documentation.
=cut