X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FCustomFieldValues%2FExternal.pm;h=66e798aab715387df56f74f8f77703108974a0f5;hp=81aaa2b2c11925bb812b2c7c08723194859908a4;hb=9aee669886202be7035e6c6049fc71bc99dd3013;hpb=75162bb14b3e38d66617077843f4dfdcaf09d5c4 diff --git a/rt/lib/RT/CustomFieldValues/External.pm b/rt/lib/RT/CustomFieldValues/External.pm index 81aaa2b2c..66e798aab 100644 --- a/rt/lib/RT/CustomFieldValues/External.pm +++ b/rt/lib/RT/CustomFieldValues/External.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -77,12 +77,14 @@ the identifier by which the user will see the dropdown. =head2 ExternalValues This method should return an array reference of hash references. The -hash references should contain keys for C, C, and -C. +hash references must contain a key for C and can optionally contain +keys for C, C, and C. If supplying a +category, you must also set the category the custom field is based on in +the custom field configuration page. =head1 SEE ALSO -L +F =cut @@ -137,7 +139,7 @@ sub __BuildLimitCheck { return 0 unless $value ne $condition; } elsif (uc($op) eq "LIKE") { return 0 unless $value =~ /\Q$condition\E/i; - } elsif (rc($op) eq "NOT LIKE") { + } elsif (uc($op) eq "NOT LIKE") { return 0 unless $value !~ /\Q$condition\E/i; } else { return 0; @@ -179,9 +181,10 @@ sub _DoSearch { customfield => $self->{'__external_cf'}, sortorder => 0, description => '', - creator => $RT::SystemUser->id, + category => undef, + creator => RT->SystemUser->id, created => undef, - lastupdatedby => $RT::SystemUser->id, + lastupdatedby => RT->SystemUser->id, lastupdated => undef, ); @@ -193,6 +196,7 @@ sub _DoSearch { $value->LoadFromHash( { %defaults, %$_ } ); next if $check && !$check->( $self, $value ); $self->AddRecord( $value ); + last if $self->RowsPerPage and ++$i >= $self->RowsPerPage; } $self->{'must_redo_search'} = 0; return $self->_RecordCount; @@ -214,6 +218,10 @@ sub LimitToCustomField { return $self->SUPER::LimitToCustomField( @_ ); } +sub _SingularClass { + "RT::CustomFieldValue" +} + RT::Base->_ImportOverlays(); 1;