[Rt-commit] rt branch, 4.0/AutocompleteOwnersForSearch-option, created. rt-4.0.4-42-ga6d6e5e

Ruslan Zakirov ruz at bestpractical.com
Fri Nov 18 15:29:55 EST 2011


The branch, 4.0/AutocompleteOwnersForSearch-option has been created
        at  a6d6e5eaa2d7a2b33603e74d114728449aaec34a (commit)

- Log -----------------------------------------------------------------
commit a6d6e5eaa2d7a2b33603e74d114728449aaec34a
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date:   Fri Nov 18 21:31:52 2011 +0400

    new option AutocompleteOwnersForSearch
    
    In some installations owners drop down in the query builder
    gets really big and SQL gets slow. This option allows admin
    to activate autocompletion in the query builder. Users
    can not change this option.

diff --git a/etc/RT_Config.pm.in b/etc/RT_Config.pm.in
index d3855a1..9d56ab6 100755
--- a/etc/RT_Config.pm.in
+++ b/etc/RT_Config.pm.in
@@ -1312,6 +1312,16 @@ users have the OwnTicket right.
 
 Set($AutocompleteOwners, 0);
 
+=item C<$AutocompleteOwnersForSearch>
+
+If set to 1, the owner drop-downs for the query builder are always
+replaced by text field that autocomplete and C<$AutocompleteOwners>
+is ignored. Helpful when owners list is huge in the query builder.
+
+=cut
+
+Set($AutocompleteOwnersForSearch, 0);
+
 =item C<$UserAutocompleteFields>
 
 Specifies which fields of L<RT::User> to match against and how to
diff --git a/share/html/Elements/SelectOwner b/share/html/Elements/SelectOwner
index ef10cd1..8827b17 100755
--- a/share/html/Elements/SelectOwner
+++ b/share/html/Elements/SelectOwner
@@ -47,7 +47,11 @@
 %# END BPS TAGGED BLOCK }}}
 <& "SelectOwner$Widget", %ARGS, Objects => \@objects &>
 <%INIT>
-my $Widget = RT->Config->Get('AutocompleteOwners', $session{'CurrentUser'})
+my $Widget;
+if ( !$QueueObj && !$TicketObj && RT->Config->Get('AutocompleteOwnersForSearch') ) {
+    $Widget = 'Autocomplete';
+}
+$Widget ||= RT->Config->Get('AutocompleteOwners', $session{'CurrentUser'})
                 ? 'Autocomplete' : 'Dropdown';
 
 my @objects;

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


More information about the Rt-commit mailing list