[Rt-commit] rt branch, 4.2/owner-autocomplete-switch-callback, created. rt-4.2.2-4-g01ff3d1

Kevin Falcone falcone at bestpractical.com
Wed Jan 22 11:16:27 EST 2014


The branch, 4.2/owner-autocomplete-switch-callback has been created
        at  01ff3d16d30a6d44806fb7f9c8be68b471a0a49d (commit)

- Log -----------------------------------------------------------------
commit 01ff3d16d30a6d44806fb7f9c8be68b471a0a49d
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Tue Jan 21 19:11:50 2014 -0500

    Allow overriding of the 50 user limit in owner dropdowns.
    
    As a performance enhancement for sites with misconfigured or
    intentionally large and complicated owner lists, we automatically punt
    from Dropdown to Autocomplete if we find more than 50 possible owners.
    
    This allows you to write a trivial callback to customize the limit.

diff --git a/share/html/Elements/SelectOwnerDropdown b/share/html/Elements/SelectOwnerDropdown
index 27f1f4f..977133a 100644
--- a/share/html/Elements/SelectOwnerDropdown
+++ b/share/html/Elements/SelectOwnerDropdown
@@ -79,9 +79,12 @@ foreach my $object (@$Objects) {
     }
 }
 
-if (keys(%user_uniq_hash) > 50 ) {
+my $dropdown_limit = 50;
+$m->callback( CallbackName => 'ModifyDropdownLimit', DropdownLimit => \$dropdown_limit );
+
+if (keys(%user_uniq_hash) > $dropdown_limit ) {
     my $desc = $Objects->[0]->RecordType." ".$Objects->[0]->id;
-    RT->Logger->notice("More than 50 possible Owners found for $desc; switching to autocompleter");
+    RT->Logger->notice("More than $dropdown_limit possible Owners found for $desc; switching to autocompleter");
     $m->comp("/Elements/SelectOwnerAutocomplete", %ARGS);
     return;
 }

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


More information about the rt-commit mailing list