diff options
author | Christopher Burger <burgerc@freeside.biz> | 2018-06-04 20:10:15 -0400 |
---|---|---|
committer | Christopher Burger <burgerc@freeside.biz> | 2018-06-04 20:10:15 -0400 |
commit | e928101f860813b7485e79ea549e736f69c50948 (patch) | |
tree | b5bc043b7e917147705b8b403480d27eaf03fb8c /FS/FS/part_event_condition_option.pm | |
parent | 83d79f6af4ddd62735263e55f2249ba80fd9f402 (diff) |
RT# 77917 - Updated event option Agent to allow for selection of multiple agents.
Diffstat (limited to 'FS/FS/part_event_condition_option.pm')
-rw-r--r-- | FS/FS/part_event_condition_option.pm | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/FS/FS/part_event_condition_option.pm b/FS/FS/part_event_condition_option.pm index 3256dc0..15a6a55 100644 --- a/FS/FS/part_event_condition_option.pm +++ b/FS/FS/part_event_condition_option.pm @@ -138,6 +138,30 @@ sub optionvalue { } } +use FS::upgrade_journal; +sub _upgrade_data { #class method + my ($class, %opts) = @_; + + # migrate part_event_condition_option agentnum to part_event_condition_option_option agentnum + unless ( FS::upgrade_journal->is_done('agentnum_to_hash') ) { + + foreach my $condition_option (qsearch('part_event_condition_option', { optionname => 'agentnum', })) { + my $optionvalue = $condition_option->get("optionvalue"); + if ($optionvalue eq 'HASH' ) { next; } + else { + my $options = {"$optionvalue" => '1',}; + $condition_option->optionvalue(ref($options)); + my $error = $condition_option->replace($options); + die $error if $error; + } + } + + FS::upgrade_journal->set_done('agentnum_to_hash'); + + } + +} + =back =head1 SEE ALSO |