RT# 73490 - added global configuration to check if RT activity alert should be displayed.
[freeside.git] / FS / FS / h_svc_forward.pm
1 package FS::h_svc_forward;
2
3 use strict;
4 use vars qw( @ISA $DEBUG );
5 use FS::Record qw(qsearchs);
6 use FS::h_Common;
7 use FS::svc_forward;
8 use FS::svc_acct;
9 use FS::h_svc_acct;
10
11 use Carp qw(carp);
12
13 $DEBUG = 0;
14
15 @ISA = qw( FS::h_Common FS::svc_forward );
16
17 sub table { 'h_svc_forward' };
18
19 =head1 NAME
20
21 FS::h_svc_forward - Historical mail forwarding alias objects
22
23 =head1 SYNOPSIS
24
25 =head1 METHODS
26
27 =over 4
28
29 =item srcsvc_acct 
30
31 =cut
32
33 sub srcsvc_acct {
34   my $self = shift;
35
36   local($FS::Record::qsearch_qualify_columns) = 0;
37
38   $_[0] ||= $self->history_date;
39   my $h_svc_acct = qsearchs(
40     'h_svc_acct',
41     { 'svcnum' => $self->srcsvc },
42     FS::h_svc_acct->sql_h_searchs(@_),
43   ) || $self->SUPER::srcsvc_acct
44     or die "no history svc_acct.svcnum for svc_forward.srcsvc ". $self->srcsvc;
45
46   carp 'Using svc_acct in place of missing h_svc_acct record.'
47     if ($h_svc_acct->isa('FS::domain_record') and $DEBUG);
48
49   return $h_svc_acct;
50
51 }
52
53 =item dstsvc_acct
54
55 =cut
56
57 sub dstsvc_acct {
58   my $self = shift;
59
60   local($FS::Record::qsearch_qualify_columns) = 0;
61
62   $_[0] ||= $self->history_date;
63   my $h_svc_acct = qsearchs(
64     'h_svc_acct',
65     { 'svcnum' => $self->dstsvc },
66     FS::h_svc_acct->sql_h_searchs(@_),
67   ) || $self->SUPER::dstsvc_acct
68     or die "no history svc_acct.svcnum for svc_forward.dstsvc ". $self->dstsvc;
69
70   carp 'Using svc_acct in place of missing h_svc_acct record.'
71     if ($h_svc_acct->isa('FS::domain_record') and $DEBUG);
72
73   return $h_svc_acct;
74 }
75
76 =back
77
78 =head1 DESCRIPTION
79
80 An FS::h_svc_forward object represents a historical mail forwarding alias.
81 FS::h_svc_forward inherits from FS::h_Common and FS::svc_forward.
82
83 =head1 BUGS
84
85 =head1 SEE ALSO
86
87 L<FS::h_Common>, L<FS::svc_forward>, L<FS::Record>, schema.html from the base
88 documentation.
89
90 =cut
91
92 1;
93