[rt-users] Return from a local/html template to share/html template in case of special condition

Lars Braeuer lb at mpexnet.de
Thu Sep 29 14:04:25 EDT 2011


Hi,

is there a way to return from a local/html template to the original share/html template, in case a
certain condition is met? (Please read on for more details).

With the inspiration from Joop concerning 'conditions', I found out about the html templates in
share/html/.

I want to be able to show a reduced set of date lines in the Ticket/Elements/ShowDates template to
unprivileged users.

I successfully created <rt-dir>/local/html/Ticket/Elements/ShowDates with a reduced set of dates
that is working for unprivileged users.

Question: Is there a way to return to the original ShowDates template, in case
$session{'CurrentUser'}->Privileged is true? See below for what is only working for unprivileged
users for me (because the whole template seems to be exited in case this condition is met).


<table>
  <tr class="date created">
    <td class="label"><&|/l&>Created</&>:</td>\
    <td class="value"><% $Ticket->CreatedObj->AsString %></td>
  </tr>
  <tr class="date resolved">
    <td class="label"><&|/l&>Closed</&>:</td>\
    <td class="value"><% $Ticket->ResolvedObj->AsString  %></td>
  </tr>
% $m->callback( %ARGS, CallbackName => 'EndOfList', TicketObj => $Ticket );
</table>
<%init>
#
# This is not working:
#
return if $session{'CurrentUser'}->Privileged;
</%init>
<%ARGS>
$Ticket => undef
$UpdatedLink => 1
</%ARGS>

Thanks in advance.

Best regards,

Lars



More information about the rt-users mailing list