From 406e97fe228cd249a8bd0fa58cbfbf33ab805f18 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Wed, 9 May 2012 15:20:06 -0700 Subject: disable advertising sources, RT#17638 --- FS/FS/part_referral.pm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'FS') diff --git a/FS/FS/part_referral.pm b/FS/FS/part_referral.pm index c94c57e19..e7dfe067d 100644 --- a/FS/FS/part_referral.pm +++ b/FS/FS/part_referral.pm @@ -163,10 +163,16 @@ simply using rather than editing advertising sources). sub all_part_referral { my $self = shift; + my $global = @_ ? shift : ''; + my $disabled = @_ ? shift : ''; + + my $hashref = $disabled ? {} : { 'disabled' => '' }; + my $and = $disabled ? ' WHERE ' : ' AND '; qsearch({ 'table' => 'part_referral', - 'extra_sql' => ' WHERE '. $self->acl_agentnum_sql(@_). ' ORDER BY refnum ', + 'hashref' => $hashref, + 'extra_sql' => $and. $self->acl_agentnum_sql(@_). ' ORDER BY refnum ', }); } -- cgit v1.2.1