[Rt-commit] rt branch, 4.0/jumbo-autocomplete, created. rt-4.0.2-39-g459ad08

Jason May jasonmay at bestpractical.com
Thu Sep 1 18:50:08 EDT 2011


The branch, 4.0/jumbo-autocomplete has been created
        at  459ad08b8e718382fb01c666e391aa284037856b (commit)

- Log -----------------------------------------------------------------
commit 459ad08b8e718382fb01c666e391aa284037856b
Author: Jason May <jasonmay at bestpractical.com>
Date:   Thu Sep 1 16:35:27 2011 -0400

    Perform check with the owner's name in ModifyAll for Autocomplete
    
    If AutocompleteOwners is set, this checks the name instead of ID for
    owners, since the dropdown submits the ID value.

diff --git a/share/html/Ticket/ModifyAll.html b/share/html/Ticket/ModifyAll.html
index 9416652..6cb9569 100755
--- a/share/html/Ticket/ModifyAll.html
+++ b/share/html/Ticket/ModifyAll.html
@@ -51,7 +51,7 @@
 % $m->callback(CallbackName => 'BeforeActionList', Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket);
 <& /Elements/ListActions, actions => \@results &>
 
-<form method="post" action="ModifyAll.html" enctype="multipart/form-data">
+<form method="post" action="ModifyAll.html" name="TicketModifyAll" enctype="multipart/form-data">
 % $m->callback( CallbackName => 'FormStart', ARGSRef => \%ARGS );
 <input type="hidden" class="hidden" name="id" value="<%$Ticket->Id%>" />
 
@@ -188,7 +188,12 @@ unless ($OnlySearchForPeople or $OnlySearchForGroup or $ARGS{'AddMoreAttach'} )
         my @owners =@{$ARGS{'Owner'}};
         delete $ARGS{'Owner'};
         foreach my $owner(@owners){
-            $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->id == $owner);
+            if (RT->Config->Get('AutocompleteOwners', $session{'CurrentUser'})) {
+                $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->Name eq $owner);
+            }
+            else {
+                $ARGS{'Owner'} = $owner unless ($Ticket->OwnerObj->id == $owner);
+            }
         }
 
     }
diff --git a/t/web/ticket_modify_all.t b/t/web/ticket_modify_all.t
index a385c0e..c9dd7e7 100644
--- a/t/web/ticket_modify_all.t
+++ b/t/web/ticket_modify_all.t
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 12;
+use RT::Test tests => 15;
 
 my $ticket = RT::Test->create_ticket(
     Subject => 'test bulk update',
@@ -25,5 +25,20 @@ $m->content_lacks("this is update content", 'textarea is clear');
 $m->get_ok($url . '/Ticket/Display.html?id=' . $ticket->id );
 $m->content_contains("this is update content", 'updated content in display page');
 
+# NOTE http://issues.bestpractical.com/Ticket/Display.html?id=18284
+RT::Test->stop_server;
+RT->Config->Set(AutocompleteOwners => 1);
+($url, $m) = RT::Test->started_ok;
+$m->login;
+
+$m->get_ok($url . '/Ticket/ModifyAll.html?id=' . $ticket->id);
+
+$m->form_name('TicketModifyAll');
+$m->field(Owner => 'root');
+$m->click('SubmitTicket');
+
+$m->form_name('TicketModifyAll');
+is($m->value('Owner'), 'root', 'owner was successfully changed to root');
+
 # XXX TODO test other parts, i.e. basic, dates, people and links
 

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


More information about the Rt-commit mailing list