[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-526-gd57c85f

Thomas Sibley trs at bestpractical.com
Tue Aug 24 11:23:53 EDT 2010


The branch, 3.9-trunk has been updated
       via  d57c85f2a395e5a861de019bd4898681927197da (commit)
       via  4e80c9184e2ece8e59854d8ef584569af70d25d5 (commit)
       via  eab9370481bf34dc3d2d47bd1890f54f1fa2541d (commit)
       via  e341fefca81a65eea55f80cd43cb4ceefe6495a2 (commit)
       via  e7f889ae732736dc81ddcd85e745b56c02f27784 (commit)
      from  e643ff17ff0b2ce29c2518b05a7e906302eb0973 (commit)

Summary of changes:
 share/html/SelfService/Elements/Tabs  |    5 +++--
 share/html/Ticket/Create.html         |    2 +-
 share/html/Ticket/Elements/ShowBasics |    5 ++++-
 share/html/Ticket/Elements/ShowQueue  |   10 +++++++++-
 4 files changed, 17 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit e7f889ae732736dc81ddcd85e745b56c02f27784
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Aug 24 10:45:39 2010 -0400

    Create tickets based on queue IDs rather than Names
    
    If a user has the CreateTicket right, but not the SeeQueue right, the
    Name will be undefined, meaning no Queue parameter is sent with the
    ticket create form.  Queue IDs are always visible, however, and work
    just as well to create tickets.

diff --git a/share/html/Ticket/Create.html b/share/html/Ticket/Create.html
index 4a78aed..6932bd8 100755
--- a/share/html/Ticket/Create.html
+++ b/share/html/Ticket/Create.html
@@ -69,7 +69,7 @@
 
 <div id="ticket-create-metadata">
   <&| /Widgets/TitleBox, title => loc("Ticket") &>
-    <input type="hidden" class="hidden" name="Queue" value="<% $QueueObj->Name %>" />
+    <input type="hidden" class="hidden" name="Queue" value="<% $QueueObj->Id %>" />
     <table border="0">
     <& /Ticket/Elements/EditBasics,
         InTable => 1,

commit e341fefca81a65eea55f80cd43cb4ceefe6495a2
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Aug 24 11:02:43 2010 -0400

    Don't show a new ticket link if the user can't see any queues
    
    We should consider making this depend on CreateTicket instead (perhaps
    at the RT::Queues level), so that at least a user can create a new
    ticket via the web UI even if they don't know what queue it's going
    into.  For users with CreateTicket on multiple queues, we'd have to use
    a default queue setting of some sort, perhaps
    RT->Config->Get('DefaultQueue').

diff --git a/share/html/SelfService/Elements/Tabs b/share/html/SelfService/Elements/Tabs
index 36ac3bf..27dd0ad 100755
--- a/share/html/SelfService/Elements/Tabs
+++ b/share/html/SelfService/Elements/Tabs
@@ -59,7 +59,7 @@ my $queues = RT::Queues->new($session{'CurrentUser'});
 $queues->UnLimit;
 
 my $queue_count = 0;
-my $queue_id = 1;
+my $queue_id;
 
 while (my $queue = $queues->Next) {
   next unless $queue->CurrentUserHasRight('CreateTicket');
@@ -87,7 +87,8 @@ if ($queue_count > 1) {
         $tabs->{C} = { title => loc('New ticket'),
                        path => 'SelfService/CreateTicketInQueue.html'
                        };
-} else {
+}
+elsif ($queue_id) {
         $tabs->{C} = { title => loc('New ticket'),
                        path => 'SelfService/Create.html?Queue=' . $queue_id
                        };

commit eab9370481bf34dc3d2d47bd1890f54f1fa2541d
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Aug 24 11:17:21 2010 -0400

    Make ShowQueue actually use the value it calculates
    
    This means queues which the user can't see will be shown as "#id".

diff --git a/share/html/Ticket/Elements/ShowQueue b/share/html/Ticket/Elements/ShowQueue
index 5b9c3d4..f91fb9d 100644
--- a/share/html/Ticket/Elements/ShowQueue
+++ b/share/html/Ticket/Elements/ShowQueue
@@ -45,7 +45,7 @@
 %# those contributions and any derivatives thereof.
 %# 
 %# END BPS TAGGED BLOCK }}}
-<% $QueueObj->Name %>
+<% $value %>
 <%ARGS>
 $QueueObj
 </%ARGS>

commit 4e80c9184e2ece8e59854d8ef584569af70d25d5
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Aug 24 11:20:25 2010 -0400

    Only show the queue if the user can see it, which seems more friendly

diff --git a/share/html/Ticket/Elements/ShowBasics b/share/html/Ticket/Elements/ShowBasics
index f2bf562..7c2a88a 100755
--- a/share/html/Ticket/Elements/ShowBasics
+++ b/share/html/Ticket/Elements/ShowBasics
@@ -76,10 +76,13 @@
     <td class="label"><&|/l&>Priority</&>:</td>
     <td class="value"><& ShowPriority, Ticket => $Ticket &></td>
   </tr>
+%# This will check SeeQueue at the ticket role level, queue level, and global level
+% if ($Ticket->CurrentUserHasRight('SeeQueue')) {
   <tr class="queue">
     <td class="label"><&|/l&>Queue</&>:</td>
     <td class="value"><& ShowQueue, QueueObj => $Ticket->QueueObj &></td>
   </tr>
+% }
 % $m->callback( %ARGS, CallbackName => 'EndOfList', TicketObj => $Ticket );
 </table>
 <%ARGS>

commit d57c85f2a395e5a861de019bd4898681927197da
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Tue Aug 24 11:21:03 2010 -0400

    Respect ticket role-based rights for SeeQueue on ticket queue display
    
    If a user has SeeQueue from being a Requestor (or Owner, AdminCc, etc)
    on a ticket, then they should be able to, you know, see the queue.
    
    Ideally RT::Queue would handle this with ACLEquivalenceObjects and a
    context object system similar to RT::CustomField.  Then ticket objects
    could set themselves as the queue context, and the rights would work out
    correctly.  Care would need to be taken to avoid causing an ACL loop
    (queue -> ticket -> queue -> ...) since tickets call their queues
    equivalent too.  If such a change was implemented, this commit could be
    reverted.

diff --git a/share/html/Ticket/Elements/ShowBasics b/share/html/Ticket/Elements/ShowBasics
index 7c2a88a..5a5d413 100755
--- a/share/html/Ticket/Elements/ShowBasics
+++ b/share/html/Ticket/Elements/ShowBasics
@@ -80,7 +80,7 @@
 % if ($Ticket->CurrentUserHasRight('SeeQueue')) {
   <tr class="queue">
     <td class="label"><&|/l&>Queue</&>:</td>
-    <td class="value"><& ShowQueue, QueueObj => $Ticket->QueueObj &></td>
+    <td class="value"><& ShowQueue, Ticket => $Ticket, QueueObj => $Ticket->QueueObj &></td>
   </tr>
 % }
 % $m->callback( %ARGS, CallbackName => 'EndOfList', TicketObj => $Ticket );
diff --git a/share/html/Ticket/Elements/ShowQueue b/share/html/Ticket/Elements/ShowQueue
index f91fb9d..ee6d085 100644
--- a/share/html/Ticket/Elements/ShowQueue
+++ b/share/html/Ticket/Elements/ShowQueue
@@ -47,10 +47,18 @@
 %# END BPS TAGGED BLOCK }}}
 <% $value %>
 <%ARGS>
+$Ticket => undef
 $QueueObj
 </%ARGS>
 <%INIT>
 my $value = $QueueObj->Name;
+
+if ( $Ticket and $Ticket->CurrentUserHasRight('SeeQueue') ) {
+    # Grab the queue name anyway if the current user can
+    # see the queue based on his role for this ticket
+    $value = $QueueObj->__Value('Name');
+}
+
 $value = '#'. $QueueObj->id
     unless defined $value && length $value;
 </%INIT>

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


More information about the Rt-commit mailing list