[Rt-commit] rt branch, 4.0/apply-scrips-to-multiple-queues, updated. rt-4.0.4-229-gfa97368

Ruslan Zakirov ruz at bestpractical.com
Fri Sep 21 17:16:14 EDT 2012


The branch, 4.0/apply-scrips-to-multiple-queues has been updated
       via  fa9736816c873db13408aeaa4719a18c0b049853 (commit)
       via  21e6d4f26eaf2cfd1bb4b6aee0c96fabc7ee3db2 (commit)
      from  b9402897e2ece77e3e70f2b36f65374d31bb7723 (commit)

Summary of changes:
 lib/RT/CustomField.pm                              | 42 ++++++++++++----------
 lib/RT/CustomFields.pm                             | 12 +++----
 lib/RT/ObjectCustomField.pm                        |  2 +-
 lib/RT/ObjectCustomFields.pm                       |  2 +-
 lib/RT/ObjectScrip.pm                              | 18 +++++-----
 lib/RT/ObjectScrips.pm                             |  4 +--
 lib/RT/Record/{ApplyAndSort.pm => AddAndSort.pm}   | 34 +++++++++---------
 lib/RT/Scrip.pm                                    | 14 ++++----
 lib/RT/Scrips.pm                                   |  8 ++---
 .../{ApplyAndSort.pm => AddAndSort.pm}             | 24 ++++++-------
 share/html/Admin/CustomFields/Modify.html          |  4 +--
 share/html/Admin/CustomFields/Objects.html         |  8 ++---
 share/html/Admin/Elements/EditCustomFields         |  2 +-
 share/html/Admin/Elements/EditScrips               |  8 ++---
 share/html/Elements/RT__CustomField/ColumnMap      | 14 ++++----
 share/html/Elements/RT__Scrip/ColumnMap            |  9 +++--
 16 files changed, 105 insertions(+), 100 deletions(-)
 rename lib/RT/Record/{ApplyAndSort.pm => AddAndSort.pm} (96%)
 rename lib/RT/SearchBuilder/{ApplyAndSort.pm => AddAndSort.pm} (87%)

- Log -----------------------------------------------------------------
commit 21e6d4f26eaf2cfd1bb4b6aee0c96fabc7ee3db2
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Thu Sep 20 18:08:47 2012 +0400

    don't use Disabled to check IsAddedToAny

