summaryrefslogtreecommitdiff
path: root/FS/FS/part_event
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2018-06-04 20:10:15 -0400
committerChristopher Burger <burgerc@freeside.biz>2018-06-05 08:00:26 -0400
commit792172634b829220555f2e5aa2bb0c3e947b4cee (patch)
tree3c14880d146a485a49d309dc265e94761256e361 /FS/FS/part_event
parentb487b3c39e258cd3b8978bfa8e052ecc8af5c57d (diff)
RT# 77917 - Updated event option Agent to allow for selection of multiple agents.
Diffstat (limited to 'FS/FS/part_event')
-rw-r--r--FS/FS/part_event/Condition/agent.pm9
1 files changed, 4 insertions, 5 deletions
diff --git a/FS/FS/part_event/Condition/agent.pm b/FS/FS/part_event/Condition/agent.pm
index bdd4e12..917cf46 100644
--- a/FS/FS/part_event/Condition/agent.pm
+++ b/FS/FS/part_event/Condition/agent.pm
@@ -13,7 +13,7 @@ sub description {
sub option_fields {
(
- 'agentnum' => { label=>'Agent', type=>'select-agent', },
+ 'agentnum' => { label=>'Agent', type=>'select-agent', multiple => '1' },
);
}
@@ -22,16 +22,15 @@ sub condition {
my $cust_main = $self->cust_main($object);
- my $agentnum = $self->option('agentnum');
-
- $cust_main->agentnum == $agentnum;
+ my $hashref = $self->option('agentnum') || {};
+ grep $hashref->{ $_->agentnum }, $cust_main->agent;
}
sub condition_sql {
my( $class, $table, %opt ) = @_;
- "cust_main.agentnum = " . $class->condition_sql_option_integer('agentnum', $opt{'driver_name'});
+ "cust_main.agentnum IN " . $class->condition_sql_option_option_integer('agentnum', $opt{'driver_name'});
}
1;