diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
commit | 9aee669886202be7035e6c6049fc71bc99dd3013 (patch) | |
tree | 2fd5bf6de74f3d99270587ffb1833e4188a6373d /rt/lib/RT/Condition/CustomFieldChange.pm | |
parent | ac20214d38d9af00430423f147b5a0e50751b050 (diff) | |
parent | 1add633372bdca3cc7163c2ce48363fed3984437 (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'rt/lib/RT/Condition/CustomFieldChange.pm')
-rw-r--r-- | rt/lib/RT/Condition/CustomFieldChange.pm | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/rt/lib/RT/Condition/CustomFieldChange.pm b/rt/lib/RT/Condition/CustomFieldChange.pm deleted file mode 100644 index b9228a50f..000000000 --- a/rt/lib/RT/Condition/CustomFieldChange.pm +++ /dev/null @@ -1,56 +0,0 @@ -package RT::Condition::CustomFieldChange; -use base 'RT::Condition'; -use strict; - -=head2 IsApplicable - -If a custom field has a particular value. - -=cut - -# Based on Chuck Boeheim's code posted on the RT Wiki 3/13/06 - -sub IsApplicable { - my $self = shift; - my $trans = $self->TransactionObj; - my $scrip = $self->ScripObj; - my %Rules = $self->Rules; - my ($field, $value) = @Rules{'field', 'value'}; - return if !defined($field) or !defined($value); - - if ($trans->Type eq 'Create') { - return 1 if $trans->TicketObj->FirstCustomFieldValue($field) eq $value; - } - if ($trans->Type eq 'CustomField') { - my $cf = RT::CustomField->new($self->CurrentUser); - $cf->Load($field); - return 1 if $trans->Field == $cf->Id and $trans->NewValue eq $value; - } - return undef; -} - -sub Options { - my $self = shift; - my %args = ( 'QueueObj' => undef, @_ ); - my $QueueObj = $args{'QueueObj'}; - my $cfs = $QueueObj->TicketCustomFields(); - my @fieldnames; - while ( my $cf = $cfs->Next ) { - push @fieldnames, $cf->Name, $cf->Name; - } - return ( - { - 'name' => 'field', - 'label' => 'Custom Field', - 'type' => 'select', - 'options' => \@fieldnames, - }, - { - 'name' => 'value', - 'label' => 'Value', - 'type' => 'text', - }, - ); -} -1; - |