[rt-users] Return from a local/html template to share/html template in case of special condition
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 /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). <&|/l&>Created:\ <% $Ticket->CreatedObj->AsString %> <&|/l&>Closed:\ <% $Ticket->ResolvedObj->AsString %> % $m->callback( %ARGS, CallbackName => 'EndOfList', TicketObj => $Ticket ); <%init> # # This is not working: # return if $session{'CurrentUser'}->Privileged; <%ARGS> $Ticket => undef $UpdatedLink => 1 Thanks in advance. Best regards, Lars RT Training Sessions (http://bestpractical.com/services/training.html) * Chicago, IL, USA September 26 & 27, 2011 * San Francisco, CA, USA October 18 & 19, 2011 * Washington DC, USA October 31 & November 1, 2011 * Melbourne VIC, Australia November 28 & 29, 2011 * Barcelona, Spain November 28 & 29, 2011
Re: [rt-users] Return from a local/html template to share/html template in case of special condition
Lars Braeuer wrote: 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 /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). <&|/l&>Created:\ <% $Ticket->CreatedObj->AsString %> <&|/l&>Closed:\ <% $Ticket->ResolvedObj->AsString %> % $m->callback( %ARGS, CallbackName => 'EndOfList', TicketObj => $Ticket ); <%init> # # This is not working: # return if $session{'CurrentUser'}->Privileged; <%ARGS> $Ticket => undef $UpdatedLink => 1 You're almost there. I have the following in my Tickets/Elements/ShowTransaction %if (!$user->Privileged) { # anonymize support staff <% "Support" %> - <% $TicketString %> <% $desc %> %} %else { <% $Transaction->CreatorObj->Name %> - <% $TicketString %> <% $desc %> %} %if ($user->Privileged) {# show only time info for privileged staff <% $TimeTaken %> %} <% $titlebar_commands |n %> Just move the check for Privileged into the html table part and display according to Privileged or noet. Success, Joop RT Training Sessions (http://bestpractical.com/services/training.html) * Chicago, IL, USA September 26 & 27, 2011 * San Francisco, CA, USA October 18 & 19, 2011 * Washington DC, USA October 31 & November 1, 2011 * Melbourne VIC, Australia November 28 & 29, 2011 * Barcelona, Spain November 28 & 29, 2011