diff --git a/share/html/Elements/RT__Scrip/ColumnMap b/share/html/Elements/RT__Scrip/ColumnMap
index 0f5a476..a73e70e 100644
--- a/share/html/Elements/RT__Scrip/ColumnMap
+++ b/share/html/Elements/RT__Scrip/ColumnMap
@@ -96,11 +96,10 @@ my $COLUMN_MAP = {
     Disabled => {
         title     => \' ',
         value     => sub {
-            my $v = $_[0]->Disabled;
-            return !defined $v
-                ? $_[0]->loc('Not applied')
-                : $v ? $_[0]->loc('Disabled')
-                : $_[0]->loc('Enabled')
+            return
+                $_[0]->IsAddedToAny
+                ? ($_[0]->Disabled ? $_[0]->loc('Disabled') : $_[0]->loc('Enabled') )
+                : $_[0]->loc('Not Applied')
         },
     },
     RemoveCheckBox => {

commit fa9736816c873db13408aeaa4719a18c0b049853
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Sat Sep 22 01:08:44 2012 +0400

    rename Apply to Add
    
    Apply and Add were used in CustomField to mean the same thing.
    
    Apply in Scrip is used to run scrip. So we went for Add* for
    scrips.
    
    After review we decided that it's better to unify API to use
    Add term.

diff --git a/lib/RT/CustomField.pm b/lib/RT/CustomField.pm
index 0f0f3ac..5221d48 100644
--- a/lib/RT/CustomField.pm
+++ b/lib/RT/CustomField.pm
@@ -869,8 +869,8 @@ sub ACLEquivalenceObjects {
 =head2 ContextObject and SetContextObject
 
 Set or get a context for this object. It can be ticket, queue or another object
-this CF applies to. Used for ACL control, for example SeeCustomField can be granted on
-queue level to allow people to see all fields applied to the queue.
+this CF be added to. Used for ACL control, for example SeeCustomField can be granted on
+queue level to allow people to see all fields added to the queue.
 
 =cut
 
@@ -1183,54 +1183,57 @@ sub CollectionClassFromLookupType {
     return $collection_class;
 }
 
-=head1 ApplyGlobally
+=head1 IsOnlyGlobal
 
-Certain custom fields (users, groups) should only be applied globally
+Certain custom fields (users, groups) should only be added globally
 but rather than regexing in code for LookupType =~ RT::Queue, we'll codify
 the rules here.
 
 =cut
 
-sub ApplyGlobally {
+sub IsOnlyGlobal {
     my $self = shift;
 
     return ($self->LookupType =~ /^RT::(?:Group|User)/io);
 
 }
+sub ApplyGlobally { warn "DEPRECATED, use IsOnlyGlobal"; return shift->IsOnlyGlobal(@_) }
 
-=head1 AppliedTo
+=head1 AddedTo
 
 Returns collection with objects this custom field is applied to.
 Class of the collection depends on L</LookupType>.
-See all L</NotAppliedTo> .
+See all L</NotAddedTo> .
 
 Doesn't takes into account if object is applied globally.
 
 =cut
 
-sub AppliedTo {
+sub AddedTo {
     my $self = shift;
     return RT::ObjectCustomField->new( $self->CurrentUser )
-        ->AppliedTo( CustomField => $self );
+        ->AddedTo( CustomField => $self );
 }
+sub AppliedTo { warn "DEPRECATED: use AddedTo"; shift->AddedTo(@_) };
 
-=head1 NotAppliedTo
+=head1 NotAddedTo
 
 Returns collection with objects this custom field is not applied to.
 Class of the collection depends on L</LookupType>.
-See all L</AppliedTo> .
+See all L</AddedTo> .
 
 Doesn't takes into account if object is applied globally.
 
 =cut
 
-sub NotAppliedTo {
+sub NotAddedTo {
     my $self = shift;
     return RT::ObjectCustomField->new( $self->CurrentUser )
-        ->NotAppliedTo( CustomField => $self );
+        ->NotAddedTo( CustomField => $self );
 }
+sub NotAppliedTo { warn "DEPRECATED: use NotAddedTo"; shift->NotAddedTo(@_) };
 
-=head2 IsApplied
+=head2 IsAdded
 
 Takes object id and returns corresponding L<RT::ObjectCustomField>
 record if this custom field is applied to the object. Use 0 to check
@@ -1238,7 +1241,7 @@ if custom field is applied globally.
 
 =cut
 
-sub IsApplied {
+sub IsAdded {
     my $self = shift;
     my $id = shift;
     my $ocf = RT::ObjectCustomField->new( $self->CurrentUser );
@@ -1246,14 +1249,15 @@ sub IsApplied {
     return undef unless $ocf->id;
     return $ocf;
 }
+sub IsApplied { warn "DEPRECATED: use IsAdded"; shift->IsAdded(@_) };
 
-=head2 IsAppliedToAny
+=head2 IsAddedToAny
 
 Returns true if custom field is applied to any object.
 
 =cut
 
-sub IsAppliedToAny {
+sub IsAddedToAny {
     my $self = shift;
     my $id = shift;
     my $ocf = RT::ObjectCustomField->new( $self->CurrentUser );
@@ -1283,7 +1287,7 @@ sub AddToObject {
     }
 
     my $ocf = RT::ObjectCustomField->new( $self->CurrentUser );
-    my ( $oid, $msg ) = $ocf->Apply(
+    my ( $oid, $msg ) = $ocf->Add(
         CustomField => $self->id, ObjectId => $id,
     );
     return ( $oid, $msg );
@@ -1311,7 +1315,7 @@ sub RemoveFromObject {
         return ( 0, $self->loc('Permission Denied') );
     }
 
-    my $ocf = $self->IsApplied( $id );
+    my $ocf = $self->IsAdded( $id );
     unless ( $ocf ) {
         return ( 0, $self->loc("This custom field does not apply to that object") );
     }
diff --git a/lib/RT/CustomFields.pm b/lib/RT/CustomFields.pm
index 185cf8b..d302e00 100644
--- a/lib/RT/CustomFields.pm
+++ b/lib/RT/CustomFields.pm
@@ -169,7 +169,7 @@ sub LimitToGlobalOrObjectId {
                  ENTRYAGGREGATOR => 'OR' ) unless $global_only;
 }
 
-=head2 LimitToNotApplied
+=head2 LimitToNotAdded
 
 Takes either list of object ids or nothing. Limits collection
 to custom fields to listed objects or any corespondingly. Use
@@ -177,23 +177,23 @@ zero to mean global.
 
 =cut
 
-sub LimitToNotApplied {
+sub LimitToNotAdded {
     my $self = shift;
     return RT::ObjectCustomFields->new( $self->CurrentUser )
-        ->LimitTargetToNotApplied( $self => @_ );
+        ->LimitTargetToNotAdded( $self => @_ );
 }
 
-=head2 LimitToApplied
+=head2 LimitToAdded
 
 Limits collection to custom fields to listed objects or any corespondingly. Use
 zero to mean global.
 
 =cut
 
-sub LimitToApplied {
+sub LimitToAdded {
     my $self = shift;
     return RT::ObjectCustomFields->new( $self->CurrentUser )
-        ->LimitTargetToApplied( $self => @_ );
+        ->LimitTargetToAdded( $self => @_ );
 }
 
 =head2 LimitToGlobalOrQueue QUEUEID
diff --git a/lib/RT/ObjectCustomField.pm b/lib/RT/ObjectCustomField.pm
index 47a444c..e06a153 100644
--- a/lib/RT/ObjectCustomField.pm
+++ b/lib/RT/ObjectCustomField.pm
@@ -49,7 +49,7 @@ use strict;
 use warnings;
 
 package RT::ObjectCustomField;
-use base 'RT::Record::ApplyAndSort';
+use base 'RT::Record::AddAndSort';
 
 use RT::CustomField;
 use RT::ObjectCustomFields;
diff --git a/lib/RT/ObjectCustomFields.pm b/lib/RT/ObjectCustomFields.pm
index 2466313..c182fba 100644
--- a/lib/RT/ObjectCustomFields.pm
+++ b/lib/RT/ObjectCustomFields.pm
@@ -49,7 +49,7 @@ use strict;
 use warnings;
 
 package RT::ObjectCustomFields;
-use base 'RT::SearchBuilder::ApplyAndSort';
+use base 'RT::SearchBuilder::AddAndSort';
 
 use RT::CustomField;
 use RT::ObjectCustomField;
diff --git a/lib/RT/ObjectScrip.pm b/lib/RT/ObjectScrip.pm
index 5a66515..2735656 100644
--- a/lib/RT/ObjectScrip.pm
+++ b/lib/RT/ObjectScrip.pm
@@ -2,20 +2,20 @@ use strict;
 use warnings;
 
 package RT::ObjectScrip;
-use base 'RT::Record::ApplyAndSort';
+use base 'RT::Record::AddAndSort';
 
 use RT::Scrip;
 use RT::ObjectScrips;
 
 =head1 NAME
 
-RT::ObjectScrip - record representing application of a scrip to a queue
+RT::ObjectScrip - record representing addition of a scrip to a queue
 
 =head1 DESCRIPTION
 
-This record is created if you want to apply a scrip to a queue or globally.
+This record is created when you add a scrip to a queue or globally.
 
-Inherits methods from L<RT::Record::ApplyAndSort>.
+Inherits methods from L<RT::Record::AddAndSort>.
 
 For most operations it's better to use methods in L<RT::Scrip>.
 
@@ -40,7 +40,7 @@ sub ObjectCollectionClass {'RT::Queues'}
 
 =head2 Create
 
-Creates a record, e.g. applies scrip to a queue or globally.
+Creates a record, e.g. adds a scrip to a queue or globally.
 
 It's better to use L<RT::Scrip/AddToObject> method instead.
 
@@ -58,13 +58,13 @@ Stage of the scrip. The same scrip can be run in different stages.
 
 =item ObjectId
 
-Id or an object this scrip should be applied to. For now it's a queue.
+Id or an object this scrip should be added to. For now it's a queue.
 Use 0 to mean globally.
 
 =item Disabled
 
-Boolean indicator whether this new application is active or not. For now
-all applications of the same Scrip should be either disabled or active.
+Boolean indicator whether this new addition is active or not. For now
+all additions of the same Scrip should be either disabled or active.
 
 =item Created, Creator, LastUpdated, LastUpdatedBy
 
@@ -105,7 +105,7 @@ sub ScripObj {
 
 =head2 Neighbors
 
-Stage splits scrips into neighborhoods. See L<RT::Record::ApplyAndSort/Neighbors and Siblings>.
+Stage splits scrips into neighborhoods. See L<RT::Record::AddAndSort/Neighbors and Siblings>.
 
 =cut
 
diff --git a/lib/RT/ObjectScrips.pm b/lib/RT/ObjectScrips.pm
index b21b30c..7db4284 100644
--- a/lib/RT/ObjectScrips.pm
+++ b/lib/RT/ObjectScrips.pm
@@ -2,7 +2,7 @@ use strict;
 use warnings;
 
 package RT::ObjectScrips;
-use base 'RT::SearchBuilder::ApplyAndSort';
+use base 'RT::SearchBuilder::AddAndSort';
 
 use RT::Scrips;
 use RT::ObjectScrip;
@@ -13,7 +13,7 @@ RT::ObjectScrips - collection of RT::ObjectScrip records
 
 =head1 DESCRIPTION
 
-Collection of L<RT::ObjectScrip> records. Inherits methods from L<RT::SearchBuilder::ApplyAndSort>.
+Collection of L<RT::ObjectScrip> records. Inherits methods from L<RT::SearchBuilder::AddAndSort>.
 
 =head1 METHODS
 
diff --git a/lib/RT/Record/ApplyAndSort.pm b/lib/RT/Record/AddAndSort.pm
similarity index 96%
rename from lib/RT/Record/ApplyAndSort.pm
rename to lib/RT/Record/AddAndSort.pm
index 20dfb57..5e83d12 100644
--- a/lib/RT/Record/ApplyAndSort.pm
+++ b/lib/RT/Record/AddAndSort.pm
@@ -1,12 +1,12 @@
 use strict;
 use warnings;
 
-package RT::Record::ApplyAndSort;
+package RT::Record::AddAndSort;
 use base 'RT::Record';
 
 =head1 NAME
 
-RT::Record::ApplyAndSort - base class for records that can be applied and sorted
+RT::Record::AddAndSort - base class for records that can be applied and sorted
 
 =head1 DESCRIPTION
 
@@ -78,7 +78,7 @@ Example:
     my $ocf = RT::ObjectCustomField->new( RT->SystemUser );
     my ($id, $msg) = $ocf->Create( CustomField => 1, ObjectId => 0 );
 
-See L</Apply> which has more error checks. Also, L<RT::Scrip> and L<RT::CustomField>
+See L</Add> which has more error checks. Also, L<RT::Scrip> and L<RT::CustomField>
 have more appropriate methods that B<should be> prefered over calling this directly.
 
 =cut
@@ -120,7 +120,7 @@ sub Create {
     );
 }
 
-=head3 Apply
+=head3 Add
 
 Helper method that wraps L</Create> and does more checks to make sure result
 is consistent. Doesn't allow to apply a record to an object if the record
@@ -129,7 +129,7 @@ to apply the record globally.
 
 =cut
 
-sub Apply {
+sub Add {
     my $self = shift;
     my %args = (@_);
 
@@ -143,14 +143,14 @@ sub Apply {
     $oid = $oid->id if ref $oid;
     $oid ||= 0;
 
-    if ( $self->IsApplied( $tid => $oid ) ) {
+    if ( $self->IsAdded( $tid => $oid ) ) {
         return ( 0, $self->loc("Is already applied to the object") );
     }
 
     if ( $oid ) {
         # applying locally
         return (0, $self->loc("Couldn't apply as it's global already") )
-            if $self->IsApplied( $tid => 0 );
+            if $self->IsAdded( $tid => 0 );
     }
     else {
         $self->DeleteAll( $field => $tid );
@@ -239,7 +239,7 @@ sub SetDisabledOnAll {
     return (1, $self->loc("Disabled all applications") );
 }
 
-sub IsApplied {
+sub IsAdded {
     my $self = shift;
     my ($tid, $oid) = @_;
     my $record = $self->new( $self->CurrentUser );
@@ -378,11 +378,11 @@ sub TargetObj {
     return $self->$method( $id );
 }
 
-=head3 AppliedTo
+=head3 AddedTo
 
 Returns collection with objects target of this record is applied to.
 Class of the collection depends on L</ObjectCollectionClass>.
-See all L</NotAppliedTo>.
+See all L</NotAddedTo>.
 
 For example returns L<RT::Queues> collection if the target is L<RT::Scrip>.
 
@@ -390,10 +390,10 @@ Returns empty collection if target is applied globally.
 
 =cut
 
-sub AppliedTo {
+sub AddedTo {
     my $self = shift;
 
-    my ($res, $alias) = $self->_AppliedTo( @_ );
+    my ($res, $alias) = $self->_AddedTo( @_ );
     return $res unless $res;
 
     $res->Limit(
@@ -406,20 +406,20 @@ sub AppliedTo {
     return $res;
 }
 
-=head3 NotAppliedTo
+=head3 NotAddedTo
 
 Returns collection with objects target of this record is not applied to.
 Class of the collection depends on L</ObjectCollectionClass>.
-See all L</AppliedTo>.
+See all L</AddedTo>.
 
 Returns empty collection if target is applied globally.
 
 =cut
 
-sub NotAppliedTo {
+sub NotAddedTo {
     my $self = shift;
 
-    my ($res, $alias) = $self->_AppliedTo( @_ );
+    my ($res, $alias) = $self->_AddedTo( @_ );
     return $res unless $res;
 
     $res->Limit(
@@ -432,7 +432,7 @@ sub NotAppliedTo {
     return $res;
 }
 
-sub _AppliedTo {
+sub _AddedTo {
     my $self = shift;
     my %args = (@_);
 
diff --git a/lib/RT/Scrip.pm b/lib/RT/Scrip.pm
index 8f130e2..3afde00 100644
--- a/lib/RT/Scrip.pm
+++ b/lib/RT/Scrip.pm
@@ -189,13 +189,13 @@ sub Create {
         $args{'Disabled'} = 1;
     }
 
-    (my $status, $msg) = RT::ObjectScrip->new( $self->CurrentUser )->Apply(
+    (my $status, $msg) = RT::ObjectScrip->new( $self->CurrentUser )->Add(
         Scrip    => $self,
         Stage    => $args{'Stage'},
         ObjectId => $args{'Queue'},
         Disabled => $args{'Disabled'},
     );
-    $RT::Logger->error( "Couldn't apply scrip: $msg" ) unless $status;
+    $RT::Logger->error( "Couldn't add scrip: $msg" ) unless $status;
 
     return ( $id, $self->loc('Scrip Created') );
 }
@@ -240,13 +240,13 @@ sub IsAddedToAny {
 sub AddedTo {
     my $self = shift;
     return RT::ObjectScrip->new( $self->CurrentUser )
-        ->AppliedTo( Scrip => $self );
+        ->AddedTo( Scrip => $self );
 }
 
 sub NotAddedTo {
     my $self = shift;
     return RT::ObjectScrip->new( $self->CurrentUser )
-        ->NotAppliedTo( Scrip => $self );
+        ->NotAddedTo( Scrip => $self );
 }
 
 sub AddToObject {
@@ -281,7 +281,7 @@ sub AddToObject {
     }
 
     my $rec = RT::ObjectScrip->new( $self->CurrentUser );
-    return $rec->Apply( %args, Scrip => $self );
+    return $rec->Add( %args, Scrip => $self );
 }
 
 sub RemoveFromObject {
@@ -303,7 +303,7 @@ sub RemoveFromObject {
 
     my $rec = RT::ObjectScrip->new( $self->CurrentUser );
     $rec->LoadByCols( Scrip => $self->id, ObjectId => $args{'ObjectId'} );
-    return (0, $self->loc('Scrip is not applied') ) unless $rec->id;
+    return (0, $self->loc('Scrip is not added') ) unless $rec->id;
     return $rec->Delete;
 }
 
@@ -379,7 +379,7 @@ sub TemplateObj {
 =head2 Stage
 
 Takes TicketObj named argument and returns scrip's stage when
-applied to ticket's queue.
+added to ticket's queue.
 
 =cut
 
diff --git a/lib/RT/Scrips.pm b/lib/RT/Scrips.pm
index deb22c4..94ebf41 100644
--- a/lib/RT/Scrips.pm
+++ b/lib/RT/Scrips.pm
@@ -117,13 +117,13 @@ sub LimitToGlobal  {
 sub LimitToAdded {
     my $self = shift;
     return RT::ObjectScrips->new( $self->CurrentUser )
-        ->LimitTargetToApplied( $self => @_ );
+        ->LimitTargetToAdded( $self => @_ );
 }
 
 sub LimitToNotAdded {
     my $self = shift;
     return RT::ObjectScrips->new( $self->CurrentUser )
-        ->LimitTargetToNotApplied( $self => @_ );
+        ->LimitTargetToNotAdded( $self => @_ );
 }
 
 sub LimitByStage  {
@@ -142,8 +142,8 @@ sub LimitByStage  {
 
 =head2 LimitToEnabled
 
-Limits scrips to that are applied to any queue or globally
-and application is not disabled.
+Limits scrips to that are added to any queue or globally
+and it is not disabled.
 
 =cut
 
diff --git a/lib/RT/SearchBuilder/ApplyAndSort.pm b/lib/RT/SearchBuilder/AddAndSort.pm
similarity index 87%
rename from lib/RT/SearchBuilder/ApplyAndSort.pm
rename to lib/RT/SearchBuilder/AddAndSort.pm
index b9b63d3..42bc040 100644
--- a/lib/RT/SearchBuilder/ApplyAndSort.pm
+++ b/lib/RT/SearchBuilder/AddAndSort.pm
@@ -1,17 +1,17 @@
 use strict;
 use warnings;
 
-package RT::SearchBuilder::ApplyAndSort;
+package RT::SearchBuilder::AddAndSort;
 use base 'RT::SearchBuilder';
 
 =head1 NAME
 
-RT::SearchBuilder::ApplyAndSort - base class for 'apply and sort' collections
+RT::SearchBuilder::AddAndSort - base class for 'apply and sort' collections
 
 =head1 DESCRIPTION
 
 Base class for collections where records can be applied to objects with order.
-See also L<RT::Record::ApplyAndSort>. Used by L<RT::ObjectScrips> and
+See also L<RT::Record::AddAndSort>. Used by L<RT::ObjectScrips> and
 L<RT::ObjectCustomFields>.
 
 As it's about sorting then collection is sorted by SortOrder field.
@@ -78,7 +78,7 @@ Rather than implementing a base class for targets (L<RT::Scrip>,
 L<RT::CustomField>) and its collections. This class provides
 class methods to limit target collections.
 
-=head2 LimitTargetToNotApplied
+=head2 LimitTargetToNotAdded
 
 Takes a collection object and optional list of object ids. Limits
 the collection to records not applied to listed objects or if
@@ -86,12 +86,12 @@ the list is empty then any object. Use 0 (zero) to mean global.
 
 =cut
 
-sub LimitTargetToNotApplied {
+sub LimitTargetToNotAdded {
     my $self = shift;
     my $collection = shift;
     my @ids = @_;
 
-    my $alias = $self->JoinTargetToApplied($collection => @ids);
+    my $alias = $self->JoinTargetToAdded($collection => @ids);
 
     $collection->Limit(
         ENTRYAGGREGATOR => 'AND',
@@ -103,19 +103,19 @@ sub LimitTargetToNotApplied {
     return $alias;
 }
 
-=head2 LimitTargetToApplied
+=head2 LimitTargetToAdded
 
-L</LimitTargetToNotApplied> with reverse meaning. Takes the same
+L</LimitTargetToNotAdded> with reverse meaning. Takes the same
 arguments.
 
 =cut
 
-sub LimitTargetToApplied {
+sub LimitTargetToAdded {
     my $self = shift;
     my $collection = shift;
     my @ids = @_;
 
-    my $alias = $self->JoinTargetToApplied($collection => @ids);
+    my $alias = $self->JoinTargetToAdded($collection => @ids);
 
     $collection->Limit(
         ENTRYAGGREGATOR => 'AND',
@@ -127,7 +127,7 @@ sub LimitTargetToApplied {
     return $alias;
 }
 
-=head2 JoinTargetToApplied
+=head2 JoinTargetToAdded
 
 Joins collection to this table using left join, limits joined table
 by ids if those are provided.
@@ -137,7 +137,7 @@ multiple calls.
 
 =cut
 
-sub JoinTargetToApplied {
+sub JoinTargetToAdded {
     my $self = shift;
     my $collection = shift;
     my @ids = @_;
diff --git a/share/html/Admin/CustomFields/Modify.html b/share/html/Admin/CustomFields/Modify.html
index 10684a6..47f33ab 100644
--- a/share/html/Admin/CustomFields/Modify.html
+++ b/share/html/Admin/CustomFields/Modify.html
@@ -92,7 +92,7 @@
         Default => $CustomFieldObj->LookupType || $LookupType, &>
 </td></tr>
 
-% if ( $CustomFieldObj->id && !$CustomFieldObj->IsAppliedToAny ) {
+% if ( $CustomFieldObj->id && !$CustomFieldObj->IsAddedToAny ) {
 <tr><td></td>
 <td><i><&|/l&>Custom field is not added to any object.</&></i>
 </td></tr>
@@ -136,7 +136,7 @@
 
 % $m->callback(CallbackName => 'BeforeEnabled', CustomField => $CustomFieldObj, CFvalidations => \@CFvalidations);
 
-% if ( $CustomFieldObj->id && $CustomFieldObj->IsAppliedToAny ) {
+% if ( $CustomFieldObj->id && $CustomFieldObj->IsAddedToAny ) {
 <tr><td class="label"> </td><td>
 <input type="hidden" class="hidden" name="SetEnabled" value="1" />
 <input type="checkbox" class="checkbox" name="Enabled" value="1" <% $EnabledChecked |n%> />
diff --git a/share/html/Admin/CustomFields/Objects.html b/share/html/Admin/CustomFields/Objects.html
index e1cc2ba..47de484 100644
--- a/share/html/Admin/CustomFields/Objects.html
+++ b/share/html/Admin/CustomFields/Objects.html
@@ -63,7 +63,7 @@
 <input type="checkbox" name="AddCustomField-<% $CF->id %>" value="0" />
 <&|/l&>check this box to apply this Custom Field to all objects.</&>
 
-% unless ( $CF->ApplyGlobally ) {
+% unless ( $CF->IsOnlyGlobal ) {
 <h2><&|/l&>Selected objects</&></h2>
 <& /Elements/CollectionList,
     OrderBy => 'id',
@@ -141,10 +141,10 @@ if ( $UpdateObjs ) {
     }
 }
 
-my $is_global = $CF->IsApplied(0);
+my $is_global = $CF->IsAdded(0);
 
-my $applied = $CF->AppliedTo;
-my $not_applied = $CF->NotAppliedTo;
+my $applied = $CF->AddedTo;
+my $not_applied = $CF->NotAddedTo;
 
 my $collection_class = ref($applied);
 $collection_class =~ s/^RT:://;
diff --git a/share/html/Admin/Elements/EditCustomFields b/share/html/Admin/Elements/EditCustomFields
index 91d5cff..03e1916 100755
--- a/share/html/Admin/Elements/EditCustomFields
+++ b/share/html/Admin/Elements/EditCustomFields
@@ -157,7 +157,7 @@ $applied_cfs->ApplySortOrder;
 
 my $not_applied_cfs = RT::CustomFields->new( $session{'CurrentUser'} );
 $not_applied_cfs->LimitToLookupType($lookup);
-$not_applied_cfs->LimitToNotApplied( $id ? ($id, 0) : (0) );
+$not_applied_cfs->LimitToNotAdded( $id ? ($id, 0) : (0) );
 
 my $format = RT->Config->Get('AdminSearchResultFormat')->{'CustomFields'};
 
diff --git a/share/html/Admin/Elements/EditScrips b/share/html/Admin/Elements/EditScrips
index 8cd2334..0fc3a45 100755
--- a/share/html/Admin/Elements/EditScrips
+++ b/share/html/Admin/Elements/EditScrips
@@ -73,7 +73,7 @@
 &>
 
 <h2><&|/l&>Not applied scrips</&></h2>
-% $scrips = $find_scrips->(Applied => 0);
+% $scrips = $find_scrips->(Added => 0);
 <& /Elements/CollectionList,
     Rows => 50,
     Page => 1,
@@ -111,13 +111,13 @@ if ( $id ) {
 $id ||= 0;
 
 my $find_scrips = sub {
-    my %args = (Applied => 1, @_);
+    my %args = (Added => 1, @_);
     my $scrips = RT::Scrips->new($session{'CurrentUser'});
     $scrips->LimitByStage( $args{'Stage'} )
         if $args{'Stage'};
-    my $method = $args{'Applied'}? 'LimitToAdded' : 'LimitToNotAdded';
+    my $method = $args{'Added'}? 'LimitToAdded' : 'LimitToNotAdded';
     $scrips->$method(0, $id);
-    $scrips->ApplySortOrder if $args{'Applied'};
+    $scrips->ApplySortOrder if $args{'Added'};
     return $scrips;
 };
 
diff --git a/share/html/Elements/RT__CustomField/ColumnMap b/share/html/Elements/RT__CustomField/ColumnMap
index c0e17f2..b08353e 100644
--- a/share/html/Elements/RT__CustomField/ColumnMap
+++ b/share/html/Elements/RT__CustomField/ColumnMap
@@ -86,14 +86,14 @@ my $COLUMN_MAP = {
             return !$v ? $_[0]->loc('unlimited') : $v == 0 ? $_[0]->loc('one') : $v;
         },
     },
-    AppliedTo => {
-        title     => 'Applied', # loc
+    AddedTo => {
+        title     => 'Added', # loc
 	value     => sub {
-            if ( $_[0]->IsApplied ) {
+            if ( $_[0]->IsAdded ) {
                 return $_[0]->loc('Global');
             }
 
-            my $collection = $_[0]->AppliedTo;
+            my $collection = $_[0]->AddedTo;
             return '' unless $collection;
 
             $collection->RowsPerPage(10);
@@ -125,7 +125,7 @@ my $COLUMN_MAP = {
         },
         value => sub {
             my $id = $_[0]->id;
-            return '' if $_[0]->IsApplied;
+            return '' if $_[0]->IsAdded;
 
             my $name = 'RemoveCustomField';
             my $arg = $m->request_args->{ $name };
@@ -146,7 +146,7 @@ my $COLUMN_MAP = {
             my $id = $_[0]->id;
             
             my $context = $_[2] || 0;
-            return '' unless $_[0]->IsApplied( $context );
+            return '' unless $_[0]->IsAdded( $context );
 
             my $name = 'MoveCustomField';
             my $args = $m->caller_args( 1 );
@@ -171,6 +171,8 @@ my $COLUMN_MAP = {
     },
 };
 
+$COLUMN_MAP->{'AppliedTo'} = $COLUMN_MAP->{'AddedTo'};
+
 </%ONCE>
 <%INIT>
 $m->callback( COLUMN_MAP => $COLUMN_MAP, CallbackName => 'ColumnMap', CallbackOnce => 1 );
diff --git a/share/html/Elements/RT__Scrip/ColumnMap b/share/html/Elements/RT__Scrip/ColumnMap
index a73e70e..25348d2 100644
--- a/share/html/Elements/RT__Scrip/ColumnMap
+++ b/share/html/Elements/RT__Scrip/ColumnMap
@@ -99,7 +99,7 @@ my $COLUMN_MAP = {
             return
                 $_[0]->IsAddedToAny
                 ? ($_[0]->Disabled ? $_[0]->loc('Disabled') : $_[0]->loc('Enabled') )
-                : $_[0]->loc('Not Applied')
+                : $_[0]->loc('Not Added')
         },
     },
     RemoveCheckBox => {

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


More information about the Rt-commit mailing list