X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FCustomFieldValues%2FExternal.pm;h=66e798aab715387df56f74f8f77703108974a0f5;hp=61125146fdebef8cbef1458f5cb42f9328ddc756;hb=9aee669886202be7035e6c6049fc71bc99dd3013;hpb=43a06151e47d2c59b833cbd8c26d97865ee850b6 diff --git a/rt/lib/RT/CustomFieldValues/External.pm b/rt/lib/RT/CustomFieldValues/External.pm index 61125146f..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-2012 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 @@ -179,6 +181,7 @@ sub _DoSearch { customfield => $self->{'__external_cf'}, sortorder => 0, description => '', + category => undef, creator => RT->SystemUser->id, created => undef, lastupdatedby => RT->SystemUser->id, @@ -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;