[Rt-commit] rt branch, custom_fields_application, updated. rt-3.8.7-179-g2eaeeef

Ruslan Zakirov ruz at bestpractical.com
Tue Feb 23 20:19:55 EST 2010


The branch, custom_fields_application has been updated
       via  2eaeeef02f3dbd1b276134c14c42c5372331f148 (commit)
       via  021df5a91e0a6c142362626514b420fafe6816da (commit)
       via  079b7e0f86b00f2a5d16df00b81497af0dc090d5 (commit)
       via  328d2bc53ccf88aab68ecabe871abe55d07426fe (commit)
       via  badaf96195e2a8b707901d3763d6714cd9f70958 (commit)
       via  21a0afb8eca5dcdff120ca555c89fe0a7b4359ad (commit)
       via  e5e4fd5949c2fce02c7f6d88fd7275e1b48cdafc (commit)
       via  bcb0e0e513facad0a0f67e6009b67b3d6fdfd3b2 (commit)
       via  f0728b438deca261773163bfcd1dd18fdd241351 (commit)
       via  14385ac042a7a21495adcc7fa7b2d64117dafe1a (commit)
       via  13f0044c7e55a5705d3d741b547181a421fc4a2b (commit)
       via  d73690c727f644203d4928370b68bda0ede22c98 (commit)
       via  4727407270d8a3cec1b2411032b26b2df139a1b0 (commit)
      from  268186cfce2dd4801ba16e2032d9f030d79f21c1 (commit)

Summary of changes:
 etc/RT_Config.pm.in                                |   40 +++
 lib/RT/CustomField_Overlay.pm                      |   14 +
 lib/RT/CustomFields_Overlay.pm                     |  273 +++++++++++++-------
 share/html/Admin/CustomFields/Objects.html         |    6 +-
 share/html/Admin/Elements/EditCustomFields         |  231 ++++++++---------
 share/html/Admin/Elements/EditScrips               |    5 +-
 share/html/Admin/Elements/EditTemplates            |    5 +-
 share/html/Admin/Groups/index.html                 |    5 +-
 share/html/Admin/Queues/index.html                 |    4 +-
 share/html/Admin/Users/Memberships.html            |    4 +-
 share/html/Admin/Users/index.html                  |    4 +-
 share/html/Elements/ColumnMap                      |    2 +
 .../{RT__Queue => RT__CustomField}/ColumnMap       |  111 +++++---
 share/html/Elements/RT__Scrip/ColumnMap            |    4 +
 share/html/Elements/RT__Template/ColumnMap         |   11 +
 15 files changed, 436 insertions(+), 283 deletions(-)
 copy share/html/Elements/{RT__Queue => RT__CustomField}/ColumnMap (53%)

- Log -----------------------------------------------------------------
commit 4727407270d8a3cec1b2411032b26b2df139a1b0
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Feb 18 04:58:22 2010 +0300

    add global __WebRequestPath__ and __WebRequestPathDir__ column maps

diff --git a/share/html/Elements/ColumnMap b/share/html/Elements/ColumnMap
index e84d3cd..a1475a9 100644
--- a/share/html/Elements/ColumnMap
+++ b/share/html/Elements/ColumnMap
@@ -156,6 +156,8 @@ my $COLUMN_MAP = {
         $_ => { value => sub { return \$value } };
     
     } qw(WebPath WebBaseURL WebURL)),
+    WebRequestPath    => { value => sub { substr( $m->request_path, 1 ) } },
+    WebRequestPathDir => { value => sub { substr( $m->request_comp->dir_path, 1 ) } },
 };
 
 $COLUMN_MAP->{'CF'} = $COLUMN_MAP->{'CustomField'};

commit d73690c727f644203d4928370b68bda0ede22c98
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Feb 18 04:59:38 2010 +0300

    Queue and QueueId column maps for scrips and templates

diff --git a/share/html/Elements/RT__Scrip/ColumnMap b/share/html/Elements/RT__Scrip/ColumnMap
index 88b4c4b..3e1d407 100644
--- a/share/html/Elements/RT__Scrip/ColumnMap
+++ b/share/html/Elements/RT__Scrip/ColumnMap
@@ -64,6 +64,10 @@ my $COLUMN_MAP = {
             return $_[0]->loc('Global');
         },
     },
+    QueueId => {
+        title     => 'Queue', # loc
+        value     => sub { $_[0]->Queue },
+    },
     Condition => {
         title     => 'Condition', # loc
         value     => sub { return $_[0]->loc( $_[0]->ScripConditionObj->Name ) },
diff --git a/share/html/Elements/RT__Template/ColumnMap b/share/html/Elements/RT__Template/ColumnMap
index 851cc9d..e7c1495 100644
--- a/share/html/Elements/RT__Template/ColumnMap
+++ b/share/html/Elements/RT__Template/ColumnMap
@@ -67,6 +67,17 @@ my $COLUMN_MAP = {
 	attribute => 'Description',
 	value     => sub { return $_[0]->Description() },
     },
+    Queue => {
+        title     => 'Queue', # loc
+        value     => sub {
+            return $_[0]->QueueObj->Name if $_[0]->Queue;
+            return $_[0]->loc('Global');
+        },
+    },
+    QueueId => {
+        title     => 'Queue', # loc
+        value     => sub { $_[0]->Queue },
+    },
 };
 
 </%ONCE>

commit 13f0044c7e55a5705d3d741b547181a421fc4a2b
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Feb 18 05:00:34 2010 +0300

    %AdminSearchResultFormat config option

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index a04ba95..2d165d0 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1381,6 +1381,41 @@ Set($DefaultSelfServiceSearchResultFormat, qq{
    Requestors,
    OwnerName});
 
