summaryrefslogtreecommitdiff
path: root/rt/lib
diff options
context:
space:
mode:
authormark <mark>2012-02-17 02:35:27 +0000
committermark <mark>2012-02-17 02:35:27 +0000
commit156b1169a814021cfb5d546fb18218dedba1742d (patch)
treed6734a928e8c9d383114834e420ce8d997b8eccf /rt/lib
parent90b57490d16e693d5c179a9a4695af7e9b1c9bff (diff)
search tickets by customer advertising source, #16490
Diffstat (limited to 'rt/lib')
-rw-r--r--rt/lib/RT/Tickets_Overlay.pm4
-rw-r--r--rt/lib/RT/URI/freeside.pm6
-rw-r--r--rt/lib/RT/URI/freeside/Internal.pm9
3 files changed, 18 insertions, 1 deletions
diff --git a/rt/lib/RT/Tickets_Overlay.pm b/rt/lib/RT/Tickets_Overlay.pm
index f6df5530d..76a57b8ce 100644
--- a/rt/lib/RT/Tickets_Overlay.pm
+++ b/rt/lib/RT/Tickets_Overlay.pm
@@ -148,6 +148,7 @@ our %FIELD_METADATA = (
#freeside
Agentnum => [ 'FREESIDEFIELD', ],
Classnum => [ 'FREESIDEFIELD', ],
+ Refnum => [ 'FREESIDEFIELD', ],
Tagnum => [ 'FREESIDEFIELD', 'cust_tag' ],
WillResolve => [ 'DATE' => 'WillResolve', ], #loc_left_pair
);
@@ -1824,6 +1825,9 @@ sub OrderByCols {
elsif ( $subkey eq 'Agent' ) {
$field = "$custalias.agentnum";
}
+ elsif ( $subkey eq 'Referral' ) {
+ $field = "$custalias.refnum";
+ }
else {
# no other cases exist yet, but for obviousness:
$field = $subkey;
diff --git a/rt/lib/RT/URI/freeside.pm b/rt/lib/RT/URI/freeside.pm
index 33845dda6..0e1834f47 100644
--- a/rt/lib/RT/URI/freeside.pm
+++ b/rt/lib/RT/URI/freeside.pm
@@ -326,6 +326,12 @@ sub CustomerTags { ( ) }
=back
+=item Referral
+
+Return the customer's advertising source, as a string.
+
=cut
+sub Referral { undef }
+
1;
diff --git a/rt/lib/RT/URI/freeside/Internal.pm b/rt/lib/RT/URI/freeside/Internal.pm
index 7b8efa0d3..4069b87af 100644
--- a/rt/lib/RT/URI/freeside/Internal.pm
+++ b/rt/lib/RT/URI/freeside/Internal.pm
@@ -53,7 +53,7 @@ See L<RT::URI::freeside> for public/private interface documentation.
-sub _FreesideGetRecord {
+sub _FreesideGetRecord { # cache this?
my $self = shift;
my ($table, $pkey) = ($self->{'fstable'}, $self->{'fspkey'});
@@ -167,4 +167,11 @@ sub CustomerTags {
} @part_tag;
}
+sub Referral {
+ my $self = shift;
+ my $rec = $self->_FreesideGetRecord() or return;
+ my $ref = qsearchs('part_referral', { refnum => $rec->{'_object'}->refnum });
+ $ref ? $ref->referral : ''
+}
+
1;