diff options
author | ivan <ivan> | 1999-07-20 10:37:05 +0000 |
---|---|---|
committer | ivan <ivan> | 1999-07-20 10:37:05 +0000 |
commit | 19c3d2717fb417187fb0f020a7ba2b065f3f8e30 (patch) | |
tree | 888c6c1941833e15a0d5ebeb33addb4ca292c559 /site_perl/agent.pm | |
parent | d605e2e68f3c388bd0479fb0aba1bb1bc8e61e73 (diff) |
cleaned up the new one-screen signup bits in htdocs/edit/cust_main.cgi to
prepare for a signup server
Diffstat (limited to 'site_perl/agent.pm')
-rw-r--r-- | site_perl/agent.pm | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/site_perl/agent.pm b/site_perl/agent.pm index cc4fb1088..dab157b3f 100644 --- a/site_perl/agent.pm +++ b/site_perl/agent.pm @@ -27,6 +27,11 @@ FS::agent - Object methods for agent records $error = $record->check; + $agent_type = $record->agent_type; + + $hashref = $record->pkgpart_hashref; + #may purchase $pkgpart if $hashref->{$pkgpart}; + =head1 DESCRIPTION An FS::agent object represents an agent. Every customer has an agent. Agents @@ -106,24 +111,48 @@ sub check { return $error if $error; return "Unknown typenum!" - unless qsearchs( 'agent_type', { 'typenum' => $self->typenum } ); + unless $self->agent_type; ''; } +=item agent_type + +Returns the FS::agent_type object (see L<FS::agent_type>) for this agent. + +=cut + +sub agent_type { + my $self = shift; + qsearchs( 'agent_type', { 'typenum' => $self->typenum } ); +} + +=item pkgpart_hashref + +Returns a hash reference. The keys of the hash are pkgparts. The value is +true iff this agent may purchase the specified package definition. See +L<FS::part_pkg>. + +=cut + +sub pkgpart_hashref { + my $self = shift; + $self->agent_type->pkgpart_hashref; +} + =back =head1 VERSION -$Id: agent.pm,v 1.4 1998-12-30 00:30:44 ivan Exp $ +$Id: agent.pm,v 1.5 1999-07-20 10:37:05 ivan Exp $ =head1 BUGS =head1 SEE ALSO -L<FS::Record>, L<FS::agent_type>, L<FS::cust_main>, schema.html from the base -documentation. +L<FS::Record>, L<FS::agent_type>, L<FS::cust_main>, L<FS::part_pkg>, +schema.html from the base documentation. =head1 HISTORY |