[Rt-commit] rt branch, master, updated. rt-4.2.11-130-g4b9dd1c
Shawn Moore
shawn at bestpractical.com
Thu Jul 16 12:28:39 EDT 2015
The branch, master has been updated
via 4b9dd1cda066c400a2e5038fe462dd0e8a264095 (commit)
via fed8f207f54a3634d0872ec56e494a85d79359b8 (commit)
from 0dcf634254a65c1c250fc0fd98140abe86e30199 (commit)
Summary of changes:
docs/UPGRADING-4.4 | 6 ++
docs/writing_portlets.pod | 2 +-
etc/RT_Config.pm.in | 2 +-
etc/initialdata | 2 +-
etc/upgrade/4.3.5/content | 73 ++++++++++++++++++++++
share/html/Elements/{Quicksearch => QueueList} | 8 +--
share/html/Elements/Quicksearch | 23 ++-----
share/html/Elements/Tabs | 2 +-
.../Prefs/{Quicksearch.html => QueueList.html} | 8 +--
t/web/custom_search.t | 10 +--
10 files changed, 102 insertions(+), 34 deletions(-)
create mode 100644 etc/upgrade/4.3.5/content
copy share/html/Elements/{Quicksearch => QueueList} (92%)
rename share/html/Prefs/{Quicksearch.html => QueueList.html} (93%)
- Log -----------------------------------------------------------------
commit fed8f207f54a3634d0872ec56e494a85d79359b8
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Oct 21 01:56:36 2014 +0800
rename Quicksearch to QueueList
it's a queue list, not a search
Fixes: #18514
diff --git a/docs/UPGRADING-4.4 b/docs/UPGRADING-4.4
index bf96bec..78c2f85 100644
--- a/docs/UPGRADING-4.4
+++ b/docs/UPGRADING-4.4
@@ -31,6 +31,12 @@ reporting.
Custom fields with categories will be split out into hierarchical custom
fields.
+=item *
+
+Homepage component "Quicksearch" has been renamed to "QueueList" to reflect
+what it actually is. Please update C<$HomepageComponents> accordingly if you
+customized it in site config.
+
=back
=cut
diff --git a/docs/writing_portlets.pod b/docs/writing_portlets.pod
index 0530fd8..434b71e 100644
--- a/docs/writing_portlets.pod
+++ b/docs/writing_portlets.pod
@@ -3,7 +3,7 @@
A "portlet" is a component used to extend your RT instance, specifically
the "RT-at-a-glance" home and Self-Service pages. For instance, the
"n Highest Priority Tickets I own", "Quick Ticket Creation" and
-"Quick Search" panels on the default homepage are portlets.
+"Queue List" panels on the default homepage are portlets.
=head1 Creating the Portlet
diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index f14dc1b..59f4a13 100644
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1229,7 +1229,7 @@ user's customized homepage ("RT at a glance").
Set(
$HomepageComponents,
[
- qw(QuickCreate Quicksearch MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards SavedSearches FindUser) # loc_qw
+ qw(QuickCreate QueueList MyAdminQueues MySupportQueues MyReminders RefreshHomepage Dashboards SavedSearches FindUser) # loc_qw
]
);
diff --git a/etc/initialdata b/etc/initialdata
index dd1daf5..5df770b 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -872,7 +872,7 @@ Hour: { $SubscriptionObj->SubValue('Hour') }
},
{
type => 'component',
- name => 'Quicksearch' # loc
+ name => 'QueueList' # loc
},
{
type => 'component',
diff --git a/etc/upgrade/4.3.5/content b/etc/upgrade/4.3.5/content
new file mode 100644
index 0000000..ccfd535
--- /dev/null
+++ b/etc/upgrade/4.3.5/content
@@ -0,0 +1,73 @@
+use strict;
+use warnings;
+our @Final = (
+ sub {
+ my $attrs = RT::Attributes->new(RT->SystemUser);
+ $attrs->Limit( FIELD => 'Name', VALUE => 'HomepageSettings' );
+ $attrs->Limit( FIELD => 'Name', VALUE => 'Pref-HomepageSettings' );
+ while ( my $attr = $attrs->Next ) {
+ my $content = $attr->Content;
+ my $changed;
+ for my $pane ( qw/body sidebar/ ) {
+ my @new;
+ for my $value ( @{$content->{$pane}} ) {
+ if ( $value->{name} eq 'Quicksearch' && $value->{type} eq 'component' ) {
+ push @new, { %$value, name => 'QueueList' };
+ $changed = 1;
+ }
+ else {
+ push @new, $value;
+ }
+ }
+ $content->{$pane} = \@new;
+ }
+ if ( $changed ) {
+ my ( $ret, $msg ) = $attr->SetContent($content);
+ unless ( $ret ) {
+ RT->Logger->error( "Failed to update content of attribute #" . $attr->id . ": $msg");
+ }
+ }
+ }
+
+ $attrs = RT::Attributes->new(RT->SystemUser);
+ $attrs->Limit( FIELD => 'Name', VALUE => 'Dashboard' );
+ while ( my $attr = $attrs->Next ) {
+ my $content = $attr->Content;
+ my $changed;
+ for my $pane ( qw/body sidebar/ ) {
+ my @new;
+ for my $value ( @{$content->{Panes}{$pane}} ) {
+ if ( $value->{component} eq 'Quicksearch' ) {
+ push @new,
+ {
+ %$value,
+ component => 'QueueList',
+ description => 'QueueList',
+ path => '/Elements/QueueList',
+ };
+ $changed = 1;
+ }
+ else {
+ push @new, $value;
+ }
+ }
+ $content->{Panes}{$pane} = \@new;
+ }
+ if ( $changed ) {
+ my ( $ret, $msg ) = $attr->SetContent($content);
+ unless ( $ret ) {
+ RT->Logger->error( "Failed to update content of attribute #" . $attr->id . ": $msg");
+ }
+ }
+ }
+
+ $attrs = RT::Attributes->new(RT->SystemUser);
+ $attrs->Limit( FIELD => 'Name', VALUE => 'Pref-QuickSearch' );
+ while ( my $attr = $attrs->Next ) {
+ my ( $ret, $msg ) = $attr->SetName('Pref-QueueList');
+ unless ( $ret ) {
+ RT->Logger->error( "Failed to update name of attribute #" . $attr->id . ": $msg");
+ }
+ }
+ },
+);
diff --git a/share/html/Elements/Quicksearch b/share/html/Elements/QueueList
similarity index 92%
copy from share/html/Elements/Quicksearch
copy to share/html/Elements/QueueList
index 3d832e4..dfbeba7 100644
--- a/share/html/Elements/Quicksearch
+++ b/share/html/Elements/QueueList
@@ -2,7 +2,7 @@
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
%# <sales at bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
@@ -47,10 +47,10 @@
%# END BPS TAGGED BLOCK }}}
<div class="ticket-overview">
<&|/Widgets/TitleBox,
- title => loc("Quick search"),
+ title => loc("Queue list"),
bodyclass => "",
titleright => loc("Edit"),
- titleright_href => RT->Config->Get('WebPath').'/Prefs/Quicksearch.html',
+ titleright_href => RT->Config->Get('WebPath').'/Prefs/QueueList.html',
&>
<& $comp,
queue_filter => sub { $_->CurrentUserHasRight('ShowTicket') && !exists $unwanted->{$_->Name} },
@@ -58,7 +58,7 @@
</&>
</div>
<%INIT>
-my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QuickSearch', {});
+my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QueueList', {});
my $comp = $SplitByLifecycle? '/Elements/QueueSummaryByLifecycle' : '/Elements/QueueSummaryByStatus';
</%INIT>
<%ARGS>
diff --git a/share/html/Elements/Quicksearch b/share/html/Elements/Quicksearch
index 3d832e4..c068b63 100644
--- a/share/html/Elements/Quicksearch
+++ b/share/html/Elements/Quicksearch
@@ -45,22 +45,11 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<div class="ticket-overview">
-<&|/Widgets/TitleBox,
- title => loc("Quick search"),
- bodyclass => "",
- titleright => loc("Edit"),
- titleright_href => RT->Config->Get('WebPath').'/Prefs/Quicksearch.html',
-&>
-<& $comp,
- queue_filter => sub { $_->CurrentUserHasRight('ShowTicket') && !exists $unwanted->{$_->Name} },
-&>
-</&>
-</div>
+<& QueueList, %ARGS &>
+
<%INIT>
-my $unwanted = $session{'CurrentUser'}->UserObj->Preferences('QuickSearch', {});
-my $comp = $SplitByLifecycle? '/Elements/QueueSummaryByLifecycle' : '/Elements/QueueSummaryByStatus';
+RT->Deprecated(
+ Remove => '4.6',
+ Instead => 'QueueList',
+);
</%INIT>
-<%ARGS>
-$SplitByLifecycle => 1
-</%ARGS>
diff --git a/share/html/Elements/Tabs b/share/html/Elements/Tabs
index b481b31..a9b5531 100644
--- a/share/html/Elements/Tabs
+++ b/share/html/Elements/Tabs
@@ -585,7 +585,7 @@ my $build_main_nav = sub {
title => loc('Dashboards in menu'),
path => '/Prefs/DashboardsInMenu.html',
);
- $settings->child( quicksearch => title => loc('Quick search'), path => '/Prefs/Quicksearch.html' );
+ $settings->child( queue_list => title => loc('Queue list'), path => '/Prefs/QueueList.html' );
my $search_menu = $settings->child( 'saved-searches' => title => loc('Saved Searches') );
my $searches = [ $m->comp( "/Search/Elements/SearchesForObject",
diff --git a/share/html/Prefs/Quicksearch.html b/share/html/Prefs/QueueList.html
similarity index 93%
rename from share/html/Prefs/Quicksearch.html
rename to share/html/Prefs/QueueList.html
index 0d3e58b..5b544b3 100644
--- a/share/html/Prefs/Quicksearch.html
+++ b/share/html/Prefs/QueueList.html
@@ -50,7 +50,7 @@
&>
<& /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">
+<form method="post" action="QueueList.html" name="Preferences">
<ul>
% for my $queue (@queues) {
<li><input type="checkbox" class="checkbox" id="Want-<%$queue->Name%>" name="Want-<%$queue->Name%>" value="1"
@@ -76,9 +76,9 @@ checked="checked"
<%INIT>
my @actions;
-my $title = loc("Customize").' '.loc("Quick search");
+my $title = loc("Customize").' '.loc("Queue list");
my $user = $session{'CurrentUser'}->UserObj;
-my $unwanted = $user->Preferences('QuickSearch', {});
+my $unwanted = $user->Preferences('QueueList', {});
my $Queues = RT::Queues->new($session{'CurrentUser'});
$Queues->UnLimit;
@@ -102,7 +102,7 @@ if ($ARGS{'Save'}) {
}
}
- my ($ok, $msg) = $user->SetPreferences('QuickSearch', $unwanted);
+ my ($ok, $msg) = $user->SetPreferences('QueueList', $unwanted);
push @actions, $ok ? loc('Preferences saved.') : $msg;
}
diff --git a/t/web/custom_search.t b/t/web/custom_search.t
index 75f832d..fdbdbac 100644
--- a/t/web/custom_search.t
+++ b/t/web/custom_search.t
@@ -22,7 +22,7 @@ like ($t_link->url, qr/$id/, 'link to the ticket we created');
$m->content_lacks ('customsearch at localhost', 'requestor not displayed ');
$m->get ( $url.'Prefs/MyRT.html' );
my $cus_hp = $m->find_link( text => "My Tickets" );
-my $cus_qs = $m->find_link( text => "Quick search" );
+my $cus_qs = $m->find_link( text => "Queue list" );
$m->get ($cus_hp);
$m->content_contains('highest priority tickets');
@@ -58,11 +58,11 @@ $m->get( $url );
$m->content_lacks ('customsearch at localhost', 'requestor not displayed ');
-# try to disable General from quick search
+# try to disable General from queue list
# Note that there's a small problem in the current implementation,
# since ticked quese are wanted, we do the invesrsion. So any
-# queue added during the quicksearch setting will be unticked.
+# queue added during the queue list setting will be unticked.
my $nlinks = $#{$m->find_all_links( text => "General" )};
$m->get ($cus_qs);
$m->form_name ('Preferences');
@@ -71,7 +71,7 @@ $m->click_button (name => 'Save');
$m->get( $url );
is ($#{$m->find_all_links( text => "General" )}, $nlinks - 1,
- 'General gone from quicksearch list');
+ 'General gone from queue list');
# get it back
$m->get ($cus_qs);
@@ -81,4 +81,4 @@ $m->click_button (name => 'Save');
$m->get( $url );
is ($#{$m->find_all_links( text => "General" )}, $nlinks,
- 'General back in quicksearch list');
+ 'General back in queue list');
commit 4b9dd1cda066c400a2e5038fe462dd0e8a264095
Merge: 0dcf634 fed8f20
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Thu Jul 16 12:28:33 2015 -0400
Merge branch '4.4/rename-quick-search-to-queue-list'
-----------------------------------------------------------------------
More information about the rt-commit
mailing list