summaryrefslogtreecommitdiff
path: root/rt/share/html/Prefs
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2012-06-07 00:56:06 -0700
committerIvan Kohler <ivan@freeside.biz>2012-06-07 00:56:06 -0700
commit43a06151e47d2c59b833cbd8c26d97865ee850b6 (patch)
tree42c51d94e7fa265461b508d061562be204ccc2c1 /rt/share/html/Prefs
parent6587f6ba7d047ddc1686c080090afe7d53365bd4 (diff)
starting to work...
Diffstat (limited to 'rt/share/html/Prefs')
-rw-r--r--rt/share/html/Prefs/Elements/Tabs76
-rw-r--r--rt/share/html/Prefs/MyRT.html20
-rw-r--r--rt/share/html/Prefs/Other.html14
-rw-r--r--rt/share/html/Prefs/Quicksearch.html13
-rw-r--r--rt/share/html/Prefs/Search.html8
-rw-r--r--rt/share/html/Prefs/SearchOptions.html10
6 files changed, 24 insertions, 117 deletions
diff --git a/rt/share/html/Prefs/Elements/Tabs b/rt/share/html/Prefs/Elements/Tabs
deleted file mode 100644
index 6fdfc8b6d..000000000
--- a/rt/share/html/Prefs/Elements/Tabs
+++ /dev/null
@@ -1,76 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
-%# <sales@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 }}}
-<& /User/Elements/Tabs,
- subtabs => $tabs,
- current_tab => 'Prefs/Other.html',
- current_subtab => $current_subtab,
- Title => $Title &>
-
-<%INIT>
-my $tabs;
-$Searches ||= [$m->comp("/Search/Elements/SearchesForObject", Object => RT::System->new($session{'CurrentUser'}))];
-
-$tabs->{a} = {
- title => loc('Quick search'),
- path => 'Prefs/Quicksearch.html',
-};
-
-for my $search (@$Searches) {
- $tabs->{ $search->[0] } = {
- title => $search->[0],
- path => "Prefs/Search.html?"
- .$m->comp('/Elements/QueryString', name => ref($search->[1]).'-'.$search->[1]->Id),
- };
-}
-</%INIT>
-<%ARGS>
-$GroupObj => undef
-$current_subtab => undef
-$Title => undef
-$Searches => undef
-</%ARGS>
diff --git a/rt/share/html/Prefs/MyRT.html b/rt/share/html/Prefs/MyRT.html
index 3bcea53f2..55e5cc9d7 100644
--- a/rt/share/html/Prefs/MyRT.html
+++ b/rt/share/html/Prefs/MyRT.html
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -46,19 +46,12 @@
%#
%# END BPS TAGGED BLOCK }}}
<& /Elements/Header, Title => $title &>
-<& /Prefs/Elements/Tabs,
- current_tab => 'Prefs/MyRT.html',
- Title => $title,
- Searches => \@sys_searches
+<& /Elements/Tabs
&>
<& /Elements/ListActions, actions => \@results &>
<& /Widgets/SelectionBox:header, nojs => 1 &>
-<form method="post" action="MyRT.html">
-<input type="hidden" name="Reset" value="1" />
-<input type="submit" class="button" value="<% loc('Reset to default') %>">
-</form>
<br />
@@ -78,6 +71,13 @@
<input type="submit" class="button" name="UpdateSummaryRows" value="<% loc('Save') %>" />
</form>
</&>
+<&|/Widgets/TitleBox, title => loc("Reset RT at a glance") &>
+<form method="post" action="MyRT.html">
+<input type="hidden" name="Reset" value="1" />
+<input type="submit" class="button" value="<% loc('Reset to default') %>">
+</form>
+</&>
+
<%INIT>
my @results;
@@ -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} )->ObjectsForLoading
if $session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch',
Object => $RT::System );
diff --git a/rt/share/html/Prefs/Other.html b/rt/share/html/Prefs/Other.html
index e0b158153..9f7e04a9c 100644
--- a/rt/share/html/Prefs/Other.html
+++ b/rt/share/html/Prefs/Other.html
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -46,13 +46,10 @@
%#
%# END BPS TAGGED BLOCK }}}
<& /Elements/Header, Title => $title &>
-<& /User/Elements/Tabs,
- current_tab => 'Prefs/Other.html',
- Title => $title,
-&>
+<& /Elements/Tabs &>
<& /Elements/ListActions, actions => \@results &>
-<form method="post" action="Other.html">
+<form method="post" action="Other.html" name="ModifyPreferences" id="ModifyPreferences">
% foreach my $section( RT->Config->Sections ) {
<&|/Widgets/TitleBox, title => loc( $section ) &>
% foreach my $option( RT->Config->Options( Section => $section ) ) {
@@ -84,9 +81,10 @@ my $title = loc("Settings");
my $UserObj = $session{'CurrentUser'}->UserObj;
my $preferences = $UserObj->Preferences( $RT::System );
-if ((defined $PreferredKey) && $PreferredKey ne $UserObj->FirstAttribute('PreferredKey')) {
+if (defined($PreferredKey) and (not $UserObj->FirstAttribute('PreferredKey')
+ or $PreferredKey ne $UserObj->FirstAttribute('PreferredKey')->Content)) {
my ($code, $msg) = $UserObj->SetAttribute(Name => 'PreferredKey', Content => $PreferredKey);
- push @results, loc('Preferred Key: [_1]', loc_fuzzy($msg));
+ push @results, loc('Preferred Key: [_1]', $msg) unless $code;
}
if ( $Update ) {
diff --git a/rt/share/html/Prefs/Quicksearch.html b/rt/share/html/Prefs/Quicksearch.html
index 93d0a5f23..7142450cb 100644
--- a/rt/share/html/Prefs/Quicksearch.html
+++ b/rt/share/html/Prefs/Quicksearch.html
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -46,10 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
<& /Elements/Header, Title => $title &>
-<& /Prefs/Elements/Tabs,
- current_tab => 'Prefs/MyRT.html',
- current_subtab => 'Prefs/Quicksearch.html',
- Title => $title
+<& /Elements/Tabs
&>
<& /Elements/ListActions, actions => \@actions &>
<h1><&|/l&>Select queues to be displayed on the "RT at a glance" page</&></h1>
@@ -60,7 +57,7 @@
% unless ($unwanted->{$queue->Name}) {
checked="checked"
% }
-/><%$queue->Name%>: <%$queue->Description%></li>
+/><%$queue->Name%><% $queue->Description ? ': '.$queue->Description : '' %></li>
% }
</ul>
<& /Elements/Submit, Caption => loc("Save Changes"), Label => loc('Save'), Name => 'Save'&>
@@ -70,7 +67,6 @@ checked="checked"
<%INIT>
my @actions;
my $title = loc("Customize").' '.loc("Quick search");
-# The queue list is not loaded from cache, so it might be a bit inconsistent
my $user = $session{'CurrentUser'}->UserObj;
my $unwanted = $user->Preferences('QuickSearch', {});
my $Queues = RT::Queues->new($session{'CurrentUser'});
@@ -89,9 +85,6 @@ if ($ARGS{'Save'}) {
my ($ok, $msg) = $user->SetPreferences('QuickSearch', $unwanted);
push @actions, $ok ? loc('Preferences saved.') : $msg;
-
- # Let QueueSummary rebuild the cache
- delete $session{'quick_search_queues'};
}
</%INIT>
diff --git a/rt/share/html/Prefs/Search.html b/rt/share/html/Prefs/Search.html
index 7e96ebc65..fdd9c17dd 100644
--- a/rt/share/html/Prefs/Search.html
+++ b/rt/share/html/Prefs/Search.html
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -46,11 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
<& /Elements/Header, Title => $title &>
-<& /Prefs/Elements/Tabs,
- current_tab => 'Prefs/MyRT.html',
-# current_subtab => 'Prefs/Search.html?name='.$m->comp('/Elements/QueryString', name => $ARGS{name}),
- current_subtab => 'Prefs/Search.html?name='.$ARGS{name},
- Title => $title
+<& /Elements/Tabs
&>
<& /Elements/ListActions, actions => \@actions &>
% if ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) {
diff --git a/rt/share/html/Prefs/SearchOptions.html b/rt/share/html/Prefs/SearchOptions.html
index aeb27863f..de88b5e2e 100644
--- a/rt/share/html/Prefs/SearchOptions.html
+++ b/rt/share/html/Prefs/SearchOptions.html
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -46,10 +46,7 @@
%#
%# END BPS TAGGED BLOCK }}}
<& /Elements/Header, Title => loc("Ticketing Search Preferences") &>
-<& /User/Elements/Tabs,
- current_tab => "Prefs/SearchOptions.html",
- Title => loc("Search Preferences")
-&>
+<& /Elements/Tabs &>
<& /Elements/ListActions, actions => \@actions &>
<form method="post" action="SearchOptions.html">
@@ -67,7 +64,7 @@
<%INIT>
my @actions;
-# {{{ If we're saving search preferences, do that now
+# If we're saving search preferences, do that now
$Order = join '|', grep defined && /\S/, (ref $Order)? @{$Order}: $Order;
$OrderBy = join '|', grep defined && /\S/, (ref $OrderBy)? @{$OrderBy}: $OrderBy;
@@ -84,7 +81,6 @@ if ($ARGS{'SavePreferences'}) {
push @actions, $ok ? loc("Preferences saved.") : $msg;
}
-# }}}
# Read from user preferences
my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {};