diff options
Diffstat (limited to 'rt/share/html/Prefs')
-rw-r--r-- | rt/share/html/Prefs/Calendar.html | 123 | ||||
-rw-r--r-- | rt/share/html/Prefs/Elements/CalendarFeed | 68 | ||||
-rw-r--r-- | rt/share/html/Prefs/Elements/Tabs | 76 | ||||
-rw-r--r-- | rt/share/html/Prefs/MyRT.html | 157 | ||||
-rw-r--r-- | rt/share/html/Prefs/Other.html | 111 | ||||
-rw-r--r-- | rt/share/html/Prefs/Quicksearch.html | 97 | ||||
-rw-r--r-- | rt/share/html/Prefs/Search.html | 111 | ||||
-rw-r--r-- | rt/share/html/Prefs/SearchOptions.html | 111 |
8 files changed, 0 insertions, 854 deletions
diff --git a/rt/share/html/Prefs/Calendar.html b/rt/share/html/Prefs/Calendar.html deleted file mode 100644 index 5fbdd27..0000000 --- a/rt/share/html/Prefs/Calendar.html +++ /dev/null @@ -1,123 +0,0 @@ -<%args> -$ChangeURL => undef -$ResetURL => undef -$SearchType => 'Ticket' -$HiddenField => undef -</%args> - -<& /Elements/Header, Title => $title &> -<& /User/Elements/Tabs, - current_tab => 'Prefs/Calendar.html', - Title => $title -&> - -<&| /Widgets/TitleBox, title => loc('ICal Feeds (ics)') &> - -<&| /Widgets/TitleBox, title => 'Help' &> - -<h3>displaying reminders :</h3> -<p>If you want to have reminders in a search you need to go in the <a -href="<%$RT::WebPath%>/Search/Edit.html"><%loc("Edit Query")%></a> tab -of the <%loc("query builder")%> and add something like that : - - <pre> - AND ( Type = 'ticket' OR Type = 'reminder' ) -</pre> -</p> - -<h3>displaying other kind of dates :</h3> -<p>By default RTx::Calendar display Due and Starts dates. You can -select other kind of events you want with the <%loc("Display -Columns")%> section in the <a -href="<%$RT::WebPath%>/Search/Build.html"><%loc("Query -Builder")%></a>. The following one will display the two latter and -LastUpdated dates : - -<pre> - '<small>__Due__</small>', - '<small>__Starts__</small>', - '<small>__LastUpdated__</small>' -</pre> -</p> - -<h3>changing the default query :</h3> -<p>You can change the default Query of Calendar.html and MyCalendar -portlet by saving a query with the name <code>calendar</code> in the -<a href="<%$RT::WebPath%>/Search/Build.html"><%loc("Query -Builder")%></a>.</p> - -</&> - -<& /Prefs/Elements/CalendarFeed &> - -% # only allow this part if -% if ($AllowSearch) { - -% my $search_count; - -% # I'm quite sure the loop isn't usefull but... -% my @Objects = $session{CurrentUser}->UserObj; -% for my $object (@Objects) { -% next unless ref($object) eq 'RT::User' && $object->id == $session{'CurrentUser'}->Id; -% my @searches = $object->Attributes->Named('SavedSearch'); -% for my $search (@searches) { -% next if ($search->SubValue('SearchType') -% && $search->SubValue('SearchType') ne $SearchType); -% $search_count++; -<& /Prefs/Elements/CalendarFeed, Object => $object, Search => $search &> - -% } -% } -% unless ($search_count) { - -<&| /Widgets/TitleBox, title => loc('Private Search ICal feeds') - , title_class=> 'inverse' - , color => "#993333" &> - -You can add private ICal feeds by saving new queries in <a -href="<%$RT::WebPath . '/Search/Build.html'%>">the Query Builder</a> - -</&> - -% } -% } else { -%#<&| /Widgets/TitleBox, title => loc('Private Search ICal feeds') -%# , title_class=> 'inverse' -%# , color => "#993333" &> -%# -%#<%loc('Private search ICal feeds disabled. To enable them, ask your admin for "[_1]" and "[_2]" rights', -%# loc('CreateSavedSearch'), -%# loc('LoadSavedSearch') )%> -%# -%#</&> -% } - -</&> - -<%INIT> -use Digest::SHA1; -use RT::SavedSearches; - -my $title = loc("Calendar Prefs"); -my $AllowSearch; - -$AllowSearch = 1 - if $session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch', - Object=> $RT::System ); - -my $object; - -if ($HiddenField eq 'Private') { - $object = $session{CurrentUser}->UserObj; -} elsif ($AllowSearch 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)); -} elsif (defined $ResetURL) { - my @args = $object->DeleteAttribute('ICalURL'); -} - - -</%INIT> diff --git a/rt/share/html/Prefs/Elements/CalendarFeed b/rt/share/html/Prefs/Elements/CalendarFeed deleted file mode 100644 index 4689343..0000000 --- a/rt/share/html/Prefs/Elements/CalendarFeed +++ /dev/null @@ -1,68 +0,0 @@ -<%args> -$Search => undef -$Object => undef -$HiddenField => undef -</%args> - -<&| /Widgets/TitleBox, title => $title &> - -% if ($FeedText) { -<p><%$FeedText%></p> -% } else { -This feed will show tickets with due date find with query:<br /> -"<%$Search->SubValue('Query')%>". -% } - -% if ($ICalURL) { -<p>Your can paste this url in your calendar : <b><a href="<%$link%>"><%$link%></a></b><p> -<table> -<tr> -<td> -<form action="<%$RT::WebPath%>/Prefs/Calendar.html" method="post"> -<input type="hidden" name="HiddenField" value="<%$HiddenField%>" /> -<input type="submit" class="button" name="ResetURL" value="<%loc('Disable Feed')%>" /> -</form> -</td> -<td> -<form action="<%$RT::WebPath%>/Prefs/Calendar.html" method="post"> -<input type="hidden" name="HiddenField" value="<%$HiddenField%>" /> -<input type="submit" class="button" name="ChangeURL" value="<%loc('Change Feed URL')%>" /> -</form> -</td> -</tr> -</table> -% } else { - -<form action="<%$RT::WebPath%>/Prefs/Calendar.html" method="post"> -<input type="hidden" name="HiddenField" value="<%$HiddenField%>" /> -<input type="submit" class="button" name="ChangeURL" value="<%loc('Enable Feed')%>" /> -</form> -% } - -</&> - -<%init> -my $title; -my $ICalURL; -my $Id; -my $FeedText; -my $link; - -if ($Object) { - $title = loc('Feed for "') . ($Search->Description || loc('Unnamed search')) . '" search'; - $HiddenField = "SavedSearch-" . $Search->Id; - $ICalURL = $Search->FirstAttribute('ICalURL'); - $Id = $session{CurrentUser}->Id . "@" . $Search->Id; - $title .= " (disabled)" unless $ICalURL; -} else { - $title = loc('Feed for default calendar'); - $HiddenField = "Private"; - $ICalURL = $session{CurrentUser}->UserObj->FirstAttribute('ICalURL'); - $Id = $session{CurrentUser}->Id; - $FeedText = "This feed will show yours and Nobody's tasks with due date."; -} - -$link = $RT::WebURL . "NoAuth/Calendar/" . $Id . "/" . $ICalURL->Content - if $ICalURL; - -</%init>
\ No newline at end of file diff --git a/rt/share/html/Prefs/Elements/Tabs b/rt/share/html/Prefs/Elements/Tabs deleted file mode 100644 index 3a63b73..0000000 --- a/rt/share/html/Prefs/Elements/Tabs +++ /dev/null @@ -1,76 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC -%# <jesse@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 deleted file mode 100644 index c91e0f7..0000000 --- a/rt/share/html/Prefs/MyRT.html +++ /dev/null @@ -1,157 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC -%# <jesse@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 }}} -<& /Elements/Header, Title => $title &> -<& /Prefs/Elements/Tabs, - current_tab => 'Prefs/MyRT.html', - Title => $title, - Searches => \@sys_searches -&> -<& /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 /> - -% for my $pane ( @panes ) { -<&|/Widgets/TitleBox, - title => loc('RT at a glance') .': '. loc( $pane->{Name} ), - bodyclass => "" -&> -<& /Widgets/SelectionBox:show, self => $pane, nojs => 1 &> -</&> -% } - -<&|/Widgets/TitleBox, title => loc('Options'), bodyclass => "" &> -<form method="post" action="MyRT.html"> -<&|/l&>Rows per box</&>: -<input name="SummaryRows" value="<% $ARGS{SummaryRows} %>" /> -<input type="submit" class="button" name="UpdateSummaryRows" value="<% loc('Save') %>" /> -</form> -</&> - -<%INIT> -my @results; -my $title = loc("Customize").' '.loc("RT at a glance"); -my $user = $session{'CurrentUser'}->UserObj; - -if ( $ARGS{'UpdateSummaryRows'} ) { - unless ( $ARGS{SummaryRows} && int $ARGS{SummaryRows} > 0 ) { - push @results, loc ("Illegal '[_1]' preference value.", loc('summary rows')); - $ARGS{SummaryRows} = 0; - } - else { - my ($ok, $msg) = $user->SetPreferences( 'SummaryRows', int $ARGS{SummaryRows} ); - push @results, $ok ? loc('Preferences saved for [_1].', loc('summary rows')) : $msg; - } -} -$ARGS{'SummaryRows'} ||= $user->Preferences('SummaryRows', RT->Config->Get('DefaultSummaryRows')); - -if ($ARGS{Reset}) { - my ($ok, $msg) = $user->SetPreferences('HomepageSettings', {}); - push @results, $ok ? loc('Preferences saved.') : $msg; - delete $session{'my_rt_portlets'}; -} - -unless (exists $session{'my_rt_portlets'}) { - my ($default_portlets) = RT::System->new($session{'CurrentUser'})->Attributes->Named('HomepageSettings'); - my $portlets = $default_portlets ? $default_portlets->Content : {}; - $session{'my_rt_portlets'} = $user->Preferences('HomepageSettings', $portlets); -} -my $portlets = $session{'my_rt_portlets'}; - -my %seen; -my @items = map ["component-$_", $_], grep !$seen{$_}++, @{RT->Config->Get('HomepageComponents')}; - -my $sys = RT::System->new($session{'CurrentUser'}); -my @objs = ($sys); - -push @objs, RT::SavedSearches->new( $session{CurrentUser} )->_PrivacyObjects - if $session{'CurrentUser'}->HasRight( Right => 'LoadSavedSearch', - Object => $RT::System ); - -my @sys_searches; -for my $object (@objs) { - for ($m->comp("/Search/Elements/SearchesForObject", Object => $object)) { - my ($desc, $search) = @$_; - my $SearchType = $search->Content->{'SearchType'} || 'Ticket'; - if ($object eq $sys && $SearchType eq 'Ticket') { - push @items, ["system-$desc", $desc]; - push @sys_searches, [$desc, $search]; - } - else { - my $oid = ref($object).'-'.$object->Id.'-SavedSearch-'.$search->Id; - my $type = ($SearchType eq 'Ticket') - ? 'Saved Search' : $SearchType; # loc - push @items, ["saved-$oid", loc($type).": $desc"]; - } - } -} - -my @panes = $m->comp( - '/Admin/Elements/ConfigureMyRT', - panes => ['body', 'summary'], - Action => 'MyRT.html', - items => \@items, - current_portlets => $portlets, - OnSave => sub { - my ( $conf, $pane ) = @_; - my ($ok, $msg) = $user->SetPreferences( 'HomepageSettings', $conf ); - push @results, $ok ? loc('Preferences saved for [_1].', $pane) : $msg; - delete $session{'my_rt_portlets'}; - } -); - -$m->comp( '/Widgets/SelectionBox:process', %ARGS, self => $_, nojs => 1 ) - for @panes; - -</%INIT> diff --git a/rt/share/html/Prefs/Other.html b/rt/share/html/Prefs/Other.html deleted file mode 100644 index 9608fb6..0000000 --- a/rt/share/html/Prefs/Other.html +++ /dev/null @@ -1,111 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC -%# <jesse@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 }}} -<& /Elements/Header, Title => $title &> -<& /User/Elements/Tabs, - current_tab => 'Prefs/Other.html', - Title => $title, -&> -<& /Elements/ListActions, actions => \@results &> - -<form method="post" action="Other.html"> -% foreach my $section( RT->Config->Sections ) { -<&|/Widgets/TitleBox, title => loc( $section ) &> -% foreach my $option( RT->Config->Options( Section => $section ) ) { -% my $meta = RT->Config->Meta( $option ); -<& $meta->{'Widget'}, - Default => 1, - %{ $m->comp('/Widgets/FinalizeWidgetArguments', WidgetArguments => - $meta->{'WidgetArguments'} ) }, - Name => $option, - DefaultValue => scalar RT->Config->Get( $option ), - CurrentValue => $preferences->{ $option }, -&> -% } -</&> -% } - -% if ( RT->Config->Get('GnuPG')->{'Enable'} ) { -<&|/Widgets/TitleBox, title => loc( 'Cryptography' ) &> -<&|/l&>Preferred key</&>: <& /Elements/GnuPG/SelectKeyForEncryption, EmailAddress => $UserObj->EmailAddress, Default => $UserObj->PreferredKey &> -</&> -% } - -<& /Elements/Submit, Name => 'Update', Label => loc('Save Changes') &> -</form> -<%INIT> -my @results; -my $title = loc("Settings"); - -my $UserObj = $session{'CurrentUser'}->UserObj; -my $preferences = $UserObj->Preferences( $RT::System ); - -if ((defined $PreferredKey) && $PreferredKey ne $UserObj->FirstAttribute('PreferredKey')) { - my ($code, $msg) = $UserObj->SetAttribute(Name => 'PreferredKey', Content => $PreferredKey); - push @results, loc('Preferred Key: [_1]', loc_fuzzy($msg)); -} - -if ( $Update ) { - $preferences ||= {}; - $m->comp( '/Widgets/BulkProcess', Meta => { - map { $_ => RT->Config->Meta($_) } RT->Config->Options - }, - Store => $preferences, - Types => [RT->Config->Options], Default => 1, Arguments => \%ARGS, - DefaultValue => { map { $_ => RT->Config->Get($_) } - RT->Config->Options - }, ); - - my ($ok, $msg) = $UserObj->SetPreferences( $RT::System, $preferences ); - push @results, $ok ? loc("Preferences saved.") : $msg; -} -</%INIT> -<%ARGS> -$Update => 0, -$User => undef, -$PreferredKey => undef, -</%ARGS> diff --git a/rt/share/html/Prefs/Quicksearch.html b/rt/share/html/Prefs/Quicksearch.html deleted file mode 100644 index fc14577..0000000 --- a/rt/share/html/Prefs/Quicksearch.html +++ /dev/null @@ -1,97 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC -%# <jesse@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 }}} -<& /Elements/Header, Title => $title &> -<& /Prefs/Elements/Tabs, - current_tab => 'Prefs/MyRT.html', - current_subtab => 'Prefs/Quicksearch.html', - Title => $title -&> -<& /Elements/ListActions, actions => \@actions &> -<h1><&|/l&>Select queues to be displayed on the "RT at a glance" page</&></h1> -<form method="post" action="Quicksearch.html" name="Preferences"> -<ul> -% for my $queue (@queues) { -<li><input type="checkbox" class="checkbox" name="Want-<%$queue->Name%>" value="1" -% unless ($unwanted->{$queue->Name}) { -checked="checked" -% } -/><%$queue->Name%>: <%$queue->Description%></li> -% } -</ul> -<& /Elements/Submit, Caption => loc("Save Changes"), Label => loc('Save'), Name => 'Save'&> - -</form> - -<%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'}); -$Queues->UnLimit; -my @queues = grep {$_->CurrentUserHasRight('ShowTicket')} @{$Queues->ItemsArrayRef}; - -if ($ARGS{'Save'}) { - for my $queue (@queues) { - if ($ARGS{"Want-".$queue->Name}) { - delete $unwanted->{$queue->Name}; - } - else { - ++$unwanted->{$queue->Name}; - } - } - - 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 deleted file mode 100644 index c64078b..0000000 --- a/rt/share/html/Prefs/Search.html +++ /dev/null @@ -1,111 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC -%# <jesse@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 }}} -<& /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/ListActions, actions => \@actions &> -% if ($session{'CurrentUser'}->HasRight( Object=> $RT::System, Right => 'SuperUser')) { -<p> - <&|/l&>You can also edit the predefined search itself</&>: - <a href="<% RT->Config->Get('WebPath').'/Search/Build.html?'. - $m->comp('/Elements/QueryString', - SavedSearchLoad => 'RT::System-1-SavedSearch-'.$id) %>"><% $search->Name %></a> -</p> -% } - -<form method="post" action="Search.html" name="BuildQuery"> -<input type="hidden" name="name" value="<%$ARGS{name}%>" class="hidden" /> -<input type="hidden" name="Format" value="<%$ARGS{Format}%>" class="hidden" /> - -<& /Search/Elements/DisplayOptions, %$SearchArg, %ARGS, - AvailableColumns => $AvailableColumns, CurrentFormat => $CurrentFormat &> -<& /Elements/Submit, Caption => loc("Save Changes"), Label => loc('Save'), Name => 'Save'&> - -</form> - -<%INIT> -my @actions; -my $title = loc("Customize").' '; - -my @fields = qw(Format Order OrderBy RowsPerPage); -$ARGS{name} ||= ''; -my ($class, $id) = ( $ARGS{name} =~ m/^(.*)-(\d+)$/ ); - -Abort('No search specified') - unless defined $class and $class eq 'RT::Attribute'; - -my $search = $class->new ($session{'CurrentUser'}); -$search->LoadById ($id); -$title .= loc ($search->Description, loc ('"N"')); -my $user = $session{'CurrentUser'}->UserObj; -my $SearchArg = $user->Preferences($search, $search->Content); -$ARGS{Order} = (ref $ARGS{Order} ? join('|',grep {/\S/} @{$ARGS{Order}}) : $ARGS{Order}); -$ARGS{OrderBy} = (ref $ARGS{OrderBy} ? join('|',grep {/\S/} @{$ARGS{OrderBy}}) : $ARGS{OrderBy}); -for (@fields) { - $ARGS{$_} = $SearchArg->{$_} unless defined $ARGS{$_}; -} -$ARGS{'Order'} = join '|', grep defined && /\S/, (ref $ARGS{'Order'})? @{$ARGS{'Order'}}: $ARGS{'Order'}; -$ARGS{'OrderBy'} = join '|', grep defined && /\S/, (ref $ARGS{'OrderBy'})? @{$ARGS{'OrderBy'}}: $ARGS{'OrderBy'}; - -my ( $AvailableColumns, $CurrentFormat ); -( $ARGS{Format}, $AvailableColumns, $CurrentFormat ) = $m->comp( - '/Search/Elements/BuildFormatString', - cfqueues => {}, %ARGS -); - -if ($ARGS{'Save'}) { - my $hash = {map { $_ => $ARGS{$_}} @fields}; - my ($ok, $msg) = $user->SetPreferences($search, $hash); - push @actions, $ok ? loc('Preferences saved.') : $msg; -} - -</%INIT> diff --git a/rt/share/html/Prefs/SearchOptions.html b/rt/share/html/Prefs/SearchOptions.html deleted file mode 100644 index 5e5ed46..0000000 --- a/rt/share/html/Prefs/SearchOptions.html +++ /dev/null @@ -1,111 +0,0 @@ -%# BEGIN BPS TAGGED BLOCK {{{ -%# -%# COPYRIGHT: -%# -%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC -%# <jesse@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 }}} -<& /Elements/Header, Title => loc("Ticketing Search Preferences") &> -<& /User/Elements/Tabs, - current_tab => "Prefs/SearchOptions.html", - Title => loc("Search Preferences") -&> -<& /Elements/ListActions, actions => \@actions &> - -<form method="post" action="SearchOptions.html"> -<input type="hidden" class="hidden" name="Format" value="<%$Format%>" /> - <& /Search/Elements/DisplayOptions, %ARGS, - Format=> $Format, - AvailableColumns => $AvailableColumns, - CurrentFormat => $CurrentFormat, - RowsPerPage => $RowsPerPage, - OrderBy => $OrderBy, - Order => $Order &> - -<& /Elements/Submit, Name => 'SavePreferences', Label => loc('Save Changes') &> -</form> -<%INIT> -my @actions; - -# {{{ 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; - -$Order = (ref $Order ? join('|',grep {/\S/} @{$Order}) : $Order); -$OrderBy = (ref $OrderBy ? join('|',grep {/\S/} @{$OrderBy}) : $OrderBy); -if ($ARGS{'SavePreferences'}) { - my ($ok, $msg) = $session{'CurrentUser'}->UserObj->SetPreferences("SearchDisplay", - { - Format => $Format, - Order => $Order, - OrderBy => $OrderBy, - RowsPerPage => $RowsPerPage, - }); - push @actions, $ok ? loc("Preferences saved.") : $msg; -} - -# }}} - -# Read from user preferences -my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {}; - -$Format ||= $prefs->{'Format'}; -$Order ||= ($prefs->{'Order'} || 'ASC'); -$OrderBy ||= ($prefs->{'OrderBy'} || 'id'); -($RowsPerPage = defined( $prefs->{'RowsPerPage'} ) ? $prefs->{'RowsPerPage'} : 50) unless defined ($RowsPerPage); - -my ( $AvailableColumns, $CurrentFormat ); -( $Format, $AvailableColumns, $CurrentFormat ) = $m->comp( - '/Search/Elements/BuildFormatString', - %ARGS, Format => $Format -); -</%INIT> - -<%ARGS> -$Format => undef -$Description => undef -$Order => undef -$OrderBy => undef -$RowsPerPage => undef -</%ARGS> - |