[Rt-commit] rt branch, 4.4/rename-quick-search-to-queue-list, created. rt-4.2.5-214-g6b54f60

? sunnavy sunnavy at bestpractical.com
Thu Jul 2 10:38:09 EDT 2015


The branch, 4.4/rename-quick-search-to-queue-list has been created
        at  6b54f603a5135d1372439e2ed67bc228092de59f (commit)

- Log -----------------------------------------------------------------
commit 6b54f603a5135d1372439e2ed67bc228092de59f
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 5d75727..3963914 100644
--- a/docs/UPGRADING-4.4
+++ b/docs/UPGRADING-4.4
@@ -26,6 +26,12 @@ When creating linked tickets from the Links box, Time Worked, Time
 Estimated, and Time Left will no longer be copied.  This simplifies time
 reporting.
 
+=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/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index dbcd8e3..8b6548a 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1223,7 +1223,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 95%
copy from share/html/Elements/Quicksearch
copy to share/html/Elements/QueueList
index 1639733..dfbeba7 100644
--- a/share/html/Elements/Quicksearch
+++ b/share/html/Elements/QueueList
@@ -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 1639733..94552df 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 b2ff96d..c4d7c24 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 23dae9f..2a2448c 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..c4b3385 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,7 +58,7 @@ $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

-----------------------------------------------------------------------


More information about the rt-commit mailing list