[Rt-commit] rt branch, 4.2/selfservice-topics, updated. rt-4.2.10-223-gde30822
Alex Vandiver
alexmv at bestpractical.com
Mon Mar 23 19:36:39 EDT 2015
The branch, 4.2/selfservice-topics has been updated
via de30822afc80af934ac8af465bad4655c23f0cc7 (commit)
from dfe7246d675a88985f8fae6e1d78f9694492ade0 (commit)
Summary of changes:
share/html/Elements/ShowCustomFieldBinary | 11 ++++++++++-
share/html/Elements/ShowCustomFieldImage | 10 +++++++++-
.../SelfService/{Attachment => CustomFieldValue}/dhandler | 6 +++---
3 files changed, 22 insertions(+), 5 deletions(-)
copy share/html/SelfService/{Attachment => CustomFieldValue}/dhandler (96%)
- Log -----------------------------------------------------------------
commit de30822afc80af934ac8af465bad4655c23f0cc7
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Mon Mar 23 19:36:11 2015 -0400
Support Binary and Image CFs in SelfService
diff --git a/share/html/Elements/ShowCustomFieldBinary b/share/html/Elements/ShowCustomFieldBinary
index 544b54d..3cef41f 100644
--- a/share/html/Elements/ShowCustomFieldBinary
+++ b/share/html/Elements/ShowCustomFieldBinary
@@ -45,7 +45,16 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<a href="<%RT->Config->Get('WebPath')%>/Download/CustomFieldValue/<% $Object->Id %>/<% $Object->Content |un %>"><% $Object->Content %></a>
+<%init>
+my $url = join("/",
+ RT->Config->Get('WebPath'),
+ $session{CurrentUser}->Privileged ? 'Download' : 'SelfService',
+ "CustomFieldValue",
+ $Object->Id,
+ $m->interp->apply_escapes($Object->Content, 'u')
+ );
+</%init>
+<a href="<% $url %>"><% $Object->Content %></a>
<%ARGS>
$Object => undef
</%ARGS>
diff --git a/share/html/Elements/ShowCustomFieldImage b/share/html/Elements/ShowCustomFieldImage
index f5a1886..08e7985 100644
--- a/share/html/Elements/ShowCustomFieldImage
+++ b/share/html/Elements/ShowCustomFieldImage
@@ -45,7 +45,15 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-% my $url = RT->Config->Get('WebPath') . "/Download/CustomFieldValue/".$Object->Id.'/'.$m->interp->apply_escapes($Object->Content, 'u');
+<%init>
+my $url = join("/",
+ RT->Config->Get('WebPath'),
+ $session{CurrentUser}->Privileged ? 'Download' : 'SelfService',
+ "CustomFieldValue",
+ $Object->Id,
+ $m->interp->apply_escapes($Object->Content, 'u')
+ );
+</%init>
<a href="<% $url %>"><% $Object->Content %></a><br>
<img type="<% $Object->ContentType %>" height="64" src="<% $url %>" align="middle" />
<%ARGS>
diff --git a/share/html/Elements/ShowCustomFieldBinary b/share/html/SelfService/CustomFieldValue/dhandler
similarity index 92%
copy from share/html/Elements/ShowCustomFieldBinary
copy to share/html/SelfService/CustomFieldValue/dhandler
index 544b54d..3d16c02 100644
--- a/share/html/Elements/ShowCustomFieldBinary
+++ b/share/html/SelfService/CustomFieldValue/dhandler
@@ -45,7 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<a href="<%RT->Config->Get('WebPath')%>/Download/CustomFieldValue/<% $Object->Id %>/<% $Object->Content |un %>"><% $Object->Content %></a>
-<%ARGS>
-$Object => undef
-</%ARGS>
+<%perl>
+$m->comp('/Download/CustomFieldValue/dhandler', %ARGS);
+$m->abort;
+</%perl>
-----------------------------------------------------------------------
More information about the rt-commit
mailing list