[Rt-commit] r6199 - in rt/branches/3.6-RELEASE: .

ruz at bestpractical.com ruz at bestpractical.com
Thu Oct 12 22:33:06 EDT 2006


Author: ruz
Date: Thu Oct 12 22:33:05 2006
New Revision: 6199

Modified:
   rt/branches/3.6-RELEASE/   (props changed)
   rt/branches/3.6-RELEASE/html/Ticket/Elements/Tabs

Log:
 r3949 at cubic-pc:  cubic | 2006-10-13 06:02:30 +0400
 * cache results of rights checks locally


Modified: rt/branches/3.6-RELEASE/html/Ticket/Elements/Tabs
==============================================================================
--- rt/branches/3.6-RELEASE/html/Ticket/Elements/Tabs	(original)
+++ rt/branches/3.6-RELEASE/html/Ticket/Elements/Tabs	Thu Oct 12 22:33:05 2006
@@ -138,21 +138,20 @@
 $tabs->{'this'}->{"subtabs"} = $ticket_page_tabs;
 $current_tab = "Ticket/Display.html?id=" . $id;
 
-
-
-
-
-if (    $Ticket->CurrentUserHasRight('ModifyTicket')
-     or $Ticket->CurrentUserHasRight('ReplyToTicket') ) {
-    $actions->{'F'} = { title => loc('Reply'),
-                        path  => "Ticket/Update.html?Action=Respond&id=" . $id,
+my %can = (
+    ModifyTicket => $Ticket->CurrentUserHasRight('ModifyTicket'),
+);
+
+if ( $can{'ModifyTicket'} or $Ticket->CurrentUserHasRight('ReplyToTicket') ) {
+    $actions->{'F'} = {
+        title => loc('Reply'),
+        path  => "Ticket/Update.html?Action=Respond&id=" . $id,
     };
 }
 
-if ( $Ticket->CurrentUserHasRight('ModifyTicket') ) {
+if ( $can{'ModifyTicket'} ) {
     if ( $Ticket->Status ne 'resolved' ) {
         $actions->{'G'} = {
-
             path => "Ticket/Update.html?Action=Comment&DefaultStatus=resolved&id=" . $id,
             title => loc('Resolve') };
     }
@@ -173,10 +172,10 @@
     }
 }
 
-if (    $Ticket->CurrentUserHasRight('ModifyTicket')
-     or $Ticket->CurrentUserHasRight('CommentOnTicket') ) {
-    $actions->{'E'} = { title => loc('Comment'),
-                        path  => "Ticket/Update.html?Action=Comment&id=" . $id,
+if ( $can{'ModifyTicket'} or $Ticket->CurrentUserHasRight('CommentOnTicket') ) {
+    $actions->{'E'} = {
+        title => loc('Comment'),
+        path  => "Ticket/Update.html?Action=Comment&id=" . $id,
     };
 }
 }


More information about the Rt-commit mailing list