diff options
Diffstat (limited to 'rt/share/html/Prefs')
-rw-r--r-- | rt/share/html/Prefs/Calendar.html | 15 | ||||
-rw-r--r-- | rt/share/html/Prefs/Elements/Tabs | 76 | ||||
-rw-r--r-- | rt/share/html/Prefs/MyRT.html | 20 | ||||
-rw-r--r-- | rt/share/html/Prefs/Other.html | 15 | ||||
-rw-r--r-- | rt/share/html/Prefs/Quicksearch.html | 13 | ||||
-rw-r--r-- | rt/share/html/Prefs/Search.html | 10 | ||||
-rw-r--r-- | rt/share/html/Prefs/SearchOptions.html | 10 |
7 files changed, 32 insertions, 127 deletions
diff --git a/rt/share/html/Prefs/Calendar.html b/rt/share/html/Prefs/Calendar.html index 5fbdd2717..57eb007f6 100644 --- a/rt/share/html/Prefs/Calendar.html +++ b/rt/share/html/Prefs/Calendar.html @@ -6,10 +6,7 @@ $HiddenField => undef </%args> <& /Elements/Header, Title => $title &> -<& /User/Elements/Tabs, - current_tab => 'Prefs/Calendar.html', - Title => $title -&> +<& /Elements/Tabs &> <&| /Widgets/TitleBox, title => loc('ICal Feeds (ics)') &> @@ -50,7 +47,7 @@ Builder")%></a>.</p> <& /Prefs/Elements/CalendarFeed &> -% # only allow this part if +% # only allow this part if % if ($AllowSearch) { % my $search_count; @@ -95,7 +92,7 @@ href="<%$RT::WebPath . '/Search/Build.html'%>">the Query Builder</a> </&> <%INIT> -use Digest::SHA1; +use Digest::SHA 'sha1_base64'; use RT::SavedSearches; my $title = loc("Calendar Prefs"); @@ -107,14 +104,14 @@ $AllowSearch = 1 my $object; -if ($HiddenField eq 'Private') { +if ($HiddenField && $HiddenField eq 'Private') { $object = $session{CurrentUser}->UserObj; -} elsif ($AllowSearch and my ($SearchId) = $HiddenField =~ m/SavedSearch\-(\d+)/) { +} elsif ($AllowSearch and $HiddenField and my ($SearchId) = $HiddenField =~ m/SavedSearch\-(\d+)/) { $object = $session{CurrentUser}->Attributes->WithId($SearchId); } if (defined $ChangeURL) { - my @args = $object->SetAttribute(Name => 'ICalURL', Content => Digest::SHA1::sha1_base64(time)); + my @args = $object->SetAttribute(Name => 'ICalURL', Content => sha1_base64(time)); } elsif (defined $ResetURL) { my @args = $object->DeleteAttribute('ICalURL'); } 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..b5d3edd95 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,16 +46,14 @@ %# %# 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 ) ) { +% next if $option eq 'EmailFrequency' && !RT->Config->Get('RecordOutgoingEmail'); % my $meta = RT->Config->Meta( $option ); <& $meta->{'Widget'}, Default => 1, @@ -84,9 +82,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..42aa16bbf 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')) { @@ -99,7 +95,7 @@ $ARGS{'OrderBy'} = join '|', grep defined && /\S/, (ref $ARGS{'OrderBy'})? @{$AR my ( $AvailableColumns, $CurrentFormat ); ( $ARGS{Format}, $AvailableColumns, $CurrentFormat ) = $m->comp( '/Search/Elements/BuildFormatString', - cfqueues => {}, %ARGS + %ARGS ); if ($ARGS{'Save'}) { 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") || {}; |