[Rt-commit] rt branch, 4.4/add-select-owner-callbacks, created. rt-4.4.0-22-g83aedd6

Jim Brandt jbrandt at bestpractical.com
Tue Feb 9 09:30:55 EST 2016


The branch, 4.4/add-select-owner-callbacks has been created
        at  83aedd66febe2d1625e6c4becc80ffcdf6874dc2 (commit)

- Log -----------------------------------------------------------------
commit 83aedd66febe2d1625e6c4becc80ffcdf6874dc2
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Tue Feb 9 09:29:11 2016 -0500

    Add callbacks to modify the owner dropdown
    
    Add callbacks to modify the owner dropdown and the
    equivalent autocomplete helper to make it easy to change
    the owner selection beyond what can be done with permissions.

diff --git a/share/html/Elements/SelectOwnerDropdown b/share/html/Elements/SelectOwnerDropdown
index 60e9cde..582550d 100644
--- a/share/html/Elements/SelectOwnerDropdown
+++ b/share/html/Elements/SelectOwnerDropdown
@@ -91,6 +91,9 @@ if (keys(%user_uniq_hash) > $dropdown_limit ) {
     return;
 }
 
+$m->callback( CallbackName => 'ModifyOwnerListRaw', ARGSRef => \%ARGS,
+    UserHashRef => \%user_uniq_hash, DefaultRef => \$Default, Objects => $Objects );
+
 if ($Default && $Default != RT->Nobody->id && !$user_uniq_hash{$Default}) {
     $user_uniq_hash{$Default} = RT::User->new($session{CurrentUser});
     $user_uniq_hash{$Default}->Load($Default);
@@ -107,6 +110,9 @@ $nobody_user->Load( RT->Nobody->id );
 my $nobody = [$nobody_user, $nobody_user->Format];
 unshift @formatednames, $nobody;
 
+$m->callback( CallbackName => 'ModifyOwnerListSorted', ARGSRef => \%ARGS,
+    NamesRef => \@formatednames, DefaultRef => \$Default, Objects => $Objects );
+
 </%INIT>
 
 <%ARGS>
diff --git a/share/html/Helpers/Autocomplete/Owners b/share/html/Helpers/Autocomplete/Owners
index 123ba6b..0562fc0 100644
--- a/share/html/Helpers/Autocomplete/Owners
+++ b/share/html/Helpers/Autocomplete/Owners
@@ -97,6 +97,9 @@ foreach my $spec (map { [split /\-/, $_, 2] } split /\|/, $limit) {
         Return => $return,
     );
 
+    $m->callback( CallbackName => 'ModifyOwnerAutocompleteSearch',
+        ARGSRef => \%ARGS, Users => \$Users );
+
     $Users->WhoHaveRight(
         Right               => 'OwnTicket',
         Object              => $object,

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


More information about the rt-commit mailing list