[Rt-commit] rt branch, setowner-refactor, created. rt-3.9.4-467-g96b9a41

? sunnavy sunnavy at bestpractical.com
Mon Nov 15 23:59:38 EST 2010


The branch, setowner-refactor has been created
        at  96b9a419f51a2fb913b5e012323658d3cb13dfe7 (commit)

- Log -----------------------------------------------------------------
commit a683d03d36cf3e13df50aa7107c68995ff1d297a
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Fri Nov 12 17:00:27 2010 +0800

    add no_redirect_results to not redirect even we have some results

diff --git a/share/html/Admin/Queues/Modify.html b/share/html/Admin/Queues/Modify.html
index bad71b4..94a1310 100755
--- a/share/html/Admin/Queues/Modify.html
+++ b/share/html/Admin/Queues/Modify.html
@@ -137,7 +137,7 @@
 
 
 <%INIT>
-my ($title, @results, $Disabled, $EnabledChecked);
+my ($title, @results, @no_redirect_results, $Disabled, $EnabledChecked);
 my $QueueObj = RT::Queue->new( $session{'CurrentUser'} );
 $QueueObj->Load( $id ) if !$id || $id eq 'new';
 
@@ -197,7 +197,7 @@ if ( $QueueObj->Id ) {
         foreach my $address ( $QueueObj->CorrespondAddress, $QueueObj->CommentAddress ) {
             next unless defined $address && length $address;
             next if RT::EmailParser->IsRTAddress( $address );
-            push @results, loc("RTAddressRegexp option in the config doesn't match [_1]", $address );
+            push @no_redirect_results, loc("RTAddressRegexp option in the config doesn't match [_1]", $address );
         }
     }
 }
@@ -210,6 +210,8 @@ $m->comp(
     id          => $QueueObj->Id,
     ARGSRef     => \%ARGS
 );
+
+push @results, @no_redirect_results;
 </%INIT>
 
 

commit 056022aac0bf6606442c095fe72a3f77fd8ae5a5
Author: Matt Zagrabelny <mzagrabe at d.umn.edu>
Date:   Fri Nov 12 13:09:43 2010 -0500

    Add a callback after the requestor textbox in Ticket/Create

diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 128fcb6..a6fc369 100755
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -117,6 +117,7 @@
 </td>
 <td class="value" colspan="5">
 <& /Elements/EmailInput, Name => 'Requestors', Size => undef, Default => $ARGS{Requestors} || $session{CurrentUser}->EmailAddress &>
+% $m->callback( CallbackName => 'AfterRequestors', QueueObj => $QueueObj, ARGSRef => \%ARGS );
 </td>
 </tr>
 <tr>

commit d74c985b5e328cb88c3efca499f093d659239c23
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Nov 12 14:58:16 2010 -0500

    Remove some patch droppings from an ancient merge

diff --git a/share/html/SelfService/Display.html b/share/html/SelfService/Display.html
index 1ec1ea8..ef348a2 100755
--- a/share/html/SelfService/Display.html
+++ b/share/html/SelfService/Display.html
@@ -73,7 +73,6 @@
 
 
 
-%#!!pape: selfservice_find_attachments.patch {{
 <& /Ticket/Elements/ShowHistory, 
       Ticket => $Ticket, 
       URIFile => "Display.html", 
@@ -83,7 +82,6 @@
       Attachments => $attachments, 
       UpdatePath => "Update.html" 
 &>
-%#!!pape: selfservice_find_attachments.patch }}
 
 
 

commit 45d8319c4c0d0616c4ca5b3c117faaaf8e51823d
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Nov 12 17:50:22 2010 -0500

    Remove trailing whitespace in a loc
    
        "strings should not begin or end with white spaces."
        - http://wiki.bestpractical.com/view/TranslationRosetta

