[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.8.8-212-g385b1a7

Shawn Moore sartak at bestpractical.com
Wed Aug 4 14:45:51 EDT 2010


The branch, 3.9-trunk has been updated
       via  385b1a77248ca96169beae3a30ed3c60442611c1 (commit)
      from  d4fe09c49ec6377fb183754d76e09d3d480d5799 (commit)

Summary of changes:
 share/html/Ticket/Elements/ShowSummary |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 385b1a77248ca96169beae3a30ed3c60442611c1
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Aug 4 14:44:35 2010 -0400

    Make the Display.html titleboxes links only if user has ModifyTicket

diff --git a/share/html/Ticket/Elements/ShowSummary b/share/html/Ticket/Elements/ShowSummary
index d82daad..712a86b 100755
--- a/share/html/Ticket/Elements/ShowSummary
+++ b/share/html/Ticket/Elements/ShowSummary
@@ -51,7 +51,7 @@
 % $m->callback( %ARGS, CallbackName => 'LeftColumnTop' );
 
     <&| /Widgets/TitleBox, title => loc('The Basics'),
-        title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id,
+        ($can_modify ? (title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id) : ()),
         class => 'ticket-info-basics',
     &>
         <& /Ticket/Elements/ShowBasics, Ticket => $Ticket &>
@@ -59,7 +59,7 @@
 
 % if ($Ticket->CustomFields->First) {
     <&| /Widgets/TitleBox, title => loc('Custom Fields'),
-        title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id,
+        ($can_modify ? (title_href => RT->Config->Get('WebPath')."/Ticket/Modify.html?id=".$Ticket->Id) : ()),
         class => 'ticket-info-cfs',
     &>
         <& /Ticket/Elements/ShowCustomFields, Ticket => $Ticket &>
@@ -67,7 +67,7 @@
 % }
 
     <&| /Widgets/TitleBox, title => loc('People'),
-        title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id,
+        ($can_modify ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyPeople.html?id=".$Ticket->Id) : ()),
         class => 'ticket-info-people',
     &>
         <& /Ticket/Elements/ShowPeople, Ticket => $Ticket &>
@@ -99,7 +99,7 @@
 % }
 
     <&| /Widgets/TitleBox, title => loc("Dates"),
-        title_href => RT->Config->Get('WebPath')."/Ticket/ModifyDates.html?id=".$Ticket->Id,
+        ($can_modify ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyDates.html?id=".$Ticket->Id) : ()),
         class => 'ticket-info-dates',
     &>
         <& /Ticket/Elements/ShowDates, Ticket => $Ticket &>
@@ -109,7 +109,7 @@
 % push @extra, titleright_raw => '<a href="'. RT->Config->Get('WebPath'). '/Ticket/Graphs/index.html?id='.$Ticket->id.'">'.loc('Graph').'</a>' unless RT->Config->Get('DisableGraphViz');
 % $m->callback( %ARGS, CallbackName => 'LinksExtra', extra => \@extra );
     <&| /Widgets/TitleBox, title => loc('Links'),
-        title_href => RT->Config->Get('WebPath')."/Ticket/ModifyLinks.html?id=".$Ticket->Id,
+        ($can_modify ? (title_href => RT->Config->Get('WebPath')."/Ticket/ModifyLinks.html?id=".$Ticket->Id) : ()),
         class => 'ticket-info-links',
         @extra,
     &>
@@ -125,3 +125,6 @@
 $Ticket => undef
 $Attachments => undef
 </%ARGS>
+<%INIT>
+my $can_modify = $Ticket->CurrentUserHasRight('ModifyTicket');
+</%INIT>

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


More information about the Rt-commit mailing list