[rt-users] Callback to redirect page in Create.html
Jim Lesinski
jim.lesinski at gmail.com
Tue Jun 12 11:27:12 EDT 2012
I had thought about doing that but it seemed like there would be some way
to access the queue from the ARGSRef. It's good to know that is an option.
How are you handling custom field layout in your CreateNew.html then?
Ideally I would like to modify the layout of some custom fields or maybe
put them into their own section. It looks like the fields are all rendered
in /Ticket/Elements/EditCustomFields.
What is the best practice there?
Thanks,
Jim
On Tue, Jun 12, 2012 at 3:29 AM, Renney, Paul <paul.renney at logica.com>wrote:
> Jim,
>
> I did it the following way in RT 4.0.5:
>
> Copied share/html/Ticket/Create.html into the local/html/Ticket directory,
> changed the Init callback line in Create.html to make:
>
> $m->callback( CallbackName => "Init", ARGSRef => \%ARGS, QueueObj =>
> QueueObj );
>
> Copied original Create.html into local directory and renamed original
> Create.html to another name (CreateNew.html).
>
> In the callback you described
> (local/html/Callbacks/MYNAME/Ticket/Create.html/Init) I have:
>
> <%init>
> if ($Queueobj->Name eq 'Custom Queue Name'){
> $m->redirect($RT::WebURL."Ticket/CreateNew.html?Queue=".$QueueObj->id);
> }
> </%init>
>
> <%ARGS>
> $QueueObj => undef
> </%ARGS>
>
> The WebURL part is probably not needed, and I'm not sure what the ARGS
> section does, but I don't want to change it now as it works. Apologies if
> there are any typos, I'm copying it across manually from another terminal.
>
> Regards,
> Paul
>
> ------------------------------
> *From:* rt-users-bounces at lists.bestpractical.com [
> rt-users-bounces at lists.bestpractical.com] on behalf of Jim Lesinski [
> jim.lesinski at gmail.com]
> *Sent:* 11 June 2012 23:39
> *To:* rt-users at lists.bestpractical.com
> *Subject:* [rt-users] Callback to redirect page in Create.html
>
> Hello,
>
> Can anyone offer any insight about creating a Callback in Create.html to
> redirect to a custom create page an a per queue basis? I believe I have the
> correct callback in:
>
> /opt/rt4/local/html/Callbacks/MYNAME/Ticket/Create.html/Init
>
> and I am able to perform the redirect, but can't seem to get the queue
> name properly to test the queue name. I am thinking it would be something
> like
>
> <%init>
> %if ($Queueobj->Name eq 'Whatever'){
> $m->redirect('/Tickets/custom.html');
> }
> </%init>
>
>
> the redirect portion works fine, I just don't know how to get the queue
> name. If anyone wants to offer up an end to end solution including an
> example custom page that would be even better!
>
> Thanks,
> Jim
>
> Think green - keep it on the screen. This e-mail and any attachment is for
> authorised use by the intended recipient(s) only. It may contain
> proprietary material, confidential information and/or be subject to legal
> privilege. It should not be copied, disclosed to, retained or used by, any
> other party. If you are not an intended recipient then please promptly
> delete this e-mail and any attachment and all copies and inform the sender.
> Thank you.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120612/6987cbfe/attachment.htm>
More information about the rt-users
mailing list