X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rt%2Fhtml%2FSearch%2FElements%2FEditSearches;h=bc6b80e6fe0deaf1843ea7d7a9afd0b40f382282;hb=9c68254528b6f2c7d8c1921b452fa56064783782;hp=9ab9f944dc1dfd2240269f9c50446332d6d3024b;hpb=ef20b2b6b1feb47ad02b5ff7525f1a0fd11d0fa4;p=freeside.git diff --git a/rt/html/Search/Elements/EditSearches b/rt/html/Search/Elements/EditSearches index 9ab9f944d..bc6b80e6f 100644 --- a/rt/html/Search/Elements/EditSearches +++ b/rt/html/Search/Elements/EditSearches @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2005 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -22,9 +22,7 @@ %# %# 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/copyleft/gpl.html. +%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. %# %# %# CONTRIBUTION SUBMISSION POLICY: @@ -45,59 +43,62 @@ %# those contributions and any derivatives thereof. %# %# END BPS TAGGED BLOCK }}} -<&| /Widgets/TitleBox, title => loc($Title)&> +<& /Elements/TitleBoxStart, title => loc('Saved searches') &> %# Hide all the save functionality if the user shouldn't see it. % if ($session{'CurrentUser'}->HasRight( Right => 'CreateSavedSearch', % Object=> $RT::System )) { <&|/l&>Privacy: % if ($CurrentSearch->{'Object'} && $CurrentSearch->{'Object'}->id) { -<& SearchPrivacy, Object => $CurrentSearch->{'Object'}->Object &>
+<& SearchPrivacy, Object => $CurrentSearch->{'Object'}->Object &>
% } else { -<& SelectSearchObject, Name => 'Owner', Objects => \@Objects &>
+<& SelectSearchObject, Name => 'Owner', Objects => \@Objects &>
% } <&|/l&>Description:
- + % if ($SearchId ne 'new') { % if ($Dirty) { - -% } - -% if ($AllowCopy) { - + % } + + % } - -
+ +% if ($Dirty or $SearchId eq 'new') { + +% } +
% } -<&|/l&>Load saved search:
-<& SelectSearchesForObjects, Name => 'LoadSavedSearch', Objects => \@Objects, SearchType => $SearchType &> - - +<&|/l&>Load saved search:
+<& SelectSearchesForObjects, Name => 'LoadSavedSearch', Objects => \@Objects&> + +<& /Elements/TitleBoxEnd &> <%init> + unless ($session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch', - Object=> $RT::System )) { + Object=> $RT::System )) { return; } +my @Objects; + +push @Objects, $session{CurrentUser}->UserObj; + +my $groups = RT::Groups->new($session{'CurrentUser'}); -use RT::SavedSearches; -my @Objects = RT::SavedSearches->new($session{CurrentUser})->_PrivacyObjects; -push @Objects, RT::System->new($session{'CurrentUser'}) - if $session{'CurrentUser'}->HasRight( Object=> $RT::System, - Right => 'SuperUser'); +$groups->LimitToUserDefinedGroups; +$groups->WithMember(PrincipalId => $session{'CurrentUser'}->Id, + Recursively => 1); + push (@Objects, @{$groups->ItemsArrayRef()}); <%ARGS> -$SearchType => 'Ticket' $SearchId => undef $CurrentSearch => undef $Description => undef $HideResults => 0 $Dirty => 0 -$AllowCopy => 1 -$Title => 'Saved searches'