projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
import rt 3.6.4
[freeside.git]
/
rt
/
html
/
Search
/
Elements
/
EditSearches
diff --git
a/rt/html/Search/Elements/EditSearches
b/rt/html/Search/Elements/EditSearches
index
bc6b80e
..
9ab9f94
100644
(file)
--- a/
rt/html/Search/Elements/EditSearches
+++ b/
rt/html/Search/Elements/EditSearches
@@
-2,7
+2,7
@@
%#
%# COPYRIGHT:
%#
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-200
5
Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-200
7
Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@
-22,7
+22,9
@@
%#
%# You should have received a copy of the GNU General Public License
%# along with this program; if not, write to the Free Software
%#
%# 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# 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.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
@@
-43,62
+45,59
@@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<&
/Elements/TitleBoxStart, title => loc('Saved searches')
&>
+<&
| /Widgets/TitleBox, title => loc($Title)
&>
%# 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) {
%# 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 &><br>
+<& SearchPrivacy, Object => $CurrentSearch->{'Object'}->Object &><br
/
>
% } else {
% } else {
-<& SelectSearchObject, Name => 'Owner', Objects => \@Objects &><br>
+<& SelectSearchObject, Name => 'Owner', Objects => \@Objects &><br
/
>
% }
<&|/l&>Description</&>:<br>
% }
<&|/l&>Description</&>:<br>
-<font size="-1"><input size="25" name="Description" value="<%$CurrentSearch->{'Description'}
%>"
></font>
+<font size="-1"><input size="25" name="Description" value="<%$CurrentSearch->{'Description'}
|| ''%>" /
></font>
<nobr>
% if ($SearchId ne 'new') {
% if ($Dirty) {
<nobr>
% if ($SearchId ne 'new') {
% if ($Dirty) {
-<input type="submit"
name="Revert" value="<%loc('Revert')%>"
>
+<input type="submit"
class="button" name="Revert" value="<%loc('Revert')%>" /
>
% }
% }
-<input type="submit" name="Delete" value="<%loc('Delete')%>">
-<input type="submit" name="CopySearch" value="<%loc('Copy')%>">
-</nobr>
-
+<input type="submit" class="button" name="Delete" value="<%loc('Delete')%>" />
+% if ($AllowCopy) {
+<input type="submit" class="button" name="CopySearch" value="<%loc('Copy')%>" />
% }
% }
+</nobr>
-% if ($Dirty or $SearchId eq 'new') {
-<input type="submit" name="Save" value="<%loc('Save')%>">
% }
% }
-<hr>
+<input type="submit" name="Save" value="<%loc('Save')%>" class="button" />
+<hr />
% }
% }
-<&|/l&>Load saved search:</&><br>
-<& SelectSearchesForObjects, Name => 'LoadSavedSearch', Objects => \@Objects&>
-<input value="<%loc('Load')%>" type="submit">
-<
& /Elements/TitleBoxEnd
&>
+<&|/l&>Load saved search:</&><br
/
>
+<& SelectSearchesForObjects, Name => 'LoadSavedSearch', Objects => \@Objects
, SearchType => $SearchType
&>
+<input value="<%loc('Load')%>" type="submit"
class="button" /
>
+<
/
&>
<%init>
<%init>
-
unless ($session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch',
unless ($session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch',
- Object=> $RT::System )) {
+
Object=> $RT::System )) {
return;
}
return;
}
-my @Objects;
-
-push @Objects, $session{CurrentUser}->UserObj;
-
-my $groups = RT::Groups->new($session{'CurrentUser'});
-$groups->LimitToUserDefinedGroups;
-$groups->WithMember(PrincipalId => $session{'CurrentUser'}->Id,
- Recursively => 1);
+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');
- push (@Objects, @{$groups->ItemsArrayRef()});
</%INIT>
<%ARGS>
</%INIT>
<%ARGS>
+$SearchType => 'Ticket'
$SearchId => undef
$CurrentSearch => undef
$Description => undef
$HideResults => 0
$Dirty => 0
$SearchId => undef
$CurrentSearch => undef
$Description => undef
$HideResults => 0
$Dirty => 0
+$AllowCopy => 1
+$Title => 'Saved searches'
</%ARGS>
</%ARGS>