+=item C<%AdminSearchResultFormat>
+
+In admin interface format strings similar to tickets search result
+formats are used. Use C<%AdminSearchResultFormat> to define format
+strings per RT class.
+
+=cut
+
+Set(%AdminSearchResultFormat,
+    Queues =>
+        q{'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__id__</a>/TITLE:#'}
+        .q{,'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
+        .q{,__Description__,__Address__,__Priority__,__DefaultDueIn__,__Disabled__},
+
+    Groups =>
+        q{'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__id__</a>/TITLE:#'}
+        .q{,'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
+        .q{,'__Description__'},
+
+    Users =>
+        q{'<a href="__WebPath__/Admin/Users/Modify.html?id=__id__">__id__</a>/TITLE:#'}
+        .q{,'<a href="__WebPath__/Admin/Users/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
+        .q{,__RealName__, __EmailAddress__},
+
+    Scrips => 
+        q{'<a href="__WebPath__/__WebRequestPathDir__/Scrip.html?id=__id__&Queue=__QueueId__">__id__</a>/TITLE:#'}
+        .q{,'<a href="__WebPath__/__WebRequestPathDir__/Scrip.html?id=__id__&Queue=__QueueId__">__Description__</a>/TITLE:Description'}
+        .q{,__Stage__, __Condition__, __Action__, __Template__},
+
+    Templates =>
+        q{'<a href="__WebPath__/__WebRequestPathDir__/Template.html?Queue=__QueueId__&Template=__id__">__id__</a>/TITLE:#'}
+        .q{,'<a href="__WebPath__/__WebRequestPathDir__/Template.html?Queue=__QueueId__&Template=__id__">__Name__</a>/TITLE:Name'}
+        .q{,'__Description__'},
+);
+
 =item C<$SuppressInlineTextFiles>
 
 If C<$SuppressInlineTextFiles> is set to a true value, then uploaded

commit 14385ac042a7a21495adcc7fa7b2d64117dafe1a
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Feb 18 05:00:56 2010 +0300

    use %AdminSearchResultFormat config option in the admin ui

diff --git a/share/html/Admin/Elements/EditScrips b/share/html/Admin/Elements/EditScrips
index df349e1..dce0390 100755
--- a/share/html/Admin/Elements/EditScrips
+++ b/share/html/Admin/Elements/EditScrips
@@ -109,10 +109,7 @@ foreach my $id ( grep $_, @DeleteScrip, map /^DeleteScrip-(\d+)/, keys %ARGS ) {
 }
 # }}}
 
-my $dir_path = $m->request_comp->dir_path;
-$Format ||= qq{'<a href="__WebPath__$dir_path/Scrip.html?id=__id__&Queue=$id">__id__</a>/TITLE:#'}
-    .qq{,'<a href="__WebPath__$dir_path/Scrip.html?id=__id__&Queue=$id">__Description__</a>/TITLE:Description'}
-    .q{,__Stage__, __Condition__, __Action__, __Template__};
+$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Scrips'};
 
 </%init>
 
diff --git a/share/html/Admin/Elements/EditTemplates b/share/html/Admin/Elements/EditTemplates
index 0bd68c2..7d7d930 100755
--- a/share/html/Admin/Elements/EditTemplates
+++ b/share/html/Admin/Elements/EditTemplates
@@ -73,10 +73,7 @@
 </form>
 
 <%INIT>
-my $dir_path = $m->request_comp->dir_path;
-$Format ||= qq{'<a href="__WebPath__$dir_path/Template.html?Queue=$id&Template=__id__">__id__</a>/TITLE:#'}
-    .qq{,'<a href="__WebPath__$dir_path/Template.html?Queue=$id&Template=__id__">__Name__</a>/TITLE:Name'}
-    .qq{,'__Description__'};
+$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Templates'};
 
 my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
 $QueueObj->Load( $id ) if $id;
diff --git a/share/html/Admin/Groups/index.html b/share/html/Admin/Groups/index.html
index 078f51b..17b760c 100755
--- a/share/html/Admin/Groups/index.html
+++ b/share/html/Admin/Groups/index.html
@@ -113,10 +113,7 @@ else {
     $caption = loc("User-defined groups");
 }
 
-
-$Format ||= q{'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__id__</a>/TITLE:#'}
-    .q{,'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
-    .q{,'__Description__'};
+$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Groups'};
 
 </%INIT>
 <%ARGS>
diff --git a/share/html/Admin/Queues/index.html b/share/html/Admin/Queues/index.html
index 52e7b3b..98dce3d 100755
--- a/share/html/Admin/Queues/index.html
+++ b/share/html/Admin/Queues/index.html
@@ -111,9 +111,7 @@ if ( defined $QueueString && length $QueueString ) {
         : loc("Enabled Queues");
 }
 
-$Format ||= q{'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__id__</a>/TITLE:#'}
-    .q{,'<a href="__WebPath__/Admin/Queues/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
-    .q{,__Description__,__Address__,__Priority__,__DefaultDueIn__,__Disabled__};
+$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Queues'};
 
 </%INIT>
 <%ARGS>
diff --git a/share/html/Admin/Users/Memberships.html b/share/html/Admin/Users/Memberships.html
index ea5dd25..cd8574d 100644
--- a/share/html/Admin/Users/Memberships.html
+++ b/share/html/Admin/Users/Memberships.html
@@ -128,9 +128,7 @@ my $is_not_member = RT::Groups->new( $session{'CurrentUser'} );
 $is_not_member->LimitToUserDefinedGroups;
 $is_not_member->WithoutMember( PrincipalId => $UserObj->Id );
 
-$Format ||= q{'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__id__</a>/TITLE:#'}
-    .q{,'<a href="__WebPath__/Admin/Groups/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
-    .q{,'__Description__'};
+$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Groups'};
 </%INIT>
 <%ARGS>
 $id     => undef
diff --git a/share/html/Admin/Users/index.html b/share/html/Admin/Users/index.html
index e9a5818..1ef773b 100755
--- a/share/html/Admin/Users/index.html
+++ b/share/html/Admin/Users/index.html
@@ -117,9 +117,7 @@ else {
     $users->LimitToPrivileged;
 }
 
-$Format ||= q{'<a href="__WebPath__/Admin/Users/Modify.html?id=__id__">__id__</a>/TITLE:#'}
-    .q{,'<a href="__WebPath__/Admin/Users/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
-    .q{,__RealName__, __EmailAddress__};
+$Format ||= RT->Config->Get('AdminSearchResultFormat')->{'Users'};
 
 </%INIT>
 <%ARGS>

commit f0728b438deca261773163bfcd1dd18fdd241351
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Feb 19 02:12:07 2010 +0300

    use format strings from config when applying CFs

diff --git a/share/html/Admin/CustomFields/Objects.html b/share/html/Admin/CustomFields/Objects.html
index ea3f88e..7a01612 100644
--- a/share/html/Admin/CustomFields/Objects.html
+++ b/share/html/Admin/CustomFields/Objects.html
@@ -133,7 +133,11 @@ if ( $UpdateObjs ) {
 my $applied = $CF->AppliedTo;
 my $not_applied = $CF->NotAppliedTo;
 
-my $format = '__id__,__Name__';
+my $collection_class = ref($applied);
+$collection_class =~ s/^RT:://;
+
+my $format = RT->Config->Get('AdminSearchResultFormat')->{$collection_class}
+    || '__id__,__Name__';
 
 my $title = loc('Modify associated objects for [_1]', $CF->Name);
 

commit bcb0e0e513facad0a0f67e6009b67b3d6fdfd3b2
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Feb 19 21:44:30 2010 +0300

    sort methods in RT::CustomFields and document them

diff --git a/lib/RT/CustomFields_Overlay.pm b/lib/RT/CustomFields_Overlay.pm
index 0f117c6..9f62297 100755
--- a/lib/RT/CustomFields_Overlay.pm
+++ b/lib/RT/CustomFields_Overlay.pm
@@ -66,29 +66,98 @@
 package RT::CustomFields;
 
 use strict;
+use warnings;
 no warnings qw(redefine);
 use DBIx::SearchBuilder::Unique;
 
+=head2 LimitToLookupType
 
-sub _OCFAlias {
+Takes LookupType and limits collection.
+
+=cut
+
+sub LimitToLookupType  {
     my $self = shift;
-    unless ($self->{_sql_ocfalias}) {
+    my $lookup = shift;
 
-        $self->{'_sql_ocfalias'} = $self->NewAlias('ObjectCustomFields');
-    $self->Join( ALIAS1 => 'main',
-                FIELD1 => 'id',
-                ALIAS2 => $self->_OCFAlias,
-                FIELD2 => 'CustomField' );
-    }
-    return($self->{_sql_ocfalias});
+    $self->Limit( FIELD => 'LookupType', VALUE => "$lookup" );
+}
+
+=head2 LimitToChildType
+
+Takes partial LookupType and limits collection to records
+where LookupType is equal or ends with the value.
+
+=cut
+
+sub LimitToChildType  {
+    my $self = shift;
+    my $lookup = shift;
+
+    $self->Limit( FIELD => 'LookupType', VALUE => "$lookup" );
+    $self->Limit( FIELD => 'LookupType', ENDSWITH => "$lookup" );
+}
+
+
+=head2 LimitToParentType
+
+Takes partial LookupType and limits collection to records
+where LookupType is equal or starts with the value.
+
+=cut
+
+sub LimitToParentType  {
+    my $self = shift;
+    my $lookup = shift;
+
+    $self->Limit( FIELD => 'LookupType', VALUE => "$lookup" );
+    $self->Limit( FIELD => 'LookupType', STARTSWITH => "$lookup" );
 }
 
 
-# {{{ sub LimitToGlobalOrQueue 
+=head2 LimitToGlobalOrObjectId
+
+Takes list of object IDs and limits collection to custom
+fields that are applied to these objects or globally.
+
+=cut
+
+sub LimitToGlobalOrObjectId {
+    my $self = shift;
+    my $global_only = 1;
+
+
+    foreach my $id (@_) {
+	$self->Limit( ALIAS           => $self->_OCFAlias,
+		    FIELD           => 'ObjectId',
+		    OPERATOR        => '=',
+		    VALUE           => $id || 0,
+		    ENTRYAGGREGATOR => 'OR' );
+	$global_only = 0 if $id;
+    }
+
+    $self->Limit( ALIAS           => $self->_OCFAlias,
+                 FIELD           => 'ObjectId',
+                 OPERATOR        => '=',
+                 VALUE           => 0,
+                 ENTRYAGGREGATOR => 'OR' ) unless $global_only;
+
+    $self->OrderByCols(
+	{ ALIAS => $self->_OCFAlias, FIELD => 'ObjectId', ORDER => 'DESC' },
+	{ ALIAS => $self->_OCFAlias, FIELD => 'SortOrder' },
+    );
+
+    # This doesn't work on postgres.
+    #$self->OrderBy( ALIAS => $class_cfs , FIELD => "SortOrder", ORDER => 'ASC');
+
+}
+
 
 =head2 LimitToGlobalOrQueue QUEUEID
 
-Limits the set of custom fields found to global custom fields or those tied to the queue with ID QUEUEID 
+DEPRECATED since CFs are applicable not only to tickets these days.
+
+Limits the set of custom fields found to global custom fields or those tied to the queue with ID QUEUEID
 
 =cut
 
@@ -99,13 +168,12 @@ sub LimitToGlobalOrQueue {
     $self->LimitToLookupType( 'RT::Queue-RT::Ticket' );
 }
 
-# }}}
-
-# {{{ sub LimitToQueue 
 
 =head2 LimitToQueue QUEUEID
 
-Takes a queue id (numerical) as its only argument. Makes sure that 
+DEPRECATED since CFs are applicable not only to tickets these days.
+
+Takes a queue id (numerical) as its only argument. Makes sure that
 Scopes it pulls out apply to this queue (or another that you've selected with
 another call to this method
 
@@ -114,7 +182,7 @@ another call to this method
 sub LimitToQueue  {
    my $self = shift;
   my $queue = shift;
- 
+
   $self->Limit (ALIAS => $self->_OCFAlias,
                 ENTRYAGGREGATOR => 'OR',
 		FIELD => 'ObjectId',
@@ -122,66 +190,77 @@ sub LimitToQueue  {
       if defined $queue;
   $self->LimitToLookupType( 'RT::Queue-RT::Ticket' );
 }
-# }}}
 
-# {{{ sub LimitToGlobal
 
 =head2 LimitToGlobal
 
-Makes sure that 
-Scopes it pulls out apply to all queues (or another that you've selected with
-another call to this method or LimitToQueue
+DEPRECATED since CFs are applicable not only to tickets these days.
 
-=cut
+Makes sure that Scopes it pulls out apply to all queues
+(or another that you've selected with
+another call to this method or LimitToQueue)
 
+=cut
 
 sub LimitToGlobal  {
    my $self = shift;
- 
+
   $self->Limit (ALIAS => $self->_OCFAlias,
                 ENTRYAGGREGATOR => 'OR',
 		FIELD => 'ObjectId',
 		VALUE => 0);
   $self->LimitToLookupType( 'RT::Queue-RT::Ticket' );
 }
-# }}}
 
 
-# {{{ sub _DoSearch 
+=head2 ContextObject
 
-=head2 _DoSearch
+Returns context object for this collection of custom fields,
+but only if it's defined.
 
-A subclass of DBIx::SearchBuilder::_DoSearch that makes sure that 
- _Disabled rows never get seen unless we're explicitly trying to see 
-them.
+=cut
+
+sub ContextObject {
+    my $self = shift;
+    return $self->{'context_object'};
+}
+
+
+=head2 SetContextObject
+
+Sets context object for this collection of custom fields.
 
 =cut
 
-sub _DoSearch {
+sub SetContextObject {
     my $self = shift;
-    
-    #unless we really want to find disabled rows, make sure we\'re only finding enabled ones.
-    unless($self->{'find_disabled_rows'}) {
-        $self->LimitToEnabled();
-    }
-    
-    return($self->SUPER::_DoSearch(@_));
-    
+    return $self->{'context_object'} = shift;
 }
 
-# }}}
 
-# {{{ sub Next 
+sub _OCFAlias {
+    my $self = shift;
+    unless ($self->{_sql_ocfalias}) {
+
+        $self->{'_sql_ocfalias'} = $self->NewAlias('ObjectCustomFields');
+    $self->Join( ALIAS1 => 'main',
+                FIELD1 => 'id',
+                ALIAS2 => $self->_OCFAlias,
+                FIELD2 => 'CustomField' );
+    }
+    return($self->{_sql_ocfalias});
+}
+
 
 =head2 Next
 
 Returns the next custom field that this user can see.
 
 =cut
-  
+
 sub Next {
     my $self = shift;
-    
+
     my $CF = $self->SUPER::Next();
     return $CF unless $CF;
 
@@ -191,15 +270,12 @@ sub Next {
     return $CF;
 }
 
-sub SetContextObject {
-    my $self = shift;
-    return $self->{'context_object'} = shift;
-}
-  
-sub ContextObject {
-    my $self = shift;
-    return $self->{'context_object'};
-}
+=head2 Next
+
+Overrides <RT::SearchBuilder/Next> to make sure </ContextObject>
+is inherited.
+
+=cut
 
 sub NewItem {
     my $self = shift;
@@ -208,60 +284,24 @@ sub NewItem {
     return $res;
 }
 
-# }}}
-
-sub LimitToLookupType  {
-    my $self = shift;
-    my $lookup = shift;
- 
-    $self->Limit( FIELD => 'LookupType', VALUE => "$lookup" );
-}
+=head2 _DoSearch
 
-sub LimitToChildType  {
-    my $self = shift;
-    my $lookup = shift;
- 
-    $self->Limit( FIELD => 'LookupType', VALUE => "$lookup" );
-    $self->Limit( FIELD => 'LookupType', ENDSWITH => "$lookup" );
-}
+A subclass of DBIx::SearchBuilder::_DoSearch that makes sure that
+ _Disabled rows never get seen unless we're explicitly trying to see
+them.
 
-sub LimitToParentType  {
-    my $self = shift;
-    my $lookup = shift;
- 
-    $self->Limit( FIELD => 'LookupType', VALUE => "$lookup" );
-    $self->Limit( FIELD => 'LookupType', STARTSWITH => "$lookup" );
-}
+=cut
 
-sub LimitToGlobalOrObjectId {
+sub _DoSearch {
     my $self = shift;
-    my $global_only = 1;
-
 
-    foreach my $id (@_) {
-	$self->Limit( ALIAS           => $self->_OCFAlias,
-		    FIELD           => 'ObjectId',
-		    OPERATOR        => '=',
-		    VALUE           => $id || 0,
-		    ENTRYAGGREGATOR => 'OR' );
-	$global_only = 0 if $id;
+    # unless we really want to find disabled rows,
+    # make sure we're only finding enabled ones.
+    unless($self->{'find_disabled_rows'}) {
+        $self->LimitToEnabled();
     }
 
-    $self->Limit( ALIAS           => $self->_OCFAlias,
-                 FIELD           => 'ObjectId',
-                 OPERATOR        => '=',
-                 VALUE           => 0,
-                 ENTRYAGGREGATOR => 'OR' ) unless $global_only;
-
-    $self->OrderByCols(
-	{ ALIAS => $self->_OCFAlias, FIELD => 'ObjectId', ORDER => 'DESC' },
-	{ ALIAS => $self->_OCFAlias, FIELD => 'SortOrder' },
-    );
-    
-    # This doesn't work on postgres. 
-    #$self->OrderBy( ALIAS => $class_cfs , FIELD => "SortOrder", ORDER => 'ASC');
-
+    return($self->SUPER::_DoSearch(@_));
 }
 
 1;
-

commit e5e4fd5949c2fce02c7f6d88fd7275e1b48cdafc
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Feb 19 21:52:16 2010 +0300

    basic ColumnMap for RT::CustomField

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 2d165d0..348289f 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1405,6 +1405,11 @@ Set(%AdminSearchResultFormat,
         .q{,'<a href="__WebPath__/Admin/Users/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
         .q{,__RealName__, __EmailAddress__},
 
+    CustomFields =>
+        q{'<a href="__WebPath__/Admin/CustomFields/Modify.html?id=__id__">__id__</a>/TITLE:#'}
+        .q{,'<a href="__WebPath__/Admin/CustomFields/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
+        .q{,__FriendlyType__, __FriendlyPattern__},
+
     Scrips => 
         q{'<a href="__WebPath__/__WebRequestPathDir__/Scrip.html?id=__id__&Queue=__QueueId__">__id__</a>/TITLE:#'}
         .q{,'<a href="__WebPath__/__WebRequestPathDir__/Scrip.html?id=__id__&Queue=__QueueId__">__Description__</a>/TITLE:Description'}
diff --git a/share/html/Elements/RT__CustomField/ColumnMap b/share/html/Elements/RT__CustomField/ColumnMap
new file mode 100644
index 0000000..86cf196
--- /dev/null
+++ b/share/html/Elements/RT__CustomField/ColumnMap
@@ -0,0 +1,87 @@
+%# BEGIN BPS TAGGED BLOCK {{{
+%# 
+%# COPYRIGHT:
+%# 
+%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC
+%#                                          <jesse at bestpractical.com>
+%# 
+%# (Except where explicitly superseded by other copyright notices)
+%# 
+%# 
+%# LICENSE:
+%# 
+%# This work is made available to you under the terms of Version 2 of
+%# the GNU General Public License. A copy of that license should have
+%# been provided with this software, but in any event can be snarfed
+%# from www.gnu.org.
+%# 
+%# This work is distributed in the hope that it will be useful, but
+%# WITHOUT ANY WARRANTY; without even the implied warranty of
+%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+%# General Public License for more details.
+%# 
+%# You should have received a copy of the GNU General Public License
+%# along with this program; if not, write to the Free Software
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
+%# 
+%# 
+%# CONTRIBUTION SUBMISSION POLICY:
+%# 
+%# (The following paragraph is not intended to limit the rights granted
+%# to you to modify and distribute this software under the terms of
+%# the GNU General Public License and is only of importance to you if
+%# you choose to contribute your changes and enhancements to the
+%# community by submitting them to Best Practical Solutions, LLC.)
+%# 
+%# By intentionally submitting any modifications, corrections or
+%# derivatives to this work, or any other work intended for use with
+%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
+%# you are the copyright holder for those contributions and you grant
+%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
+%# royalty-free, perpetual, license to use, copy, create derivative
+%# works based on those contributions, and sublicense and distribute
+%# those contributions and any derivatives thereof.
+%# 
+%# END BPS TAGGED BLOCK }}}
+<%ARGS>
+$Name => undef
+$Attr => undef
+</%ARGS>
+<%ONCE>
+my $COLUMN_MAP = {
+    id => {
+        title     => '#', # loc
+        attribute => 'id',
+        align     => 'right',
+        value     => sub { return $_[0]->id },
+    },
+    Disabled => {
+        title     => \'&nbsp;',
+        attribute => 'Disabled',
+        value     => sub { return $_[0]->Disabled? $_[0]->loc('Disabled'): $_[0]->loc('Enabled') },
+    },
+
+    map(
+        { $_ => {
+            title     => $_, attribute => $_,
+	    value     => sub { return $_[0]->$_() },
+        } }
+        qw(Name Description FriendlyType Type FriendlyPattern Pattern)
+    ),
+    MaxValues => {
+        title     => 'MaxValues', # loc
+	attribute => 'MaxValues',
+	value     => sub {
+            my $v = $_[0]->MaxValues;
+            return !$v ? $_[0]->loc('unlimited') : $v == 0 ? $_[0]->loc('one') : $v;
+        },
+    },
+};
+
+</%ONCE>
+<%INIT>
+$m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 );
+return GetColumnMapEntry( Map => $COLUMN_MAP, Name => $Name, Attribute => $Attr );
+</%INIT>

commit 21a0afb8eca5dcdff120ca555c89fe0a7b4359ad
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Feb 19 22:05:38 2010 +0300

    New and Left argument in _OCFAlias

diff --git a/lib/RT/CustomFields_Overlay.pm b/lib/RT/CustomFields_Overlay.pm
index 9f62297..b1805a5 100755
--- a/lib/RT/CustomFields_Overlay.pm
+++ b/lib/RT/CustomFields_Overlay.pm
@@ -240,15 +240,19 @@ sub SetContextObject {
 
 sub _OCFAlias {
     my $self = shift;
-    unless ($self->{_sql_ocfalias}) {
+    my %args = ( New => 0, Left => 0, @_ );
 
-        $self->{'_sql_ocfalias'} = $self->NewAlias('ObjectCustomFields');
-    $self->Join( ALIAS1 => 'main',
-                FIELD1 => 'id',
-                ALIAS2 => $self->_OCFAlias,
-                FIELD2 => 'CustomField' );
-    }
-    return($self->{_sql_ocfalias});
+    return $self->{'_sql_ocfalias'} if $self->{'_sql_ocfalias'} && !$args{'New'};
+
+    my $alias = $self->Join(
+        $args{'Left'} ? (TYPE => 'LEFT') : (),
+        ALIAS1 => 'main',
+        FIELD1 => 'id',
+        TABLE2 => 'ObjectCustomFields',
+        FIELD2 => 'CustomField'
+    );
+    return $alias if $args{'New'};
+    return $self->{'_sql_ocfalias'} = $alias;
 }
 
 

commit badaf96195e2a8b707901d3763d6714cd9f70958
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Feb 24 02:04:09 2010 +0300

    improve column map for CFs
    
    * fix map statement, it was not good
    * AppliedTo column that lists objects this CF is applied to
    * RemoveCheckBox that is special and doesn't show CB for global CFs

diff --git a/share/html/Elements/RT__CustomField/ColumnMap b/share/html/Elements/RT__CustomField/ColumnMap
index 86cf196..327359e 100644
--- a/share/html/Elements/RT__CustomField/ColumnMap
+++ b/share/html/Elements/RT__CustomField/ColumnMap
@@ -64,11 +64,19 @@ my $COLUMN_MAP = {
     },
 
     map(
-        { $_ => {
-            title     => $_, attribute => $_,
-	    value     => sub { return $_[0]->$_() },
+        { my $c = $_; $c => {
+            title     => $c, attribute => $c,
+	    value     => sub { return $_[0]->$c() },
         } }
-        qw(Name Description FriendlyType Type FriendlyPattern Pattern)
+        qw(Name Description Type Pattern)
+    ),
+    map(
+        { my $c = $_; my $short = $c; $short =~ s/^Friendly//;
+          $c => {
+            title     => $short, attribute => $c,
+	    value     => sub { return $_[0]->$c() },
+        } }
+        qw(FriendlyType FriendlyPattern)
     ),
     MaxValues => {
         title     => 'MaxValues', # loc
@@ -78,6 +86,55 @@ my $COLUMN_MAP = {
             return !$v ? $_[0]->loc('unlimited') : $v == 0 ? $_[0]->loc('one') : $v;
         },
     },
+    AppliedTo => {
+        title     => 'Applied', # loc
+	value     => sub {
+            if ( $_[0]->IsGlobal ) {
+                return $_[0]->loc('Global');
+            }
+
+            my $collection = $_[0]->AppliedTo;
+            $collection->RowsPerPage(10);
+            my $found = 0;
+            my $res = '';
+            while ( my $record = $collection->Next ) {
+                my $id = '';
+                $id = $record->Name if $record->can('Name');
+                $id ||= "#". $record->id;
+                $res .= ', ' if $res;
+                $res .= $id;
+                $found++;
+            }
+            $res .= ', ...' if $found >= 10;
+            return $res;
+        },
+
+    },
+    RemoveCheckBox => {
+        title => sub {
+            my $name = $_[1] || 'RemoveCustomField';
+            my $checked = $m->request_args->{ $name .'All' }? 'checked="checked"': '';
+
+            return \qq{<input type="checkbox" name="${name}All" value="1" $checked
+                              onclick="setCheckbox(this.form, '$name', this.checked)" />};
+        },
+        value => sub {
+            my $id = $_[0]->id;
+            return '' if $_[0]->IsGlobal;
+
+            my $name = $_[2] || 'RemoveCustomField';
+            my $arg = $m->request_args->{ $name };
+
+            my $checked = '';
+            if ( $arg && ref $arg ) {
+                $checked = 'checked="checked"' if grep $_ == $id, @$arg;
+            }
+            elsif ( $arg ) {
+                $checked = 'checked="checked"' if $arg == $id;
+            }
+            return \qq{<input type="checkbox" name="$name" value="$id" $checked />}
+        },
+    },
 };
 
 </%ONCE>

commit 328d2bc53ccf88aab68ecabe871abe55d07426fe
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Feb 24 02:08:03 2010 +0300

    update default format for CustomFields in the config

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index 348289f..cc2a1d9 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1408,7 +1408,7 @@ Set(%AdminSearchResultFormat,
     CustomFields =>
         q{'<a href="__WebPath__/Admin/CustomFields/Modify.html?id=__id__">__id__</a>/TITLE:#'}
         .q{,'<a href="__WebPath__/Admin/CustomFields/Modify.html?id=__id__">__Name__</a>/TITLE:Name'}
-        .q{,__FriendlyType__, __FriendlyPattern__},
+        .q{,__AppliedTo__, __FriendlyType__, __FriendlyPattern__},
 
     Scrips => 
         q{'<a href="__WebPath__/__WebRequestPathDir__/Scrip.html?id=__id__&Queue=__QueueId__">__id__</a>/TITLE:#'}

commit 079b7e0f86b00f2a5d16df00b81497af0dc090d5
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Feb 24 02:24:13 2010 +0300

    CustomFields->LimitToNotApplied function

diff --git a/lib/RT/CustomFields_Overlay.pm b/lib/RT/CustomFields_Overlay.pm
index b1805a5..c4cb323 100755
--- a/lib/RT/CustomFields_Overlay.pm
+++ b/lib/RT/CustomFields_Overlay.pm
@@ -152,6 +152,41 @@ sub LimitToGlobalOrObjectId {
 
 }
 
+=head2 LimitToNotApplied
+
+Takes either list of object ids or nothing. Limits collection
+to custom fields to listed objects or any corespondingly. Use
+zero to mean global.
+
+=cut
+
+sub LimitToNotApplied {
+    my $self = shift;
+    my @ids = @_;
+
+    my $ocfs_alias = $self->_OCFAlias( New => 1, Left => 1 );
+    if ( @ids ) {
+        # XXX: we need different EA in join clause, but DBIx::SB
+        # doesn't support them, use IN (X) instead
+        my $dbh = $self->_Handle->dbh;
+        $self->Limit(
+            LEFTJOIN   => $ocfs_alias,
+            ALIAS      => $ocfs_alias,
+            FIELD      => 'ObjectId',
+            OPERATOR   => 'IN',
+            QUOTEVALUE => 0,
+            VALUE      => "(". join( ',', map $dbh->quote($_), @ids ) .")",
+        );
+    }
+
+    $self->Limit(
+        ENTRYAGGREGATOR => 'AND',
+        ALIAS    => $ocfs_alias,
+        FIELD    => 'id',
+        OPERATOR => 'IS',
+        VALUE    => 'NULL',
+    );
+}
 
 =head2 LimitToGlobalOrQueue QUEUEID
 

commit 021df5a91e0a6c142362626514b420fafe6816da
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Feb 24 02:25:26 2010 +0300

    CustomField->IsGlobal method

diff --git a/lib/RT/CustomField_Overlay.pm b/lib/RT/CustomField_Overlay.pm
index d29e7fa..a3785ab 100755
--- a/lib/RT/CustomField_Overlay.pm
+++ b/lib/RT/CustomField_Overlay.pm
@@ -52,6 +52,7 @@ use strict;
 no warnings qw(redefine);
 
 use RT::CustomFieldValues;
+use RT::ObjectCustomFields;
 use RT::ObjectCustomFieldValues;
 
 
@@ -1002,6 +1003,19 @@ sub _AppliedTo {
     return ($res, $ocfs_alias);
 }
 
+=head2 IsGlobal
+
+Return true if this custom field is applied globally.
+
+=cut
+
+sub IsGlobal {
+    my $self = shift;
+    my $ocf = RT::ObjectCustomField->new( $self->CurrentUser );
+    $ocf->LoadByCols( CustomField => $self->id, ObjectId => 0 );
+    return $ocf->id;
+}
+
 =head2 AddToObject OBJECT
 
 Add this custom field as a custom field for a single object, such as a queue or group.

commit 2eaeeef02f3dbd1b276134c14c42c5372331f148
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Wed Feb 24 04:02:57 2010 +0300

    refactor Admin/Elements/EditCustomFields, sorting doesn't work yet

diff --git a/share/html/Admin/Elements/EditCustomFields b/share/html/Admin/Elements/EditCustomFields
index 89c6d0f..c839ee0 100755
--- a/share/html/Admin/Elements/EditCustomFields
+++ b/share/html/Admin/Elements/EditCustomFields
@@ -51,155 +51,140 @@
 <input type="hidden" class="hidden" name="id" value="<% $Object->Id || ''%>" />
 <input type="hidden" class="hidden" name="ObjectType" value="<% $ObjectType %>" />
 <input type="hidden" class="hidden" name="SubType" value="<% $SubType %>" />
-<input type="hidden" class="hidden" name="UpdateCFs" value="1" />
 
-% if ($Object->Id) {
-<h2><&|/l&>Global Custom Fields</&></h2>
-<& PickCustomFields, CustomFields => \@GlobalCFs, ReadOnly => 1, id => $id, SubType => $SubType &>
-% }
 <h2><&|/l&>Selected Custom Fields</&></h2>
-<& PickCustomFields, CustomFields => [$ObjectCFs->CustomFields], id => $id, Checked => 1, SubType => $SubType &>
-<h2><&|/l&>Unselected Custom Fields</&></h2>
-<& PickCustomFields, CustomFields => \@UnassignedCFs, id => $id, SubType => $SubType &>
+<& /Elements/CollectionList,
+    OrderBy       => 'Name',
+    Order         => 'ASC',
+    %ARGS,
+    Collection    => $applied_cfs,
+    Rows          => 0,
+    Page          => 1,
+    Format        => $format,
+    DisplayFormat =>
+        $Object->id
+            ? "'__RemoveCheckBox.{". $Object->id ."}__',". $format
+            : "'__CheckBox.{RemoveCustomField}__',". $format,
+    AllowSorting  => 0,
+    ShowEmpty     => 0,
+    PassArguments => [
+        qw(Page Order OrderBy),
+        qw(id ObjectType SubType),
+    ],
+&>
 
-<& /Elements/Submit, CheckAll => 1, ClearAll => 1 &>
+<h2><&|/l&>Unselected Custom Fields</&></h2>
+<& /Elements/CollectionList,
+    OrderBy       => 'Name',
+    Order         => 'ASC',
+    %ARGS,
+    Collection    => $not_applied_cfs,
+    Rows          => 50,
+    Format        => $format,
+    DisplayFormat => "'__CheckBox.{AddCustomField}__',". $format,
+    AllowSorting  => 1,
+    ShowEmpty     => 0,
+    PassArguments => [
+        qw(Page Order OrderBy),
+        qw(id ObjectType SubType),
+    ],
+&>
+
+<& /Elements/Submit, Name => 'UpdateCFs' &>
 </form>
 
 
 <%INIT>
-my $CustomFields = RT::CustomFields->new($session{'CurrentUser'});
-my @results;
-my (@GlobalCFs, @UnassignedCFs);
-
 my $id = $Object->Id;
 if ($id and !$Object->CurrentUserHasRight('AssignCustomFields')) {
     $m->out('<p><i>', loc('(No custom fields)'), '</i></p>');
     return;
 }
 
+my @results;
+
 my $lookup = $ObjectType;
 $lookup .= "-$SubType" if $SubType;
 
-$CustomFields->LimitToLookupType($lookup);
-$CustomFields->OrderBy( FIELD => 'Name' );
-
-
-my ($GlobalCFs, $ObjectCFs);
-$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'});
-$ObjectCFs->UnLimit;
-$ObjectCFs->LimitToObjectId($id);
-$ObjectCFs->LimitToLookupType($lookup);
-
-# Check sanity of SortOrders
-my %SortOrders;
-$SortOrders{ $_->SortOrder }++
-  while ($_ = $ObjectCFs->Next);
-
-# If there are duplicates, run though and squash them
-if (grep $_ > 1, values %SortOrders) {
-    my $i = 1;
-    while ( my $ObjectCF = $ObjectCFs->Next ) {
-        $ObjectCF->SetSortOrder( $i++ );
-    }
-    $ObjectCFs->GotoFirstItem;
-}
-
-# {{{ deal with moving sortorder of custom fields
-if ($CustomField and $Move) {
-    my $SourceObj = RT::ObjectCustomField->new($session{'CurrentUser'});
-    $SourceObj->LoadByCols( ObjectId => $id, CustomField => $CustomField );
-
-    my $TargetObj;
-    my $target_order = $SourceObj->SortOrder + $Move;
-    while (my $ObjectCF = $ObjectCFs->Next) { 
-	my $this_order = $ObjectCF->SortOrder;
-
-	# if we have an exact match, finish the loop now
-	($TargetObj = $ObjectCF, last) if $this_order == $target_order;
-
-	# otherwise, we need to apropos toward the general direction
-	# ... first, check the sign is correct
-	next unless ($this_order - $SourceObj->SortOrder) * $Move > 0;
-
-	# ... next, see if we already have a candidate
-	if ($TargetObj) {
-	    # ... if yes, compare the delta and choose the smaller one
-	    my $orig_delta = abs($TargetObj->SortOrder - $target_order);
-	    my $this_delta = abs($this_order - $target_order);
-	    next if $orig_delta < $this_delta;
-	}
-
-	$TargetObj = $ObjectCF;
+## deal with moving sortorder of custom fields
+#if ($CustomField and $Move) {
+#    my $SourceObj = RT::ObjectCustomField->new($session{'CurrentUser'});
+#    $SourceObj->LoadByCols( ObjectId => $id, CustomField => $CustomField );
+#
+#    my $TargetObj;
+#    my $target_order = $SourceObj->SortOrder + $Move;
+#    while (my $ObjectCF = $applied_cfs->Next) { 
+#	my $this_order = $ObjectCF->SortOrder;
+#
+#	# if we have an exact match, finish the loop now
+#	($TargetObj = $ObjectCF, last) if $this_order == $target_order;
+#
+#	# otherwise, we need to apropos toward the general direction
+#	# ... first, check the sign is correct
+#	next unless ($this_order - $SourceObj->SortOrder) * $Move > 0;
+#
+#	# ... next, see if we already have a candidate
+#	if ($TargetObj) {
+#	    # ... if yes, compare the delta and choose the smaller one
+#	    my $orig_delta = abs($TargetObj->SortOrder - $target_order);
+#	    my $this_delta = abs($this_order - $target_order);
+#	    next if $orig_delta < $this_delta;
+#	}
+#
+#	$TargetObj = $ObjectCF;
+#    }
+#
+#    if ($TargetObj) {
+#	# swap their sort order
+#	my ($s, $t) = ($SourceObj->SortOrder, $TargetObj->SortOrder);
+#	$TargetObj->SetSortOrder($s);
+#	$SourceObj->SetSortOrder($t);
+#	# because order changed, we must redo search for subsequent uses
+#    }
+#
+#    $applied_cfs->GotoFirstItem;
+#}
+
+if ( $UpdateCFs ) {
+    foreach my $cf_id ( @AddCustomField ) {
+        my $CF = RT::CustomField->new( $session{'CurrentUser'} );
+        $CF->Load( $cf_id );
+        unless ( $CF->id ) {
+            push @results, loc("Couldn't load CustomField #[_1]", $cf_id);
+            next;
+        }
+        my ($status, $msg) = $CF->AddToObject( $Object );
+        push @results, $msg;
     }
-
-    if ($TargetObj) {
-	# swap their sort order
-	my ($s, $t) = ($SourceObj->SortOrder, $TargetObj->SortOrder);
-	$TargetObj->SetSortOrder($s);
-	$SourceObj->SetSortOrder($t);
-	# because order changed, we must redo search for subsequent uses
+    foreach my $cf_id ( @RemoveCustomField ) {
+        my $CF = RT::CustomField->new( $session{'CurrentUser'} );
+        $CF->Load( $cf_id );
+        unless ( $CF->id ) {
+            push @results, loc("Couldn't load CustomField #[_1]", $cf_id);
+            next;
+        }
+        my ($status, $msg) = $CF->RemoveFromObject( $Object );
+        push @results, $msg;
     }
-
-    $ObjectCFs->GotoFirstItem;
 }
-# }}}
 
-if ($id) {
-    $GlobalCFs = RT::ObjectCustomFields->new($session{'CurrentUser'});
-    $GlobalCFs->LimitToObjectId(0);
-    $GlobalCFs->LimitToLookupType($lookup);
-}
+my $applied_cfs = RT::CustomFields->new( $session{'CurrentUser'} );
+$applied_cfs->LimitToLookupType($lookup);
+$applied_cfs->LimitToGlobalOrObjectId($id);
 
-while (my $cf = $CustomFields->Next) { 
-    my $cf_id = $cf->Id;
+my $not_applied_cfs = RT::CustomFields->new( $session{'CurrentUser'} );
+$not_applied_cfs->LimitToLookupType($lookup);
+$not_applied_cfs->LimitToNotApplied( $id ? ($id, 0) : (0) );
 
-    if ($GlobalCFs and $GlobalCFs->HasEntryForCustomField($cf_id)) {
-	push @GlobalCFs, $cf;
-	next;
-    }
-
-    if ($UpdateCFs) {
-	# Go through and delete all the custom field relationships that this object
-	# no longer has
-	my $key = "Object-$id-CF-$cf_id";
-	if ($ARGS{$key}) {
-	    if (!$ObjectCFs->HasEntryForCustomField($cf_id)) {
-		my ($val, $msg) = $cf->AddToObject($Object);
-		push (@results, $msg);
-		push @UnassignedCFs, $cf if !$val;
-	    }
-	}
-	else {
-	    push @UnassignedCFs, $cf;
-	    if ($ObjectCFs->HasEntryForCustomField($cf_id)) {
-		my ($val, $msg) = $cf->RemoveFromObject($Object);
-		push (@results, $msg);
-		pop @UnassignedCFs if !$val;
-	    }
-	}
-    }
-    elsif (!$ObjectCFs->HasEntryForCustomField($cf_id)) {
-	push @UnassignedCFs, $cf;
-    }
-        else {
-        }
-}
-
-# redo search...
-$ObjectCFs = RT::ObjectCustomFields->new($session{'CurrentUser'});
-$ObjectCFs->UnLimit;
-$ObjectCFs->LimitToObjectId($id);
-$ObjectCFs->LimitToLookupType($lookup);
+my $format = RT->Config->Get('AdminSearchResultFormat')->{'CustomFields'};
 
 </%INIT>
 <%ARGS>
-$title => undef
-$Move => undef
-$Source => undef
-$CustomField => undef
-$FindDisabledCustomFields => undef
-$UpdateCFs => 0
 $Object
 $ObjectType
 $SubType => ''
+
+$UpdateCFs         => undef
+ at RemoveCustomField => ()
+ at AddCustomField    => ()
 </%ARGS>

-----------------------------------------------------------------------


More information about the Rt-commit mailing list