[Rt-commit] rt branch, 4.2/enable-selfservice-showattachments, created. rt-4.2.11-4-g340d4b2
Todd Wade
todd at bestpractical.com
Wed May 13 14:52:16 EDT 2015
The branch, 4.2/enable-selfservice-showattachments has been created
at 340d4b20efed3e52b78334c1d24edb6bb098dad7 (commit)
- Log -----------------------------------------------------------------
commit 340d4b20efed3e52b78334c1d24edb6bb098dad7
Author: Todd Wade <todd at bestpractical.com>
Date: Wed May 13 14:45:24 2015 -0400
Toggle attachment url based on user type in ShowAttachments component
The ShowAttachments component has '../Ticket/Attachments/..' hard coded
so using it in self service results in a link that leads back to the self
service dashboard.
This update toggles the attachment href depending on the privileged versus
unprivileged status of the user.
Fixes I#30960
diff --git a/share/html/Ticket/Elements/ShowAttachments b/share/html/Ticket/Elements/ShowAttachments
index a567844..767c03e 100644
--- a/share/html/Ticket/Elements/ShowAttachments
+++ b/share/html/Ticket/Elements/ShowAttachments
@@ -58,7 +58,7 @@
% foreach my $rev (@{$documents{$key}}) {
% if ($rev->ContentLength) {
<li><font size="-2">
-<a href="<%RT->Config->Get('WebPath')%>/Ticket/Attachment/<%$rev->TransactionId%>/<%$rev->Id%>/<%$rev->Filename | un %>">
+<a href="<%RT->Config->Get('WebPath')%>/<% $DisplayPath %>/Attachment/<%$rev->TransactionId%>/<%$rev->Id%>/<%$rev->Filename | un %>">
% my $desc = loc("[_1] ([_2]) by [_3]", $rev->CreatedAsString, $rev->FriendlyContentLength, $m->scomp('/Elements/ShowUser', User => $rev->CreatorObj));
<% $desc |n%>
</a>
@@ -90,5 +90,6 @@ while ( my $attach = $Attachments->Next() ) {
<%ARGS>
$Ticket => undef
$Attachments => undef
+$DisplayPath => $session{'CurrentUser'}->Privileged ? 'Ticket' : 'SelfService'
</%ARGS>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list