[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-129-gbda1fdb
Shawn Moore
sartak at bestpractical.com
Thu Jul 8 16:30:11 EDT 2010
The branch, 3.9-trunk has been updated
via bda1fdbd3ccb62362f4a46bef2c1ddcd075916da (commit)
from 31f293ea27c830872fee8b1d8977cfc4bcb6749d (commit)
Summary of changes:
lib/RT/SavedSearch.pm | 16 ++++++++++++++++
lib/RT/SavedSearches.pm | 16 ----------------
share/html/Admin/Users/MyRT.html | 2 +-
share/html/Dashboards/Queries.html | 2 +-
share/html/Elements/SavedSearches | 2 +-
share/html/Prefs/MyRT.html | 2 +-
share/html/Search/Elements/EditSearches | 4 ++--
share/html/Widgets/SavedSearch | 2 +-
8 files changed, 23 insertions(+), 23 deletions(-)
- Log -----------------------------------------------------------------
commit bda1fdbd3ccb62362f4a46bef2c1ddcd075916da
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Thu Jul 8 16:30:33 2010 -0400
Move _PrivacyObjects from SavedSearches to SavedSearch
Making this move because _PrivacyObjects is a method on Dashboard
not Dashboards, and it makes sense to centralize future logic in
RT::SharedSetting
diff --git a/lib/RT/SavedSearch.pm b/lib/RT/SavedSearch.pm
index 5182740..afcc4a6 100644
--- a/lib/RT/SavedSearch.pm
+++ b/lib/RT/SavedSearch.pm
@@ -126,6 +126,22 @@ sub Type {
return $self->{'Type'};
}
+### Internal methods
+
+# _PrivacyObjects: returns a list of objects that can be used to load saved searches from.
+
+sub _PrivacyObjects {
+ my $self = shift;
+ my $CurrentUser = $self->CurrentUser;
+
+ my $groups = RT::Groups->new($CurrentUser);
+ $groups->LimitToUserDefinedGroups;
+ $groups->WithMember( PrincipalId => $CurrentUser->Id,
+ Recursively => 1 );
+
+ return ( $CurrentUser->UserObj, @{ $groups->ItemsArrayRef() } );
+}
+
eval "require RT::SavedSearch_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/SavedSearch_Vendor.pm});
eval "require RT::SavedSearch_Local";
diff --git a/lib/RT/SavedSearches.pm b/lib/RT/SavedSearches.pm
index 7f5aabe..505a720 100644
--- a/lib/RT/SavedSearches.pm
+++ b/lib/RT/SavedSearches.pm
@@ -181,22 +181,6 @@ sub _GetObject {
return RT::SavedSearch->new($self->CurrentUser)->_GetObject($privacy);
}
-### Internal methods
-
-# _PrivacyObjects: returns a list of objects that can be used to load saved searches from.
-
-sub _PrivacyObjects {
- my $self = shift;
- my $CurrentUser = $self->CurrentUser;
-
- my $groups = RT::Groups->new($CurrentUser);
- $groups->LimitToUserDefinedGroups;
- $groups->WithMember( PrincipalId => $CurrentUser->Id,
- Recursively => 1 );
-
- return ( $CurrentUser->UserObj, @{ $groups->ItemsArrayRef() } );
-}
-
eval "require RT::SavedSearches_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate RT/SavedSearches_Vendor.pm});
eval "require RT::SavedSearches_Local";
diff --git a/share/html/Admin/Users/MyRT.html b/share/html/Admin/Users/MyRT.html
index 20e6123..4e98ba0 100644
--- a/share/html/Admin/Users/MyRT.html
+++ b/share/html/Admin/Users/MyRT.html
@@ -94,7 +94,7 @@ push @items, map {["component-$_", $_]} sort keys %allowed_components;
my $sys = RT::System->new( RT::CurrentUser->new($UserObj) );
my @objs = ($sys);
-push @objs, RT::SavedSearches->new( RT::CurrentUser->new( $UserObj ) )->_PrivacyObjects;
+push @objs, RT::SavedSearch->new( RT::CurrentUser->new( $UserObj ) )->_PrivacyObjects;
for my $object (@objs) {
for ($m->comp("/Search/Elements/SearchesForObject", Object => $object)) {
diff --git a/share/html/Dashboards/Queries.html b/share/html/Dashboards/Queries.html
index 1a1066b..23ed8b6 100644
--- a/share/html/Dashboards/Queries.html
+++ b/share/html/Dashboards/Queries.html
@@ -119,7 +119,7 @@ for my $dashboard (@{ $dashboards || [] }) {
# add saved searches
my @objs = RT::System->new($session{'CurrentUser'});
-push @objs, RT::SavedSearches->new( $session{CurrentUser} )->_PrivacyObjects
+push @objs, RT::SavedSearch->new( $session{CurrentUser} )->_PrivacyObjects
if $session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch',
Object => $RT::System );
diff --git a/share/html/Elements/SavedSearches b/share/html/Elements/SavedSearches
index e7b7d1e..bcb10e5 100644
--- a/share/html/Elements/SavedSearches
+++ b/share/html/Elements/SavedSearches
@@ -19,7 +19,7 @@
% }
</&>
<%init>
-my @Objects = RT::SavedSearches->new($session{CurrentUser})->_PrivacyObjects;
+my @Objects = RT::SavedSearch->new($session{CurrentUser})->_PrivacyObjects;
push @Objects, RT::System->new( $session{'CurrentUser'} )
if $session{'CurrentUser'}->HasRight( Object=> $RT::System,
Right => 'SuperUser' );
diff --git a/share/html/Prefs/MyRT.html b/share/html/Prefs/MyRT.html
index c91e0f7..433b7d1 100644
--- a/share/html/Prefs/MyRT.html
+++ b/share/html/Prefs/MyRT.html
@@ -115,7 +115,7 @@ my @items = map ["component-$_", $_], grep !$seen{$_}++, @{RT->Config->Get('Home
my $sys = RT::System->new($session{'CurrentUser'});
my @objs = ($sys);
-push @objs, RT::SavedSearches->new( $session{CurrentUser} )->_PrivacyObjects
+push @objs, RT::SavedSearch->new( $session{CurrentUser} )->_PrivacyObjects
if $session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch',
Object => $RT::System );
diff --git a/share/html/Search/Elements/EditSearches b/share/html/Search/Elements/EditSearches
index 62871fd..5d9eff3 100644
--- a/share/html/Search/Elements/EditSearches
+++ b/share/html/Search/Elements/EditSearches
@@ -91,8 +91,8 @@ my $can_modify = $session{'CurrentUser'}->HasRight(
Object => $RT::System,
);
-use RT::SavedSearches;
-my @Objects = RT::SavedSearches->new($session{CurrentUser})->_PrivacyObjects;
+use RT::SavedSearch;
+my @Objects = RT::SavedSearch->new($session{CurrentUser})->_PrivacyObjects;
push @Objects, RT::System->new( $session{'CurrentUser'} )
if $session{'CurrentUser'}->HasRight( Object=> $RT::System,
Right => 'SuperUser' );
diff --git a/share/html/Widgets/SavedSearch b/share/html/Widgets/SavedSearch
index d3348b3..6285b0b 100644
--- a/share/html/Widgets/SavedSearch
+++ b/share/html/Widgets/SavedSearch
@@ -55,7 +55,7 @@ return \%ARGS;
<%init>
my @actions;
-my @Objects = RT::SavedSearches->new( $session{CurrentUser} )->_PrivacyObjects;
+my @Objects = RT::SavedSearch->new( $session{CurrentUser} )->_PrivacyObjects;
push @Objects, RT::System->new($session{'CurrentUser'})
if $session{'CurrentUser'}->HasRight( Object=> $RT::System,
Right => 'SuperUser' );
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list