diff --git a/sbin/rt-email-digest.in b/sbin/rt-email-digest.in
index f1aa34e..94ed62f 100644
--- a/sbin/rt-email-digest.in
+++ b/sbin/rt-email-digest.in
@@ -85,7 +85,7 @@ RT::Init();
 
 sub usage {
     my ($error) = @_;
-    print loc("Usage: ") . "$0 -m (daily|weekly) [--print] [--help]\n";
+    print loc("Usage:") . " $0 -m (daily|weekly) [--print] [--help]\n";
     print loc(
         "[_1] is a utility, meant to be run from cron, that dispatches all deferred RT notifications as a per-user digest.",
         $0

commit 54cd684d002e1ccdf29eaae7d4bdc109144cde1b
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Nov 12 17:55:33 2010 -0500

    Remove empty loc params

diff --git a/share/html/Ticket/Elements/ShowUpdateStatus b/share/html/Ticket/Elements/ShowUpdateStatus
index 66d032f..c56101a 100644
--- a/share/html/Ticket/Elements/ShowUpdateStatus
+++ b/share/html/Ticket/Elements/ShowUpdateStatus
@@ -47,7 +47,7 @@
 %# END BPS TAGGED BLOCK }}}
 <div class="unread-messages">
 <&| /Widgets/TitleBox, title => loc('New messages'), title_href => "#txn-". $txn->id &>
-<&|/l, &>There are unread messages on this ticket.</&>
+<&|/l&>There are unread messages on this ticket.</&>
 <&|/l, 
  RT->Config->Get('WebPath') ."/Ticket/Display.html?id=". $Ticket->id. "#txn-".$txn->id,
  RT->Config->Get('WebPath') ."/Ticket/Display.html?id=". $Ticket->id ."&MarkAsSeen=1&Anchor=txn-" . $txn->id

commit ee87ddde15ccb4add2d207e347facd09a7a354e3
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Nov 15 14:33:11 2010 +0800

    make action Take or Steal if the actor is the owner

diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index d5dd878..13d40dd 100755
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -1703,7 +1703,17 @@ sub ProcessTicketBasics {
         my ($ChownType);
         if ( $ARGSRef->{'ForceOwnerChange'} ) {
             $ChownType = "Force";
-        } else {
+        }
+        elsif ( $session{CurrentUser}->id == $ARGSRef->{'Owner'} )
+        {
+            if ( $OrigOwner == RT->Nobody->id ) {
+                $ChownType = "Take";
+            }
+            else {
+                $ChownType = "Steal";
+            }
+        }
+        else {
             $ChownType = "Give";
         }
 

commit 823b34096dc9c926b1da524c8de11bf4b4fc54eb
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Nov 15 14:33:39 2010 +0800

    test for make action Take or Steal if the actor is the owner

diff --git a/t/web/ticket_owner.t b/t/web/ticket_owner.t
index cd1def6..bcac397 100644
--- a/t/web/ticket_owner.t
+++ b/t/web/ticket_owner.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test nodata => 1, tests => 89;
+use RT::Test nodata => 1, tests => 100;
 
 my $queue = RT::Test->load_or_create_queue( Name => 'Regression' );
 ok $queue && $queue->id, 'loaded or created queue';
@@ -128,7 +128,7 @@ diag "on reply correct owner is selected";
     is $ticket->Owner, $user_b->id, 'correct owner';
 
     $agent_a->goto_ticket( $id );
-    $agent_a->follow_link_ok({text => 'Reply'}, 'Ticket -> Basics');
+    $agent_a->follow_link_ok({text => 'Reply'}, 'Ticket -> Reply');
 
     my $form = $agent_a->form_name('TicketUpdate');
     is $form->value('Owner'), '', 'empty value selected';
@@ -352,3 +352,55 @@ diag "no Take link when owner is not nobody";
         'but have Steal link');
 }
 
+ok(
+    RT::Test->set_rights(
+        {
+            Principal => $user_a,
+            Right     => [
+                qw(SeeQueue ShowTicket CreateTicket ReplyToTicket OwnTicket TakeTicket StealTicket)
+            ]
+        },
+        { Principal => $user_b, Right => [qw(SeeQueue ShowTicket OwnTicket)] },
+    ),
+    'set rights'
+);
+
+diag "action is Take when old owner is nobody and new owner is current user";
+{ 
+    my $ticket = RT::Ticket->new( $user_a );
+    my ( $id, $txn, $msg ) = $ticket->Create(
+        Queue   => $queue->id,
+        Subject => 'test',
+    );
+    ok $id, 'created a ticket #'. $id or diag "error: $msg";
+    is $ticket->Owner, RT->Nobody->id, 'correct owner';
+
+    $agent_a->goto_ticket( $id );
+    $agent_a->content_lacks('Taken', 'No Taken in display page');
+    $agent_a->follow_link_ok({text => 'Reply'}, 'Ticket -> Reply');
+    $agent_a->form_name('TicketUpdate');
+    $agent_a->select( Owner => $user_a->id );
+    $agent_a->click('SubmitTicket');
+    $agent_a->content_contains('Taken', 'action is Take');
+}
+
+diag "action is Steal when old owner isn't nobody and new owner is current user";
+{ 
+    my $ticket = RT::Ticket->new( $user_a );
+    my ( $id, $txn, $msg ) = $ticket->Create(
+        Queue   => $queue->id,
+        Subject => 'test',
+        Owner => $user_b->id,
+    );
+    ok $id, 'created a ticket #'. $id or diag "error: $msg";
+    is $ticket->Owner, $user_b->id, 'correct owner';
+
+    $agent_a->goto_ticket( $id );
+    $agent_a->content_lacks('Stolen', 'No Stolen in display page');
+    $agent_a->follow_link_ok({text => 'Reply'}, 'Ticket -> Reply');
+    $agent_a->form_name('TicketUpdate');
+    $agent_a->select( Owner => $user_a->id );
+    $agent_a->click('SubmitTicket');
+    $agent_a->content_contains('Stolen from user_b', 'action is Steal');
+}
+

commit 9606c113cb7671c6964c8a5b29e697f0ba577d9e
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Nov 12 18:33:17 2010 -0500

    Give EditTransactionCustomFields an AsTable option
    
        To more closely mirror EditCustomFields

diff --git a/share/html/Ticket/Elements/EditTransactionCustomFields b/share/html/Ticket/Elements/EditTransactionCustomFields
index 6d9fc73..1f2b28e 100644
--- a/share/html/Ticket/Elements/EditTransactionCustomFields
+++ b/share/html/Ticket/Elements/EditTransactionCustomFields
@@ -46,23 +46,25 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 % $m->callback( CallbackName => 'BeforeTransactionCustomFields', TicketObj => $TicketObj, QueueObj => $QueueObj, NamePrefix => $NamePrefix );
+<div class="edit-transaction-custom-fields">
 % if ($CustomFields->Count) {
 % while (my $CF = $CustomFields->Next()) {
 % next unless $CF->CurrentUserHasRight('ModifyCustomField');
-<tr>
-<td class="label cflabel">
+<<% $FIELD %>>
+<<% $CELL %> class="label cflabel">
   <span class="name"><% loc($CF->Name) %>:</span><br />
   <span class="type"><% $CF->FriendlyType %></span>
-</td>
-<td>
+</<% $CELL %>>
+<<% $CELL %>>
 <& /Elements/EditCustomField,
     CustomField => $CF,
     NamePrefix => $NamePrefix
 &>
-</td>
-</tr>
+</<% $CELL %>>
+</<% $FIELD %>>
 % }
 % }
+</div>
 % $m->callback( CallbackName => 'AfterTransactionCustomFields', TicketObj => $TicketObj, QueueObj => $QueueObj, NamePrefix => $NamePrefix );
 
 <%INIT>
@@ -76,10 +78,14 @@ if ($TicketObj) {
 
 $m->callback( CallbackName => 'MassageTransactionCustomFields', CustomFields => $CustomFields );
 
+my $FIELD = $AsTable ? 'tr' : 'div';
+my $CELL  = $AsTable ? 'td' : 'div';
+
 </%INIT>
 <%ARGS>
 $NamePrefix => "Object-RT::Transaction--CustomField-"
 $TicketObj => undef
 $QueueObj => undef
+$AsTable => 0
 </%ARGS>
 

commit 19ac676afd8a4b0ae4274db1c873eeef54e7c0d4
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Fri Nov 12 18:33:52 2010 -0500

    Make Create.html TxnCFs a table to more closely match TicketCFs

diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index a6fc369..daeb5c5 100755
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -102,7 +102,7 @@
 % $m->callback( CallbackName => 'AfterOwner', ARGSRef => \%ARGS );
 
       <& /Ticket/Elements/EditCustomFields, %ARGS, QueueObj => $QueueObj, AsTable => 1 &>
-      <& /Ticket/Elements/EditTransactionCustomFields, %ARGS, QueueObj => $QueueObj &>
+      <& /Ticket/Elements/EditTransactionCustomFields, %ARGS, QueueObj => $QueueObj, AsTable => 1 &>
     </table>
   </&>
 % $m->callback( CallbackName => 'AfterBasics', QueueObj => $QueueObj );

commit ed0c0daaaf2a6a49d5e2c497e1e2a9912e7de79f
Author: Matt Zagrabelny <mzagrabe at d.umn.edu>
Date:   Fri Nov 12 18:34:27 2010 -0500

    Use EditTransactionCustomFields in ModifyAll
    
        (instead of reinventing it poorly)

diff --git a/share/html/Ticket/ModifyAll.html b/share/html/Ticket/ModifyAll.html
index 5697d69..f86f8dd 100755
--- a/share/html/Ticket/ModifyAll.html
+++ b/share/html/Ticket/ModifyAll.html
@@ -102,17 +102,8 @@
     <td class="label"><&|/l&>Subject</&>:</td>
     <td class="entry"><input name="UpdateSubject" size="60" value="<%$Ticket->Subject%>" /></td>
   </tr>
-% if (my $TxnCFs = $Ticket->TransactionCustomFields) {
-%    while (my $CF = $TxnCFs->Next()) {
-<tr>
-<td class="label"><% loc($CF->Name) %>:</td>
-<td class="entry"><& /Elements/EditCustomField, 
-    CustomField => $CF, 
-    NamePrefix => "Object-RT::Transaction--CustomField-"
-    &><em><% $CF->FriendlyType %></em>
-</td></tr>
-%    } # end if while
-% } # end of if
+
+  <tr><td colspan="2"><& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $Ticket &></td></tr>
 
 <& /Ticket/Elements/AddAttachments, %ARGS, TicketObj => $Ticket &>
 

commit 5a798edc1950047b50bcb56c7fc5646936456d07
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Nov 15 14:10:18 2010 -0500

    Integrate EditTxnCFs into the table of fields

diff --git a/share/html/Ticket/Update.html b/share/html/Ticket/Update.html
index ba04934..6582719 100755
--- a/share/html/Ticket/Update.html
+++ b/share/html/Ticket/Update.html
@@ -136,7 +136,7 @@
 
 % $m->callback( %ARGS, CallbackName => 'AfterWorked', Ticket => $TicketObj );
 
-    <& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $TicketObj &>
+<& /Ticket/Elements/EditTransactionCustomFields, %ARGS, TicketObj => $TicketObj, AsTable => 1 &>
 
   </table>
   </&>

commit 96b9a419f51a2fb913b5e012323658d3cb13dfe7
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Nov 15 14:46:24 2010 -0500

    Typo fix in the Scalar::Util breakage message

diff --git a/lib/RT.pm b/lib/RT.pm
index c8c1df5..28a8d62 100755
--- a/lib/RT.pm
+++ b/lib/RT.pm
@@ -373,7 +373,7 @@ a working Scalar::Util with a non-working one. If your system was working
 correctly up until now, this is likely the cause of the problem.
 
 Please reinstall Scalar::Util, being careful to let it build with your C
-compiler. Ususally this is as simple as running the following command as
+compiler. Usually this is as simple as running the following command as
 root.
 
     perl -MCPAN -e'install Scalar::Util'

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


More information about the Rt-commit mailing list