[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-236-gc199554

Shawn Moore sartak at bestpractical.com
Mon Aug 9 22:44:51 EDT 2010


The branch, 3.9-trunk has been updated
       via  c199554e14e98778329a549111cd277f546b3a56 (commit)
       via  5e7b3f29e3004dcdeb943a36a985f9ae8d863a39 (commit)
      from  348268e45bcfd6884bffaa338470f01c29a3edfe (commit)

Summary of changes:
 share/html/Ticket/Elements/ShowSummary |    5 ++++-
 share/html/Ticket/Elements/Tabs        |   17 ++++++++++++-----
 t/web/ticket_owner.t                   |    5 ++---
 3 files changed, 18 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit 5e7b3f29e3004dcdeb943a36a985f9ae8d863a39
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Aug 9 22:46:22 2010 -0400

    Be more lax about displaying links when you have ticket ownership rights

diff --git a/share/html/Ticket/Elements/ShowSummary b/share/html/Ticket/Elements/ShowSummary
index 6a6257f..35ff67e 100755
--- a/share/html/Ticket/Elements/ShowSummary
+++ b/share/html/Ticket/Elements/ShowSummary
@@ -67,7 +67,7 @@
 % }
 
     <&| /Widgets/TitleBox, title => loc('People'),
-        ($can_modify ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id) : ()),
+        (($can_modify || $can_modify_owner) ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id) : ()),
         class => 'ticket-info-people',
     &>
         <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
@@ -128,4 +128,7 @@ $Attachments => undef
 <%INIT>
 my $can_modify = $Ticket->CurrentUserHasRight('ModifyTicket');
 my $can_modify_cf = $Ticket->CurrentUserHasRight('ModifyCustomField');
+my $can_modify_owner = $Ticket->CurrentUserHasRight('OwnTicket')
+                    || $Ticket->CurrentUserHasRight('TakeTicket')
+                    || $Ticket->CurrentUserHasRight('StealTicket');
 </%INIT>
diff --git a/share/html/Ticket/Elements/Tabs b/share/html/Ticket/Elements/Tabs
index b720d1a..b1428b0 100755
--- a/share/html/Ticket/Elements/Tabs
+++ b/share/html/Ticket/Elements/Tabs
@@ -120,6 +120,10 @@ if ($Ticket) {
         ModifyCustomField => $Ticket->CurrentUserHasRight('ModifyCustomField'),
     );
 
+    $can{_ModifyOwner} = $Ticket->CurrentUserHasRight('OwnTicket')
+                      || $Ticket->CurrentUserHasRight('TakeTicket')
+                      || $Ticket->CurrentUserHasRight('StealTicket');
+
     my $ticket_page_tabs = {
         _A => {
             title => loc('Display'),
@@ -139,22 +143,25 @@ if ($Ticket) {
         };
     }
 
+    if ($can{ModifyTicket} || $can{_ModifyOwner}) {
+        $ticket_page_tabs->{_D} = {
+            title => loc('People'),
+            path  => "Ticket/ModifyPeople.html?id=" . $id,
+        };
+    }
+
     if ($can{ModifyTicket}) {
         $ticket_page_tabs->{_C} = {
             title => loc('Dates'),
             path  => "Ticket/ModifyDates.html?id=" . $id,
         };
-        $ticket_page_tabs->{_D} = {
-            title => loc('People'),
-            path  => "Ticket/ModifyPeople.html?id=" . $id,
-        };
         $ticket_page_tabs->{_E} = {
             title => loc('Links'),
             path  => "Ticket/ModifyLinks.html?id=" . $id,
         };
     }
 
-    if ($can{ModifyTicket} || $can{ModifyCustomField}) {
+    if ($can{ModifyTicket} || $can{ModifyCustomField} || $can{_ModifyOwner}) {
         $ticket_page_tabs->{_X} = {
             title => loc('Jumbo'),
             path  => "Ticket/ModifyAll.html?id=" . $id,

commit c199554e14e98778329a549111cd277f546b3a56
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Mon Aug 9 22:46:42 2010 -0400

    The link doesn't exist any more, so just go directly to Modify

diff --git a/t/web/ticket_owner.t b/t/web/ticket_owner.t
index 0bacaf1..e9b1d8d 100644
--- a/t/web/ticket_owner.t
+++ b/t/web/ticket_owner.t
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 
-use RT::Test tests => 91;
+use RT::Test tests => 89;
 
 my $queue = RT::Test->load_or_create_queue( Name => 'Regression' );
 ok $queue && $queue->id, 'loaded or created queue';
@@ -95,8 +95,7 @@ diag "user A can not change owner after create" if $ENV{TEST_VERBOSE};
     # try the following group of tests twice with different agents(logins)
     my $test_cb = sub {
         my $agent = shift;
-        $agent->goto_ticket( $id );
-        $agent->follow_link_ok({text => 'Basics'}, 'Ticket -> Basics');
+        $agent->get("/Ticket/Modify.html?id=$id");
         my $form = $agent->form_number(3);
         is $form->value('Owner'), $user_b->id, 'correct owner selected';
         $agent->select('Owner', $RT::Nobody->id);

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


More information about the Rt-commit mailing list